From: jsing Date: Fri, 10 Aug 2018 17:30:29 +0000 (+0000) Subject: Add glue to EVP_md5_sha1() so that it can be used with EVP_Sign* and X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=52bc4021129a96ca1e72b215ba51b7c7aa1a9ea9;p=openbsd Add glue to EVP_md5_sha1() so that it can be used with EVP_Sign* and EVP_Verify*. ok tb@ --- 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 * @@ -20,6 +20,10 @@ #include #include +#ifndef OPENSSL_NO_RSA +#include +#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 *