OLD | NEW |
1 /* | 1 /* |
2 * Key Derivation that doesn't use PKCS11 | 2 * Key Derivation that doesn't use PKCS11 |
3 * | 3 * |
4 * This Source Code Form is subject to the terms of the Mozilla Public | 4 * This Source Code Form is subject to the terms of the Mozilla Public |
5 * License, v. 2.0. If a copy of the MPL was not distributed with this | 5 * License, v. 2.0. If a copy of the MPL was not distributed with this |
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
7 /* $Id: derive.c,v 1.16 2012/06/11 02:38:30 emaldona%redhat.com Exp $ */ | 7 /* $Id$ */ |
8 | 8 |
9 #include "ssl.h" /* prereq to sslimpl.h */ | 9 #include "ssl.h" /* prereq to sslimpl.h */ |
10 #include "certt.h" /* prereq to sslimpl.h */ | 10 #include "certt.h" /* prereq to sslimpl.h */ |
11 #include "keythi.h" /* prereq to sslimpl.h */ | 11 #include "keythi.h" /* prereq to sslimpl.h */ |
12 #include "sslimpl.h" | 12 #include "sslimpl.h" |
13 #ifndef NO_PKCS11_BYPASS | 13 #ifndef NO_PKCS11_BYPASS |
14 #include "blapi.h" | 14 #include "blapi.h" |
15 #endif | 15 #endif |
16 | 16 |
17 #include "keyhi.h" | 17 #include "keyhi.h" |
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
757 /* convert to strength in bits */ | 757 /* convert to strength in bits */ |
758 serverKeyStrengthInBits *= BPB; | 758 serverKeyStrengthInBits *= BPB; |
759 | 759 |
760 signatureKeyStrength = | 760 signatureKeyStrength = |
761 SSL_RSASTRENGTH_TO_ECSTRENGTH(serverKeyStrengthInBits); | 761 SSL_RSASTRENGTH_TO_ECSTRENGTH(serverKeyStrengthInBits); |
762 | 762 |
763 if ( requiredECCbits > signatureKeyStrength ) | 763 if ( requiredECCbits > signatureKeyStrength ) |
764 requiredECCbits = signatureKeyStrength; | 764 requiredECCbits = signatureKeyStrength; |
765 | 765 |
766 ec_curve = | 766 ec_curve = |
767 » » ssl3_GetCurveWithECKeyStrength(SSL3_SUPPORTED_CURVES_MASK, | 767 » » ssl3_GetCurveWithECKeyStrength( |
768 » » » » » » requiredECCbits); | 768 » » » » » ssl3_GetSupportedECCCurveMask(NULL), |
| 769 » » » » » requiredECCbits); |
769 rv = ssl3_ECName2Params(NULL, ec_curve, &ecParams); | 770 rv = ssl3_ECName2Params(NULL, ec_curve, &ecParams); |
770 if (rv == SECFailure) { | 771 if (rv == SECFailure) { |
771 break; | 772 break; |
772 } | 773 } |
773 pecParams = &ecParams; | 774 pecParams = &ecParams; |
774 } | 775 } |
775 | 776 |
776 if (testecdhe) { | 777 if (testecdhe) { |
777 /* generate server's ephemeral keys */ | 778 /* generate server's ephemeral keys */ |
778 keapriv = SECKEY_CreateECPrivateKey(pecParams, &keapub, NULL); | 779 keapriv = SECKEY_CreateECPrivateKey(pecParams, &keapub, NULL); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
856 if (srvPubkey) { | 857 if (srvPubkey) { |
857 SECKEY_DestroyPublicKey(srvPubkey); | 858 SECKEY_DestroyPublicKey(srvPubkey); |
858 srvPubkey = NULL; | 859 srvPubkey = NULL; |
859 } | 860 } |
860 | 861 |
861 | 862 |
862 return rv; | 863 return rv; |
863 #endif /* NO_PKCS11_BYPASS */ | 864 #endif /* NO_PKCS11_BYPASS */ |
864 } | 865 } |
865 | 866 |
OLD | NEW |