Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CryptoUtil.getKeywrapAlgorithmFromOID: Fix DES-EDE3-CBC selection #258

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions base/kra/src/com/netscape/kra/SecurityDataProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ public boolean archive(IRequest request)
KeyRequestService.SYMKEY_TYPES.get(algorithm),
strength);
} catch (Exception e) {
CMS.debug("Can't decrypt symmetric key:");
CMS.debug(e);
throw new EBaseException("Can't decrypt symmetric key.", e);
}
}
Expand All @@ -222,6 +224,8 @@ public boolean archive(IRequest request)
secdata,
null);
} catch (Exception e) {
CMS.debug("Can't decrypt passphrase.");
CMS.debug(e);
throw new EBaseException("Can't decrypt passphrase.", e);
}

Expand Down
4 changes: 2 additions & 2 deletions base/util/src/com/netscape/cmsutil/crypto/CryptoUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -3111,10 +3111,10 @@ public static KeyWrapAlgorithm getKeyWrapAlgorithmFromOID(String wrapOID) throws
if (oid.equals(KeyWrapAlgorithm.AES_CBC_PAD_OID))
return KeyWrapAlgorithm.AES_CBC_PAD;

if (oid.equals(KeyWrapAlgorithm.DES_CBC_PAD_OID))
if (oid.equals(KeyWrapAlgorithm.DES3_CBC_PAD_OID))
return KeyWrapAlgorithm.DES3_CBC_PAD;

throw new NoSuchAlgorithmException();
throw new NoSuchAlgorithmException(wrapOID);
}

}
Expand Down
2 changes: 1 addition & 1 deletion base/util/src/netscape/security/util/WrappingParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public WrappingParams(String encryptOID, String wrapName, String priKeyAlgo, IVP
// New clients set this correctly.
// We'll assume the old DES3 wrapping here.
encrypt = EncryptionAlgorithm.DES_CBC_PAD;
} else if (encryptOID.equals(KeyWrapAlgorithm.DES_CBC_PAD_OID.toString())) {
} else if (encryptOID.equals(KeyWrapAlgorithm.DES3_CBC_PAD_OID.toString())) {
encrypt = EncryptionAlgorithm.DES3_CBC_PAD;
} else if (encryptOID.equals(KeyWrapAlgorithm.AES_CBC_PAD_OID.toString())) {
encrypt = EncryptionAlgorithm.AES_128_CBC_PAD;
Expand Down