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

Side by Side Diff: nss/lib/dev/devtoken.c

Issue 1504923011: Update NSS to 3.21 RTM and NSPR to 4.11 RTM (Closed) Base URL: http://src.chromium.org/svn/trunk/deps/third_party/nss
Patch Set: Created 5 years 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 #include "pkcs11.h" 5 #include "pkcs11.h"
6 6
7 #ifndef DEVM_H 7 #ifndef DEVM_H
8 #include "devm.h" 8 #include "devm.h"
9 #endif /* DEVM_H */ 9 #endif /* DEVM_H */
10 10
(...skipping 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after
1459 void *arg 1459 void *arg
1460 ) 1460 )
1461 { 1461 {
1462 CK_RV ckrv; 1462 CK_RV ckrv;
1463 CK_ULONG count; 1463 CK_ULONG count;
1464 CK_OBJECT_HANDLE *objectHandles; 1464 CK_OBJECT_HANDLE *objectHandles;
1465 CK_ATTRIBUTE_PTR attr; 1465 CK_ATTRIBUTE_PTR attr;
1466 CK_ATTRIBUTE cert_template[2]; 1466 CK_ATTRIBUTE cert_template[2];
1467 CK_ULONG ctsize; 1467 CK_ULONG ctsize;
1468 NSSArena *arena; 1468 NSSArena *arena;
1469 PRStatus status;
1470 PRUint32 arraySize, numHandles; 1469 PRUint32 arraySize, numHandles;
1471 nssCryptokiObject **objects; 1470 nssCryptokiObject **objects;
1472 void *epv = nssToken_GetCryptokiEPV(token); 1471 void *epv = nssToken_GetCryptokiEPV(token);
1473 nssSession *session = (sessionOpt) ? sessionOpt : token->defaultSession; 1472 nssSession *session = (sessionOpt) ? sessionOpt : token->defaultSession;
1474 1473
1475 /* Don't ask the module to use an invalid session handle. */ 1474 /* Don't ask the module to use an invalid session handle. */
1476 if (!session || session->handle == CK_INVALID_SESSION) { 1475 if (!session || session->handle == CK_INVALID_SESSION) {
1477 PORT_SetError(SEC_ERROR_NO_TOKEN); 1476 PORT_SetError(SEC_ERROR_NO_TOKEN);
1478 return PR_FAILURE; 1477 return PR_FAILURE;
1479 } 1478 }
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
1537 nssSession_ExitMonitor(session); /* ==== end session lock === */ 1536 nssSession_ExitMonitor(session); /* ==== end session lock === */
1538 if (ckrv != CKR_OK) { 1537 if (ckrv != CKR_OK) {
1539 goto loser; 1538 goto loser;
1540 } 1539 }
1541 if (numHandles > 0) { 1540 if (numHandles > 0) {
1542 objects = create_objects_from_handles(token, session, 1541 objects = create_objects_from_handles(token, session,
1543 objectHandles, numHandles); 1542 objectHandles, numHandles);
1544 if (objects) { 1543 if (objects) {
1545 nssCryptokiObject **op; 1544 nssCryptokiObject **op;
1546 for (op = objects; *op; op++) { 1545 for (op = objects; *op; op++) {
1547 » » status = (*callback)(*op, arg); 1546 » » (void)(*callback)(*op, arg);
1548 } 1547 }
1549 nss_ZFreeIf(objects); 1548 nss_ZFreeIf(objects);
1550 } 1549 }
1551 } 1550 }
1552 nssArena_Destroy(arena); 1551 nssArena_Destroy(arena);
1553 return PR_SUCCESS; 1552 return PR_SUCCESS;
1554 loser: 1553 loser:
1555 nssArena_Destroy(arena); 1554 nssArena_Destroy(arena);
1556 return PR_FAILURE; 1555 return PR_FAILURE;
1557 } 1556 }
(...skipping 13 matching lines...) Expand all
1571 theClass = CKO_PRIVATE_KEY; 1570 theClass = CKO_PRIVATE_KEY;
1572 if (!nssSlot_IsLoggedIn(token->slot)) { 1571 if (!nssSlot_IsLoggedIn(token->slot)) {
1573 theClass = CKO_PUBLIC_KEY; 1572 theClass = CKO_PUBLIC_KEY;
1574 } 1573 }
1575 if (PK11_MatchItem(token->pk11slot, instance->handle, theClass) 1574 if (PK11_MatchItem(token->pk11slot, instance->handle, theClass)
1576 != CK_INVALID_HANDLE) { 1575 != CK_INVALID_HANDLE) {
1577 return PR_TRUE; 1576 return PR_TRUE;
1578 } 1577 }
1579 return PR_FALSE; 1578 return PR_FALSE;
1580 } 1579 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698