Hi,
RSA_check_key() can potentially take a lot of time depending on the
size of RSA keys being checked. It would be good to add a callback
parameter to the prototype that should be passed to BN_is_prime()
calls in this function.
Correspondingly, the call to RSA_check_key() in openssl/apps/rsa.c
should be modified too may be to pass NULL callback.
Thanks
Vineet
Something along the following lines:
openssl/crypto/rsa/rsa.h
===================================================================
-int RSA_check_key(const RSA *);
+int RSA_check_key(const RSA *,
+ void (*callback)(int,int,void *),void *cb_arg);
openssl/crypto/rsa/rsa_chk.c
===================================================================
-int RSA_check_key(const RSA *key)
+int RSA_check_key(const RSA *key, void (*callback)(int,int,void *),
void* cb_arg)
{
BIGNUM *i, *j, *k, *l, *m;
BN_CTX *ctx;
@@ -75,7 +75,7 @@ int RSA_check_key(const RSA *key)
}
/* p prime? */
- r = BN_is_prime(key->p, BN_prime_checks, NULL, NULL, NULL);
+ r = BN_is_prime(key->p, BN_prime_checks, callback, NULL,
cb_arg);
if (r != 1)
{
ret = r;
@@ -85,7 +85,7 @@ int RSA_check_key(const RSA *key)
}
/* q prime? */
- r = BN_is_prime(key->q, BN_prime_checks, NULL, NULL, NULL);
+ r = BN_is_prime(key->q, BN_prime_checks, callback, NULL,
cb_arg);
if (r != 1)
{
ret = r;
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [email protected]
Automated List Manager [EMAIL PROTECTED]