summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp/m_sha.c
diff options
context:
space:
mode:
authorjsing <>2014-06-10 14:14:07 +0000
committerjsing <>2014-06-10 14:14:07 +0000
commiteab708047a937230584142a2714d5293b2c20176 (patch)
treee21d427847fe0052e8aaa1f761714867b6e0e12d /src/lib/libcrypto/evp/m_sha.c
parent4067b1a94cae473804f9b1319a455ac636387cbd (diff)
downloadopenbsd-eab708047a937230584142a2714d5293b2c20176.tar.gz
openbsd-eab708047a937230584142a2714d5293b2c20176.tar.bz2
openbsd-eab708047a937230584142a2714d5293b2c20176.zip
Use C99 initialisers for EVP_MD structs, for clarity, grepability and to
protect from future field reordering/removal. No difference in generated assembly.
Diffstat (limited to 'src/lib/libcrypto/evp/m_sha.c')
-rw-r--r--src/lib/libcrypto/evp/m_sha.c30
1 files changed, 18 insertions, 12 deletions
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)
88} 88}
89 89
90static const EVP_MD sha_md = { 90static const EVP_MD sha_md = {
91 NID_sha, 91 .type = NID_sha,
92 NID_shaWithRSAEncryption, 92 .pkey_type = NID_shaWithRSAEncryption,
93 SHA_DIGEST_LENGTH, 93 .md_size = SHA_DIGEST_LENGTH,
94 0, 94 .flags = 0,
95 init, 95 .init = init,
96 update, 96 .update = update,
97 final, 97 .final = final,
98 NULL, 98 .copy = NULL,
99 NULL, 99 .cleanup = NULL,
100 EVP_PKEY_RSA_method, 100#ifndef OPENSSL_NO_RSA
101 SHA_CBLOCK, 101 .sign = (evp_sign_method *)RSA_sign,
102 sizeof(EVP_MD *) + sizeof(SHA_CTX), 102 .verify = (evp_verify_method *)RSA_verify,
103 .required_pkey_type = {
104 EVP_PKEY_RSA, EVP_PKEY_RSA2, 0, 0,
105 },
106#endif
107 .block_size = SHA_CBLOCK,
108 .ctx_size = sizeof(EVP_MD *) + sizeof(SHA_CTX),
103}; 109};
104 110
105const EVP_MD * 111const EVP_MD *