diff options
Diffstat (limited to 'crypto/src/security/AgreementUtilities.cs')
-rw-r--r-- | crypto/src/security/AgreementUtilities.cs | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/crypto/src/security/AgreementUtilities.cs b/crypto/src/security/AgreementUtilities.cs index 5fef5f877..041aeeed2 100644 --- a/crypto/src/security/AgreementUtilities.cs +++ b/crypto/src/security/AgreementUtilities.cs @@ -67,24 +67,19 @@ namespace Org.BouncyCastle.Security return GetBasicAgreementWithKdf(oid.Id, wrapAlgorithm); } - public static IBasicAgreement GetBasicAgreementWithKdf( - string agreeAlgorithm, - string wrapAlgorithm) + public static IBasicAgreement GetBasicAgreementWithKdf(string agreeAlgorithm, string wrapAlgorithm) { string mechanism = GetMechanism(agreeAlgorithm); // 'DHWITHSHA1KDF' retained for backward compatibility if (mechanism == "DHWITHSHA1KDF" || mechanism == "ECDHWITHSHA1KDF") - return new ECDHWithKdfBasicAgreement( - wrapAlgorithm, - new ECDHKekGenerator( - new Sha1Digest())); + return new ECDHWithKdfBasicAgreement(wrapAlgorithm, new ECDHKekGenerator(new Sha1Digest())); + + if (mechanism == "ECCDHWITHSHA1KDF") + return new ECDHCWithKdfBasicAgreement(wrapAlgorithm, new ECDHKekGenerator(new Sha1Digest())); if (mechanism == "ECMQVWITHSHA1KDF") - return new ECMqvWithKdfBasicAgreement( - wrapAlgorithm, - new ECDHKekGenerator( - new Sha1Digest())); + return new ECMqvWithKdfBasicAgreement(wrapAlgorithm, new ECDHKekGenerator(new Sha1Digest())); throw new SecurityUtilityException("Basic Agreement (with KDF) " + agreeAlgorithm + " not recognised."); } |