diff options
Diffstat (limited to 'security/nss/lib/pk11wrap/pk11akey.c')
-rw-r--r-- | security/nss/lib/pk11wrap/pk11akey.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/security/nss/lib/pk11wrap/pk11akey.c b/security/nss/lib/pk11wrap/pk11akey.c index 03fe48c36..cada965c6 100644 --- a/security/nss/lib/pk11wrap/pk11akey.c +++ b/security/nss/lib/pk11wrap/pk11akey.c @@ -5,6 +5,8 @@ * This file contains functions to manage asymetric keys, (public and * private keys). */ +#include <stddef.h> + #include "seccomon.h" #include "secmod.h" #include "secmodi.h" @@ -230,7 +232,7 @@ PK11_ImportPublicKey(PK11SlotInfo *slot, SECKEYPublicKey *pubKey, pk11_SignedToUnsigned(attrs); } } - rv = PK11_CreateNewObject(slot, CK_INVALID_SESSION, theTemplate, + rv = PK11_CreateNewObject(slot, CK_INVALID_HANDLE, theTemplate, templateCount, isToken, &objectID); if (ckaId) { SECITEM_FreeItem(ckaId, PR_TRUE); @@ -1085,7 +1087,7 @@ pk11_loadPrivKeyWithFlags(PK11SlotInfo *slot, SECKEYPrivateKey *privKey, } /* now Store the puppies */ - rv = PK11_CreateNewObject(slot, CK_INVALID_SESSION, privTemplate, + rv = PK11_CreateNewObject(slot, CK_INVALID_HANDLE, privTemplate, count, token, &objectID); PORT_FreeArena(arena, PR_TRUE); if (rv != SECSuccess) { @@ -1520,13 +1522,13 @@ PK11_GenerateKeyPairWithOpFlags(PK11SlotInfo *slot, CK_MECHANISM_TYPE type, restore = PR_TRUE; } else { session_handle = slot->session; - if (session_handle != CK_INVALID_SESSION) + if (session_handle != CK_INVALID_HANDLE) PK11_EnterSlotMonitor(slot); restore = PR_FALSE; haslock = PR_TRUE; } - if (session_handle == CK_INVALID_SESSION) { + if (session_handle == CK_INVALID_HANDLE) { PORT_SetError(SEC_ERROR_BAD_DATA); return NULL; } @@ -1901,12 +1903,12 @@ try_faulty_3des: } /* if we are unable to import the key and the pbeMechType is - * CKM_NETSCAPE_PBE_SHA1_TRIPLE_DES_CBC, then it is possible that + * CKM_NSS_PBE_SHA1_TRIPLE_DES_CBC, then it is possible that * the encrypted blob was created with a buggy key generation method * which is described in the PKCS 12 implementation notes. So we * need to try importing via that method. */ - if ((pbeMechType == CKM_NETSCAPE_PBE_SHA1_TRIPLE_DES_CBC) && (!faulty3DES)) { + if ((pbeMechType == CKM_NSS_PBE_SHA1_TRIPLE_DES_CBC) && (!faulty3DES)) { /* clean up after ourselves before redoing the key generation. */ PK11_FreeSymKey(key); @@ -2271,7 +2273,7 @@ PK11_ConvertSessionPrivKeyToTokenPrivKey(SECKEYPrivateKey *privk, void *wincx) PK11_Authenticate(slot, PR_TRUE, wincx); rwsession = PK11_GetRWSession(slot); - if (rwsession == CK_INVALID_SESSION) { + if (rwsession == CK_INVALID_HANDLE) { PORT_SetError(SEC_ERROR_BAD_DATA); return NULL; } @@ -2548,7 +2550,7 @@ PK11_ListPublicKeysInSlot(PK11SlotInfo *slot, char *nickname) CK_ATTRIBUTE *attrs; CK_BBOOL ckTrue = CK_TRUE; CK_OBJECT_CLASS keyclass = CKO_PUBLIC_KEY; - unsigned int tsize = 0; + size_t tsize = 0; int objCount = 0; CK_OBJECT_HANDLE *key_ids; SECKEYPublicKeyList *keys; @@ -2596,7 +2598,7 @@ PK11_ListPrivKeysInSlot(PK11SlotInfo *slot, char *nickname, void *wincx) CK_ATTRIBUTE *attrs; CK_BBOOL ckTrue = CK_TRUE; CK_OBJECT_CLASS keyclass = CKO_PRIVATE_KEY; - unsigned int tsize = 0; + size_t tsize = 0; int objCount = 0; CK_OBJECT_HANDLE *key_ids; SECKEYPrivateKeyList *keys; |