summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornelsonb%netscape.com <devnull@localhost>2004-09-24 21:40:49 +0000
committernelsonb%netscape.com <devnull@localhost>2004-09-24 21:40:49 +0000
commit7f5fee0abcb49b07b9a8e60d07b05077dfdf5adc (patch)
tree42499c6276615a181f498eba66fc2d7c7f89b75d
parent1c5ce4ee724f599f5b2d0295e60a5aeff9772a0e (diff)
downloadnss-hg-SUN_SECURITY_3_9_3_O3B7.tar.gz
Fix bug 261333. Use the modulus length for the length of the outputSUN_SECURITY_3_9_3_O3B7
buffer, not the length of the input data. r=julien.pierre
-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) {