Don't invoke PKCS11 with an invalid handle. Bug 226285.
r=relyea sr=wchang0222 git-svn-id: svn://10.0.0.236/trunk@149617 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
21b5579576
commit
c82b8683b0
@ -2427,6 +2427,12 @@ PK11_PubWrapSymKey(CK_MECHANISM_TYPE type, SECKEYPublicKey *pubKey,
|
||||
mechanism.ulParameterLen = 0;
|
||||
|
||||
id = PK11_ImportPublicKey(slot,pubKey,PR_FALSE);
|
||||
if (id == CK_INVALID_HANDLE) {
|
||||
if (newKey) {
|
||||
PK11_FreeSymKey(newKey);
|
||||
}
|
||||
return SECFailure; /* Error code has been set. */
|
||||
}
|
||||
|
||||
session = pk11_GetNewSession(slot,&owner);
|
||||
if (!owner || !(slot->isThreadSafe)) PK11_EnterSlotMonitor(slot);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user