summaryrefslogtreecommitdiff
path: root/security/nss/lib/cryptohi
diff options
context:
space:
mode:
authornicolson%netscape.com <devnull@localhost>2001-09-10 22:53:34 +0000
committernicolson%netscape.com <devnull@localhost>2001-09-10 22:53:34 +0000
commite9220055414c44fad645010afdb27411e108040e (patch)
treecafa981e53c3c5866a9574235df0dfb07dfa2ca7 /security/nss/lib/cryptohi
parent612ccb537622db9411be46ee892de6ca71bc2b69 (diff)
downloadnss-hg-e9220055414c44fad645010afdb27411e108040e.tar.gz
Fix 95666: ImportDERPublicKey assigns CK_KEY_TYPE to pubkey->type.
Diffstat (limited to 'security/nss/lib/cryptohi')
-rw-r--r--security/nss/lib/cryptohi/seckey.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/security/nss/lib/cryptohi/seckey.c b/security/nss/lib/cryptohi/seckey.c
index d79ae97b0..142d14c57 100644
--- a/security/nss/lib/cryptohi/seckey.c
+++ b/security/nss/lib/cryptohi/seckey.c
@@ -1710,14 +1710,14 @@ SECKEY_ImportDERPublicKey(SECItem *derKey, CK_KEY_TYPE type)
SECKEYPublicKey *pubk = NULL;
SECStatus rv = SECFailure;
- pubk = PORT_New(SECKEYPublicKey);
+ pubk = PORT_ZNew(SECKEYPublicKey);
if(pubk == NULL) {
goto finish;
}
pubk->arena = NULL;
pubk->pkcs11Slot = NULL;
pubk->pkcs11ID = CK_INVALID_HANDLE;
- pubk->keyType = type;
+ pubk->keyType = (type == CKK_RSA) ? rsaKey : dsaKey;
if( type == CKK_RSA) {
rv = SEC_ASN1DecodeItem(NULL, pubk, SECKEY_RSAPublicKeyTemplate,