summaryrefslogtreecommitdiff
path: root/lib/libcrypto
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2018-08-10 17:30:30 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2018-08-10 17:30:30 +0000
commit0bfae8bb5e7e3d07eb92b88a0d4f4dc4dff9c057 (patch)
tree9ea2a4ea676fb0160fb2d89beda2df643e7a6c7e /lib/libcrypto
parentc1148474f451b79a93ce6b177b94ee25518436ae (diff)
Add glue to EVP_md5_sha1() so that it can be used with EVP_Sign* and
EVP_Verify*. ok tb@
Diffstat (limited to 'lib/libcrypto')
-rw-r--r--lib/libcrypto/evp/m_md5_sha1.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/libcrypto/evp/m_md5_sha1.c b/lib/libcrypto/evp/m_md5_sha1.c
index 272cdee9ddc..4e8a0c32f62 100644
--- a/lib/libcrypto/evp/m_md5_sha1.c
+++ b/lib/libcrypto/evp/m_md5_sha1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: m_md5_sha1.c,v 1.1 2017/02/28 14:15:37 jsing Exp $ */
+/* $OpenBSD: m_md5_sha1.c,v 1.2 2018/08/10 17:30:29 jsing Exp $ */
/*
* Copyright (c) 2017 Joel Sing <jsing@openbsd.org>
*
@@ -20,6 +20,10 @@
#include <openssl/objects.h>
#include <openssl/sha.h>
+#ifndef OPENSSL_NO_RSA
+#include <openssl/rsa.h>
+#endif
+
struct md5_sha1_ctx {
MD5_CTX md5;
SHA_CTX sha1;
@@ -74,6 +78,13 @@ static const EVP_MD md5_sha1_md = {
.final = md5_sha1_final,
.block_size = MD5_CBLOCK, /* MD5_CBLOCK == SHA_CBLOCK */
.ctx_size = sizeof(EVP_MD *) + sizeof(struct md5_sha1_ctx),
+#ifndef OPENSSL_NO_RSA
+ .sign = (evp_sign_method *)RSA_sign,
+ .verify = (evp_verify_method *)RSA_verify,
+ .required_pkey_type = {
+ EVP_PKEY_RSA, EVP_PKEY_RSA2, 0, 0,
+ },
+#endif
};
const EVP_MD *