summaryrefslogtreecommitdiffstats
path: root/crypto/rsa
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2003-04-10 01:13:37 +0000
committerDr. Stephen Henson <steve@openssl.org>2003-04-10 01:13:37 +0000
commit88ec5a637f9f0ab9b02582a17411dcbe0f923007 (patch)
tree493d02a39be49450e34bbd9156396cd490afba32 /crypto/rsa
parent75fcbb43a7868256499d220127ce737db9a2b2b3 (diff)
Only call redirected rsa_sign or rsa_verify if the pointer is set.
This allows, for example, a smart card to redirect rsa_sign and keep the default rsa_verify.
Diffstat (limited to 'crypto/rsa')
-rw-r--r--crypto/rsa/rsa_sign.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/rsa/rsa_sign.c b/crypto/rsa/rsa_sign.c
index 02eb8136b0..8a1e642183 100644
--- a/crypto/rsa/rsa_sign.c
+++ b/crypto/rsa/rsa_sign.c
@@ -76,7 +76,7 @@ int RSA_sign(int type, const unsigned char *m, unsigned int m_len,
const unsigned char *s = NULL;
X509_ALGOR algor;
ASN1_OCTET_STRING digest;
- if(rsa->flags & RSA_FLAG_SIGN_VER)
+ if((rsa->flags & RSA_FLAG_SIGN_VER) && rsa->meth->rsa_sign)
{
return rsa->meth->rsa_sign(type, m, m_len,
sigret, siglen, rsa);
@@ -155,7 +155,7 @@ int RSA_verify(int dtype, const unsigned char *m, unsigned int m_len,
return(0);
}
- if(rsa->flags & RSA_FLAG_SIGN_VER)
+ if((rsa->flags & RSA_FLAG_SIGN_VER) && rsa->meth->rsa_verify)
{
return rsa->meth->rsa_verify(dtype, m, m_len,
sigbuf, siglen, rsa);