summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrelyea%netscape.com <devnull@localhost>2001-11-17 00:51:07 +0000
committerrelyea%netscape.com <devnull@localhost>2001-11-17 00:51:07 +0000
commit76c491178493304fa775c3c5c08616c1915990a2 (patch)
treee8ca5e8a7b9c2c333faa5aaa4fc81df68ed72598
parent7ff71e6d974be1a16d61f0005906f9db034573a3 (diff)
downloadnss-hg-76c491178493304fa775c3c5c08616c1915990a2.tar.gz
1) add Ian's new RSA_ functions to the freebl loader code.
2) add working stubs for bsafe. Note: the bsafe stubs function, but do not perform the requisite tests. They are also untested. bob
-rw-r--r--security/nss/lib/freebl/blapi_bsf.c20
-rw-r--r--security/nss/lib/freebl/ldvector.c4
-rw-r--r--security/nss/lib/freebl/loader.c18
-rw-r--r--security/nss/lib/freebl/loader.h9
4 files changed, 49 insertions, 2 deletions
diff --git a/security/nss/lib/freebl/blapi_bsf.c b/security/nss/lib/freebl/blapi_bsf.c
index aada7bde6..37caf4b20 100644
--- a/security/nss/lib/freebl/blapi_bsf.c
+++ b/security/nss/lib/freebl/blapi_bsf.c
@@ -1508,6 +1508,26 @@ loser:
return SECFailure;
}
+/*
+ * this should check the operation!!!!
+ */
+SECStatus
+RSA_PrivateKeyOpDoubleChecked(RSAPrivateKey *key,
+ unsigned char *output,
+ const unsigned char *input)
+{
+ return RSA_PrivateKeyOp(key, output, input);
+}
+
+/*
+ * this should check the key!!!
+ */
+SECStatus
+RSA_PrivateKeyCheck(RSAPrivateKey *key)
+{
+ return SECSuccess;
+}
+
/*****************************************************************************
** BLAPI implementation of DSA
******************************************************************************/
diff --git a/security/nss/lib/freebl/ldvector.c b/security/nss/lib/freebl/ldvector.c
index 249985f61..0345b8dd5 100644
--- a/security/nss/lib/freebl/ldvector.c
+++ b/security/nss/lib/freebl/ldvector.c
@@ -112,7 +112,9 @@ static const struct FREEBLVectorStr vector = {
RNG_RNGShutdown,
PQG_ParamGen,
PQG_ParamGenSeedLen,
- PQG_VerifyParams
+ PQG_VerifyParams,
+ RSA_PrivateKeyOpDoubleChecked,
+ RSA_PrivateKeyCheck,
};
diff --git a/security/nss/lib/freebl/loader.c b/security/nss/lib/freebl/loader.c
index 7a48d165f..564b14ee7 100644
--- a/security/nss/lib/freebl/loader.c
+++ b/security/nss/lib/freebl/loader.c
@@ -322,6 +322,24 @@ RSA_PrivateKeyOp(RSAPrivateKey * key,
return (vector->p_RSA_PrivateKeyOp)(key, output, input);
}
+SECStatus
+RSA_PrivateKeyOpDoubleChecked(RSAPrivateKey *key,
+ unsigned char *output,
+ const unsigned char *input)
+{
+ if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
+ return SECFailure;
+ return (vector->p_RSA_PrivateKeyOpDoubleChecked)(key, output, input);
+}
+
+SECStatus
+RSA_PrivateKeyCheck(RSAPrivateKey *key)
+{
+ if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
+ return SECFailure;
+ return (vector->p_RSA_PrivateKeyCheck)(key);
+}
+
SECStatus
DSA_NewKey(const PQGParams * params, DSAPrivateKey ** privKey)
{
diff --git a/security/nss/lib/freebl/loader.h b/security/nss/lib/freebl/loader.h
index fae273482..b4ce4c0ec 100644
--- a/security/nss/lib/freebl/loader.h
+++ b/security/nss/lib/freebl/loader.h
@@ -40,7 +40,7 @@
#include "blapi.h"
-#define FREEBL_VERSION 0x0301
+#define FREEBL_VERSION 0x0302
struct FREEBLVectorStr {
@@ -249,6 +249,13 @@ struct FREEBLVectorStr {
SECStatus (* p_PQG_VerifyParams)(const PQGParams *params,
const PQGVerify *vfy, SECStatus *result);
+
+ SECStatus (* p_RSA_PrivateKeyOpDoubleChecked)(RSAPrivateKey *key,
+ unsigned char *output,
+ const unsigned char *input);
+
+ SECStatus (* p_RSA_PrivateKeyCheck)(RSAPrivateKey *key);
+
};
typedef struct FREEBLVectorStr FREEBLVector;