summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--security/nss/lib/pk11wrap/pk11skey.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/security/nss/lib/pk11wrap/pk11skey.c b/security/nss/lib/pk11wrap/pk11skey.c
index d316f5d5e..ed39a22c3 100644
--- a/security/nss/lib/pk11wrap/pk11skey.c
+++ b/security/nss/lib/pk11wrap/pk11skey.c
@@ -3692,15 +3692,16 @@ pk11_PubEncryptRaw(SECKEYPublicKey *key, unsigned char *enc,
{
PK11SlotInfo *slot;
CK_OBJECT_HANDLE id;
- CK_ULONG out = dataLen;
+ CK_ULONG out;
PRBool owner = PR_TRUE;
CK_SESSION_HANDLE session;
CK_RV crv;
- if (key->keyType != rsaKey) {
+ if (!key || key->keyType != rsaKey) {
PORT_SetError( SEC_ERROR_BAD_KEY );
return SECFailure;
}
+ out = SECKEY_PublicKeyStrength(key);
slot = PK11_GetBestSlot(mech->mechanism, wincx);
if (slot == NULL) {