diff options
author | Richard Levitte <levitte@openssl.org> | 2003-04-07 19:15:25 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2003-04-07 19:15:25 +0000 |
commit | 0a861ab7f36b6a8436e62dcf9f98446bc022b6ff (patch) | |
tree | c24820f32d454cdce96dc3ce997ae5ffc3fe699f /crypto/rsa | |
parent | 7b36590b1778c26ad96a36002b55b17fa3e41bf6 (diff) |
RSA_FLAG_SIGN_VER indicates the special rsa_sign and rsa_verify function
pointers should be used. It doesn't necessarely mean it should go through
the ENGINE framework.
Diffstat (limited to 'crypto/rsa')
-rw-r--r-- | crypto/rsa/rsa_sign.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/crypto/rsa/rsa_sign.c b/crypto/rsa/rsa_sign.c index 9dd62ac956..619755ce0b 100644 --- a/crypto/rsa/rsa_sign.c +++ b/crypto/rsa/rsa_sign.c @@ -79,12 +79,16 @@ 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) + { #ifndef OPENSSL_NO_ENGINE - if((rsa->flags & RSA_FLAG_SIGN_VER) - && ENGINE_get_RSA(rsa->engine)->rsa_sign) - return ENGINE_get_RSA(rsa->engine)->rsa_sign(type, - m, m_len, sigret, siglen, rsa); + if(ENGINE_get_RSA(rsa->engine)->rsa_sign) + return ENGINE_get_RSA(rsa->engine)->rsa_sign(type, + m, m_len, sigret, siglen, rsa); #endif + return rsa->meth->rsa_sign(type, m, m_len, + sigret, siglen, rsa); + } /* Special case: SSL signature, just check the length */ if(type == NID_md5_sha1) { if(m_len != SSL_SIG_LENGTH) { @@ -159,12 +163,16 @@ int RSA_verify(int dtype, const unsigned char *m, unsigned int m_len, return(0); } + if(rsa->flags & RSA_FLAG_SIGN_VER) + { #ifndef OPENSSL_NO_ENGINE - if((rsa->flags & RSA_FLAG_SIGN_VER) - && ENGINE_get_RSA(rsa->engine)->rsa_verify) - return ENGINE_get_RSA(rsa->engine)->rsa_verify(dtype, - m, m_len, sigbuf, siglen, rsa); + if(ENGINE_get_RSA(rsa->engine)->rsa_verify) + return ENGINE_get_RSA(rsa->engine)->rsa_verify(dtype, + m, m_len, sigbuf, siglen, rsa); #endif + return rsa->meth->rsa_verify(dtype, m, m_len, + sigbuf, siglen, rsa); + } s=(unsigned char *)OPENSSL_malloc((unsigned int)siglen); if (s == NULL) |