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

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

Issue 1017413002: Uprev NSS to 3.18 RTM (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/nss.git@nspr_uprev
Patch Set: Rebased Created 5 years, 8 months 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
« no previous file with comments | « nss/lib/softoken/lowpbe.c ('k') | nss/lib/softoken/sdb.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 954 matching lines...) Expand 10 before | Expand all | Expand 10 after
965 if (crv != CKR_OK) return crv; 965 if (crv != CKR_OK) return crv;
966 crv = sftk_defaultAttribute(object,CKA_DERIVE,&derive,sizeof(CK_BBOOL)); 966 crv = sftk_defaultAttribute(object,CKA_DERIVE,&derive,sizeof(CK_BBOOL));
967 if (crv != CKR_OK) return crv; 967 if (crv != CKR_OK) return crv;
968 968
969 object->objectInfo = sftk_GetPubKey(object,key_type, &crv); 969 object->objectInfo = sftk_GetPubKey(object,key_type, &crv);
970 if (object->objectInfo == NULL) { 970 if (object->objectInfo == NULL) {
971 return crv; 971 return crv;
972 } 972 }
973 object->infoFree = (SFTKFree) nsslowkey_DestroyPublicKey; 973 object->infoFree = (SFTKFree) nsslowkey_DestroyPublicKey;
974 974
975 /* Check that an imported EC key is valid */
976 if (key_type == CKK_EC) {
977 NSSLOWKEYPublicKey *pubKey = (NSSLOWKEYPublicKey*) object->objectInfo;
978 SECStatus rv = EC_ValidatePublicKey(&pubKey->u.ec.ecParams,
979 &pubKey->u.ec.publicValue);
980
981 if (rv != SECSuccess) {
982 return CKR_TEMPLATE_INCONSISTENT;
983 }
984 }
985
975 if (sftk_isTrue(object,CKA_TOKEN)) { 986 if (sftk_isTrue(object,CKA_TOKEN)) {
976 SFTKSlot *slot = session->slot; 987 SFTKSlot *slot = session->slot;
977 SFTKDBHandle *certHandle = sftk_getCertDB(slot); 988 SFTKDBHandle *certHandle = sftk_getCertDB(slot);
978 989
979 if (certHandle == NULL) { 990 if (certHandle == NULL) {
980 return CKR_TOKEN_WRITE_PROTECTED; 991 return CKR_TOKEN_WRITE_PROTECTED;
981 } 992 }
982 993
983 crv = sftkdb_write(certHandle, object, &object->handle); 994 crv = sftkdb_write(certHandle, object, &object->handle);
984 sftk_freeDB(certHandle); 995 sftk_freeDB(certHandle);
(...skipping 3787 matching lines...) Expand 10 before | Expand all | Expand 10 after
4772 4783
4773 4784
4774 CK_RV NSC_WaitForSlotEvent(CK_FLAGS flags, CK_SLOT_ID_PTR pSlot, 4785 CK_RV NSC_WaitForSlotEvent(CK_FLAGS flags, CK_SLOT_ID_PTR pSlot,
4775 CK_VOID_PTR pReserved) 4786 CK_VOID_PTR pReserved)
4776 { 4787 {
4777 CHECK_FORK(); 4788 CHECK_FORK();
4778 4789
4779 return CKR_FUNCTION_NOT_SUPPORTED; 4790 return CKR_FUNCTION_NOT_SUPPORTED;
4780 } 4791 }
4781 4792
OLDNEW
« no previous file with comments | « nss/lib/softoken/lowpbe.c ('k') | nss/lib/softoken/sdb.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698