Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(590)

Side by Side Diff: nss/lib/softoken/pkcs11c.c

Issue 70673004: Update to NSS 3.15.3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/nss/
Patch Set: Update to NSS 3.15.3 Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* This Source Code Form is subject to the terms of the Mozilla Public 1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 /* 4 /*
5 * This file implements PKCS 11 on top of our existing security modules 5 * This file implements PKCS 11 on top of our existing security modules
6 * 6 *
7 * For more information about PKCS 11 See PKCS 11 Token Inteface Standard. 7 * For more information about PKCS 11 See PKCS 11 Token Inteface Standard.
8 * This implementation has two slots: 8 * This implementation has two slots:
9 * slot 1 is our generic crypto support. It does not require login. 9 * slot 1 is our generic crypto support. It does not require login.
10 * It supports Public Key ops, and all they bulk ciphers and hashes. 10 * It supports Public Key ops, and all they bulk ciphers and hashes.
(...skipping 3616 matching lines...) Expand 10 before | Expand all | Expand 10 after
3627 sftk_DeleteAttributeType(key,CKA_VALUE); 3627 sftk_DeleteAttributeType(key,CKA_VALUE);
3628 3628
3629 /* Now Set up the parameters to generate the key (based on mechanism) */ 3629 /* Now Set up the parameters to generate the key (based on mechanism) */
3630 key_gen_type = nsc_bulk; /* bulk key by default */ 3630 key_gen_type = nsc_bulk; /* bulk key by default */
3631 switch (pMechanism->mechanism) { 3631 switch (pMechanism->mechanism) {
3632 case CKM_CDMF_KEY_GEN: 3632 case CKM_CDMF_KEY_GEN:
3633 case CKM_DES_KEY_GEN: 3633 case CKM_DES_KEY_GEN:
3634 case CKM_DES2_KEY_GEN: 3634 case CKM_DES2_KEY_GEN:
3635 case CKM_DES3_KEY_GEN: 3635 case CKM_DES3_KEY_GEN:
3636 checkWeak = PR_TRUE; 3636 checkWeak = PR_TRUE;
3637 /* fall through */
3637 case CKM_RC2_KEY_GEN: 3638 case CKM_RC2_KEY_GEN:
3638 case CKM_RC4_KEY_GEN: 3639 case CKM_RC4_KEY_GEN:
3639 case CKM_GENERIC_SECRET_KEY_GEN: 3640 case CKM_GENERIC_SECRET_KEY_GEN:
3640 case CKM_SEED_KEY_GEN: 3641 case CKM_SEED_KEY_GEN:
3641 case CKM_CAMELLIA_KEY_GEN: 3642 case CKM_CAMELLIA_KEY_GEN:
3642 case CKM_AES_KEY_GEN: 3643 case CKM_AES_KEY_GEN:
3643 case CKM_NSS_CHACHA20_KEY_GEN: 3644 case CKM_NSS_CHACHA20_KEY_GEN:
3644 #if NSS_SOFTOKEN_DOES_RC5 3645 #if NSS_SOFTOKEN_DOES_RC5
3645 case CKM_RC5_KEY_GEN: 3646 case CKM_RC5_KEY_GEN:
3646 #endif 3647 #endif
3647 crv = nsc_SetupBulkKeyGen(pMechanism->mechanism,&key_type,&key_length); 3648 crv = nsc_SetupBulkKeyGen(pMechanism->mechanism,&key_type,&key_length);
3648 break; 3649 break;
3649 case CKM_SSL3_PRE_MASTER_KEY_GEN: 3650 case CKM_SSL3_PRE_MASTER_KEY_GEN:
3650 key_type = CKK_GENERIC_SECRET; 3651 key_type = CKK_GENERIC_SECRET;
3651 key_length = 48; 3652 key_length = 48;
3652 key_gen_type = nsc_ssl; 3653 key_gen_type = nsc_ssl;
3653 break; 3654 break;
3654 case CKM_PBA_SHA1_WITH_SHA1_HMAC: 3655 case CKM_PBA_SHA1_WITH_SHA1_HMAC:
3655 case CKM_NETSCAPE_PBE_SHA1_HMAC_KEY_GEN: 3656 case CKM_NETSCAPE_PBE_SHA1_HMAC_KEY_GEN:
3656 case CKM_NETSCAPE_PBE_MD5_HMAC_KEY_GEN: 3657 case CKM_NETSCAPE_PBE_MD5_HMAC_KEY_GEN:
3657 case CKM_NETSCAPE_PBE_MD2_HMAC_KEY_GEN: 3658 case CKM_NETSCAPE_PBE_MD2_HMAC_KEY_GEN:
3658 key_gen_type = nsc_pbe; 3659 key_gen_type = nsc_pbe;
3659 key_type = CKK_GENERIC_SECRET; 3660 key_type = CKK_GENERIC_SECRET;
3660 crv = nsc_SetupHMACKeyGen(pMechanism, &pbe_param); 3661 crv = nsc_SetupHMACKeyGen(pMechanism, &pbe_param);
3661 break; 3662 break;
3662 case CKM_NETSCAPE_PBE_SHA1_FAULTY_3DES_CBC: 3663 case CKM_NETSCAPE_PBE_SHA1_FAULTY_3DES_CBC:
3663 faultyPBE3DES = PR_TRUE; 3664 faultyPBE3DES = PR_TRUE;
3665 /* fall through */
3664 case CKM_NETSCAPE_PBE_SHA1_TRIPLE_DES_CBC: 3666 case CKM_NETSCAPE_PBE_SHA1_TRIPLE_DES_CBC:
3665 case CKM_NETSCAPE_PBE_SHA1_40_BIT_RC2_CBC: 3667 case CKM_NETSCAPE_PBE_SHA1_40_BIT_RC2_CBC:
3666 case CKM_NETSCAPE_PBE_SHA1_DES_CBC: 3668 case CKM_NETSCAPE_PBE_SHA1_DES_CBC:
3667 case CKM_NETSCAPE_PBE_SHA1_128_BIT_RC2_CBC: 3669 case CKM_NETSCAPE_PBE_SHA1_128_BIT_RC2_CBC:
3668 case CKM_NETSCAPE_PBE_SHA1_40_BIT_RC4: 3670 case CKM_NETSCAPE_PBE_SHA1_40_BIT_RC4:
3669 case CKM_NETSCAPE_PBE_SHA1_128_BIT_RC4: 3671 case CKM_NETSCAPE_PBE_SHA1_128_BIT_RC4:
3670 case CKM_PBE_SHA1_DES3_EDE_CBC: 3672 case CKM_PBE_SHA1_DES3_EDE_CBC:
3671 case CKM_PBE_SHA1_DES2_EDE_CBC: 3673 case CKM_PBE_SHA1_DES2_EDE_CBC:
3672 case CKM_PBE_SHA1_RC2_128_CBC: 3674 case CKM_PBE_SHA1_RC2_128_CBC:
3673 case CKM_PBE_SHA1_RC2_40_CBC: 3675 case CKM_PBE_SHA1_RC2_40_CBC:
(...skipping 3398 matching lines...) Expand 10 before | Expand all | Expand 10 after
7072 att = sftk_FindAttribute(key,CKA_VALUE); 7074 att = sftk_FindAttribute(key,CKA_VALUE);
7073 sftk_FreeObject(key); 7075 sftk_FreeObject(key);
7074 if (!att) { 7076 if (!att) {
7075 return CKR_KEY_HANDLE_INVALID; 7077 return CKR_KEY_HANDLE_INVALID;
7076 } 7078 }
7077 crv = NSC_DigestUpdate(hSession,(CK_BYTE_PTR)att->attrib.pValue, 7079 crv = NSC_DigestUpdate(hSession,(CK_BYTE_PTR)att->attrib.pValue,
7078 att->attrib.ulValueLen); 7080 att->attrib.ulValueLen);
7079 sftk_FreeAttribute(att); 7081 sftk_FreeAttribute(att);
7080 return crv; 7082 return crv;
7081 } 7083 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698