summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libcrypto/rsa/rsa_local.h6
-rw-r--r--src/lib/libcrypto/rsa/rsa_sign.c6
2 files changed, 5 insertions, 7 deletions
diff --git a/src/lib/libcrypto/rsa/rsa_local.h b/src/lib/libcrypto/rsa/rsa_local.h
index 31172093c4..3f88b952a2 100644
--- a/src/lib/libcrypto/rsa/rsa_local.h
+++ b/src/lib/libcrypto/rsa/rsa_local.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_local.h,v 1.9 2024/11/29 07:42:35 tb Exp $ */ 1/* $OpenBSD: rsa_local.h,v 1.10 2025/01/05 15:39:12 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -81,9 +81,7 @@ struct rsa_meth_st {
81/* New sign and verify functions: some libraries don't allow arbitrary data 81/* New sign and verify functions: some libraries don't allow arbitrary data
82 * to be signed/verified: this allows them to be used. Note: for this to work 82 * to be signed/verified: this allows them to be used. Note: for this to work
83 * the RSA_public_decrypt() and RSA_private_encrypt() should *NOT* be used 83 * the RSA_public_decrypt() and RSA_private_encrypt() should *NOT* be used
84 * RSA_sign(), RSA_verify() should be used instead. Note: for backwards 84 * RSA_sign(), RSA_verify() should be used instead.
85 * compatibility this functionality is only enabled if the RSA_FLAG_SIGN_VER
86 * option is set in 'flags'.
87 */ 85 */
88 int (*rsa_sign)(int type, const unsigned char *m, unsigned int m_length, 86 int (*rsa_sign)(int type, const unsigned char *m, unsigned int m_length,
89 unsigned char *sigret, unsigned int *siglen, const RSA *rsa); 87 unsigned char *sigret, unsigned int *siglen, const RSA *rsa);
diff --git a/src/lib/libcrypto/rsa/rsa_sign.c b/src/lib/libcrypto/rsa/rsa_sign.c
index 5356768615..6edd20626d 100644
--- a/src/lib/libcrypto/rsa/rsa_sign.c
+++ b/src/lib/libcrypto/rsa/rsa_sign.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_sign.c,v 1.36 2023/07/08 12:26:45 beck Exp $ */ 1/* $OpenBSD: rsa_sign.c,v 1.37 2025/01/05 15:39:12 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -130,7 +130,7 @@ RSA_sign(int type, const unsigned char *m, unsigned int m_len,
130 unsigned char *tmps = NULL; 130 unsigned char *tmps = NULL;
131 int encrypt_len, encoded_len = 0, ret = 0; 131 int encrypt_len, encoded_len = 0, ret = 0;
132 132
133 if ((rsa->flags & RSA_FLAG_SIGN_VER) && rsa->meth->rsa_sign != NULL) 133 if (rsa->meth->rsa_sign != NULL)
134 return rsa->meth->rsa_sign(type, m, m_len, sigret, siglen, rsa); 134 return rsa->meth->rsa_sign(type, m, m_len, sigret, siglen, rsa);
135 135
136 /* Compute the encoded digest. */ 136 /* Compute the encoded digest. */
@@ -271,7 +271,7 @@ int
271RSA_verify(int dtype, const unsigned char *m, unsigned int m_len, 271RSA_verify(int dtype, const unsigned char *m, unsigned int m_len,
272 const unsigned char *sigbuf, unsigned int siglen, RSA *rsa) 272 const unsigned char *sigbuf, unsigned int siglen, RSA *rsa)
273{ 273{
274 if ((rsa->flags & RSA_FLAG_SIGN_VER) && rsa->meth->rsa_verify) 274 if (rsa->meth->rsa_verify != NULL)
275 return rsa->meth->rsa_verify(dtype, m, m_len, sigbuf, siglen, 275 return rsa->meth->rsa_verify(dtype, m, m_len, sigbuf, siglen,
276 rsa); 276 rsa);
277 277