Call Ian's privatekey verify options.

git-svn-id: svn://10.0.0.236/branches/NSS_3_3_BRANCH@108248 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
relyea%netscape.com
2001-11-16 02:37:41 +00:00
parent d94dbdc1a6
commit 90846ad7d7
2 changed files with 13 additions and 3 deletions

View File

@@ -976,6 +976,8 @@ pk11_handlePrivateKeyObject(PK11Object *object,CK_KEY_TYPE key_type)
&ckfalse,sizeof(CK_BBOOL));
if (crv != CKR_OK) return crv;
/* should we check the non-token RSA private keys? */
if (pk11_isTrue(object,CKA_TOKEN)) {
SECKEYLowPrivateKey *privKey;
char *label;
@@ -984,6 +986,13 @@ pk11_handlePrivateKeyObject(PK11Object *object,CK_KEY_TYPE key_type)
privKey=pk11_mkPrivKey(object,key_type);
if (privKey == NULL) return CKR_HOST_MEMORY;
if (key_type == CKK_RSA) {
rv = RSA_PrivateKeyCheck(&privKey->u.rsa);
if (rv == SECFailure) {
goto fail;
}
}
label = object->label = pk11_getString(object,CKA_LABEL);
crv = pk11_Attribute2SecItem(NULL,&pubKey,object,CKA_NETSCAPE_DB);
@@ -1003,6 +1012,7 @@ pk11_handlePrivateKeyObject(PK11Object *object,CK_KEY_TYPE key_type)
rv = SECFailure;
}
fail:
SECKEY_LowDestroyPrivateKey(privKey);
if (rv != SECSuccess) return CKR_DEVICE_ERROR;
object->inDB = PR_TRUE;

View File

@@ -33,7 +33,7 @@
* may use your version of this file under either the MPL or the
* GPL.
*
* $Id: rsawrapr.c,v 1.1 2000-03-31 19:29:42 relyea%netscape.com Exp $
* $Id: rsawrapr.c,v 1.1.86.1 2001-11-16 02:37:41 relyea%netscape.com Exp $
*/
#include "blapi.h"
@@ -632,7 +632,7 @@ RSA_Sign(SECKEYLowPrivateKey *key,
if (rv != SECSuccess)
goto done;
rv = RSA_PrivateKeyOp(&key->u.rsa, output, formatted.data);
rv = RSA_PrivateKeyOpDoubleChecked(&key->u.rsa, output, formatted.data);
*output_len = modulus_len;
goto done;
@@ -888,7 +888,7 @@ RSA_SignRaw(SECKEYLowPrivateKey *key,
if (rv != SECSuccess)
goto done;
rv = RSA_PrivateKeyOp(&key->u.rsa, output, formatted.data);
rv = RSA_PrivateKeyOpDoubleChecked(&key->u.rsa, output, formatted.data);
*output_len = modulus_len;
done: