diff options
author | jsing <> | 2018-08-10 17:30:29 +0000 |
---|---|---|
committer | jsing <> | 2018-08-10 17:30:29 +0000 |
commit | 3f9ebcb81d9f2a1f680e212f72891dfcbfcbeaf1 (patch) | |
tree | ad3b5b883a2ed267e952d8ace4a8d91b0290a52b /src | |
parent | 1dc1ee6fe9e6554b0c86810d3d8098bfc09e62eb (diff) | |
download | openbsd-3f9ebcb81d9f2a1f680e212f72891dfcbfcbeaf1.tar.gz openbsd-3f9ebcb81d9f2a1f680e212f72891dfcbfcbeaf1.tar.bz2 openbsd-3f9ebcb81d9f2a1f680e212f72891dfcbfcbeaf1.zip |
Add glue to EVP_md5_sha1() so that it can be used with EVP_Sign* and
EVP_Verify*.
ok tb@
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/evp/m_md5_sha1.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lib/libcrypto/evp/m_md5_sha1.c b/src/lib/libcrypto/evp/m_md5_sha1.c index 272cdee9dd..4e8a0c32f6 100644 --- a/src/lib/libcrypto/evp/m_md5_sha1.c +++ b/src/lib/libcrypto/evp/m_md5_sha1.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: m_md5_sha1.c,v 1.1 2017/02/28 14:15:37 jsing Exp $ */ | 1 | /* $OpenBSD: m_md5_sha1.c,v 1.2 2018/08/10 17:30:29 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2017 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2017 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -20,6 +20,10 @@ | |||
20 | #include <openssl/objects.h> | 20 | #include <openssl/objects.h> |
21 | #include <openssl/sha.h> | 21 | #include <openssl/sha.h> |
22 | 22 | ||
23 | #ifndef OPENSSL_NO_RSA | ||
24 | #include <openssl/rsa.h> | ||
25 | #endif | ||
26 | |||
23 | struct md5_sha1_ctx { | 27 | struct md5_sha1_ctx { |
24 | MD5_CTX md5; | 28 | MD5_CTX md5; |
25 | SHA_CTX sha1; | 29 | SHA_CTX sha1; |
@@ -74,6 +78,13 @@ static const EVP_MD md5_sha1_md = { | |||
74 | .final = md5_sha1_final, | 78 | .final = md5_sha1_final, |
75 | .block_size = MD5_CBLOCK, /* MD5_CBLOCK == SHA_CBLOCK */ | 79 | .block_size = MD5_CBLOCK, /* MD5_CBLOCK == SHA_CBLOCK */ |
76 | .ctx_size = sizeof(EVP_MD *) + sizeof(struct md5_sha1_ctx), | 80 | .ctx_size = sizeof(EVP_MD *) + sizeof(struct md5_sha1_ctx), |
81 | #ifndef OPENSSL_NO_RSA | ||
82 | .sign = (evp_sign_method *)RSA_sign, | ||
83 | .verify = (evp_verify_method *)RSA_verify, | ||
84 | .required_pkey_type = { | ||
85 | EVP_PKEY_RSA, EVP_PKEY_RSA2, 0, 0, | ||
86 | }, | ||
87 | #endif | ||
77 | }; | 88 | }; |
78 | 89 | ||
79 | const EVP_MD * | 90 | const EVP_MD * |