提交 0a861ab7 编写于 作者: R Richard Levitte

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.
上级 7b36590b
...@@ -79,12 +79,16 @@ int RSA_sign(int type, const unsigned char *m, unsigned int m_len, ...@@ -79,12 +79,16 @@ int RSA_sign(int type, const unsigned char *m, unsigned int m_len,
const unsigned char *s = NULL; const unsigned char *s = NULL;
X509_ALGOR algor; X509_ALGOR algor;
ASN1_OCTET_STRING digest; ASN1_OCTET_STRING digest;
if(rsa->flags & RSA_FLAG_SIGN_VER)
{
#ifndef OPENSSL_NO_ENGINE #ifndef OPENSSL_NO_ENGINE
if((rsa->flags & RSA_FLAG_SIGN_VER) if(ENGINE_get_RSA(rsa->engine)->rsa_sign)
&& ENGINE_get_RSA(rsa->engine)->rsa_sign) return ENGINE_get_RSA(rsa->engine)->rsa_sign(type,
return ENGINE_get_RSA(rsa->engine)->rsa_sign(type, m, m_len, sigret, siglen, rsa);
m, m_len, sigret, siglen, rsa);
#endif #endif
return rsa->meth->rsa_sign(type, m, m_len,
sigret, siglen, rsa);
}
/* Special case: SSL signature, just check the length */ /* Special case: SSL signature, just check the length */
if(type == NID_md5_sha1) { if(type == NID_md5_sha1) {
if(m_len != SSL_SIG_LENGTH) { if(m_len != SSL_SIG_LENGTH) {
...@@ -159,12 +163,16 @@ int RSA_verify(int dtype, const unsigned char *m, unsigned int m_len, ...@@ -159,12 +163,16 @@ int RSA_verify(int dtype, const unsigned char *m, unsigned int m_len,
return(0); return(0);
} }
if(rsa->flags & RSA_FLAG_SIGN_VER)
{
#ifndef OPENSSL_NO_ENGINE #ifndef OPENSSL_NO_ENGINE
if((rsa->flags & RSA_FLAG_SIGN_VER) if(ENGINE_get_RSA(rsa->engine)->rsa_verify)
&& ENGINE_get_RSA(rsa->engine)->rsa_verify) return ENGINE_get_RSA(rsa->engine)->rsa_verify(dtype,
return ENGINE_get_RSA(rsa->engine)->rsa_verify(dtype, m, m_len, sigbuf, siglen, rsa);
m, m_len, sigbuf, siglen, rsa);
#endif #endif
return rsa->meth->rsa_verify(dtype, m, m_len,
sigbuf, siglen, rsa);
}
s=(unsigned char *)OPENSSL_malloc((unsigned int)siglen); s=(unsigned char *)OPENSSL_malloc((unsigned int)siglen);
if (s == NULL) if (s == NULL)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册