santuario-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 49493] New: Cannot resolve PrivateKeys used in Key Transport algorithms
Date Wed, 23 Jun 2010 14:56:54 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=49493

           Summary: Cannot resolve PrivateKeys used in Key Transport
                    algorithms
           Product: Security
           Version: unspecified
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Encryption
        AssignedTo: security-dev@xml.apache.org
        ReportedBy: Clement_Pellerin@ibi.com


Created an attachment (id=25632)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=25632)
source code patch with new junit

During decryption, XMLCipher needs to find the key to decrypt an encrypted key.
The kek can be provided by the caller, otherwise XMLCipher can call the
KeyResolvers to resolve the kek. The KeyResolvers work fine if the Key
Encryption Key is a symmetric key because the SecretKey can be returned by
KeyInfo.getSecretKey(). When the Key Transport algorithm is RSA-1.5 or
RSA-OAEP, the key we need is a PrivateKey and there are no calls that can
return an object of this type.

To reproduce use the junit included in the source patch attached to the bug.

The solution is to introduce a new method called
engineLookupAndResolvePrivateKey() in the KeyResolverSpi base class. The new
method returns a PrivateKey. In XMLCipher, we now check which algorithm was
used to encrypt the key, and if the kek type is RSA, we resolve a PrivateKey
instead of a SecretKey.

Notice the StorageResolvers have no way to return a PrivateKey either.
To avoid controversy, the proposed solution does not affect StorageResolver.
The custom KeyResolver implementing engineLookupAndResolvePrivateKey() must
know a source of PrivateKeys other than StorageResolver. This explains why the
StorageResolver argument of engineLookupAndResolvePrivateKey() is always null.
The hope is that one day new APIs will be added to StorageResolver and we'll be
able to pass StorageResolvers in the existing argument.

This solution does not depend on Bug 49465, but both are needed to allow
PrivateKey KeyResolvers per KeyInfo.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Mime
View raw message