diff options
| author | Ade Lee <alee@redhat.com> | 2017-03-29 10:46:22 -0400 |
|---|---|---|
| committer | Ade Lee <alee@redhat.com> | 2017-04-03 13:12:37 -0400 |
| commit | 136d22953d05c459986a98465e4266bac37b44dc (patch) | |
| tree | 08308d51da819b5f2635ba46d44833c441412b33 /base/java-tools/src | |
| parent | 8fb9d144eaad8f22b3f38c1b2c5b08e79f1edd3f (diff) | |
| download | pki-136d22953d05c459986a98465e4266bac37b44dc.tar.gz pki-136d22953d05c459986a98465e4266bac37b44dc.tar.xz pki-136d22953d05c459986a98465e4266bac37b44dc.zip | |
Fix generation of CRMF request for ECC keys
Old CRMFPopClients add the OID for ECC public keys in the encryption
algorithm OID for no obvious reason (considering the OID was never
read on the server side to begin with).
Now that we do read and use that field, we need to set it properly,
and also special case on the server side to handle old clients.
Change-Id: I0d753e572206e9062746c879ce683978e5e657bd
Diffstat (limited to 'base/java-tools/src')
| -rw-r--r-- | base/java-tools/src/com/netscape/cmstools/CRMFPopClient.java | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/base/java-tools/src/com/netscape/cmstools/CRMFPopClient.java b/base/java-tools/src/com/netscape/cmstools/CRMFPopClient.java index 901528c2f..9d81a72a6 100644 --- a/base/java-tools/src/com/netscape/cmstools/CRMFPopClient.java +++ b/base/java-tools/src/com/netscape/cmstools/CRMFPopClient.java @@ -562,7 +562,7 @@ public class CRMFPopClient { } byte[] iv = CryptoUtil.getNonceData(encryptAlg.getIVLength()); - AlgorithmIdentifier aid = getAlgorithmId(algorithm, encryptAlg, iv); + AlgorithmIdentifier aid = new AlgorithmIdentifier(encryptAlg.toOID(), new OCTET_STRING(iv)); WrappingParams params = getWrappingParams(encryptAlg, iv); PKIArchiveOptions opts = CryptoUtil.createPKIArchiveOptions( @@ -600,20 +600,6 @@ public class CRMFPopClient { } } - private AlgorithmIdentifier getAlgorithmId(String algorithm, EncryptionAlgorithm encryptAlg, byte[] iv) - throws Exception { - AlgorithmIdentifier aid; - if (algorithm.equals("rsa")) { - aid = new AlgorithmIdentifier(encryptAlg.toOID(), new OCTET_STRING(iv)); - } else if (algorithm.equals("ec")) { - // TODO(alee) figure out what this should be for ECC - aid = new AlgorithmIdentifier(new OBJECT_IDENTIFIER("1.2.840.10045.2.1"), new OCTET_STRING(iv)); - } else { - throw new Exception("Unknown algorithm: " + algorithm); - } - return aid; - } - public OCTET_STRING createIDPOPLinkWitness() throws Exception { String secretValue = "testing"; |
