From eab708047a937230584142a2714d5293b2c20176 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Tue, 10 Jun 2014 14:14:07 +0000 Subject: Use C99 initialisers for EVP_MD structs, for clarity, grepability and to protect from future field reordering/removal. No difference in generated assembly. --- src/lib/libcrypto/evp/m_sha.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'src/lib/libcrypto/evp/m_sha.c') diff --git a/src/lib/libcrypto/evp/m_sha.c b/src/lib/libcrypto/evp/m_sha.c index 1b82e61c26..238f677a97 100644 --- a/src/lib/libcrypto/evp/m_sha.c +++ b/src/lib/libcrypto/evp/m_sha.c @@ -88,18 +88,24 @@ final(EVP_MD_CTX *ctx, unsigned char *md) } static const EVP_MD sha_md = { - NID_sha, - NID_shaWithRSAEncryption, - SHA_DIGEST_LENGTH, - 0, - init, - update, - final, - NULL, - NULL, - EVP_PKEY_RSA_method, - SHA_CBLOCK, - sizeof(EVP_MD *) + sizeof(SHA_CTX), + .type = NID_sha, + .pkey_type = NID_shaWithRSAEncryption, + .md_size = SHA_DIGEST_LENGTH, + .flags = 0, + .init = init, + .update = update, + .final = final, + .copy = NULL, + .cleanup = NULL, +#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 + .block_size = SHA_CBLOCK, + .ctx_size = sizeof(EVP_MD *) + sizeof(SHA_CTX), }; const EVP_MD * -- cgit v1.2.3-55-g6feb