diff options
author | jsing <> | 2014-06-10 14:14:07 +0000 |
---|---|---|
committer | jsing <> | 2014-06-10 14:14:07 +0000 |
commit | eab708047a937230584142a2714d5293b2c20176 (patch) | |
tree | e21d427847fe0052e8aaa1f761714867b6e0e12d /src/lib/libcrypto/evp/m_dss.c | |
parent | 4067b1a94cae473804f9b1319a455ac636387cbd (diff) | |
download | openbsd-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_dss.c')
-rw-r--r-- | src/lib/libcrypto/evp/m_dss.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/src/lib/libcrypto/evp/m_dss.c b/src/lib/libcrypto/evp/m_dss.c index 9066b7b88f..29ac76c401 100644 --- a/src/lib/libcrypto/evp/m_dss.c +++ b/src/lib/libcrypto/evp/m_dss.c | |||
@@ -86,18 +86,24 @@ final(EVP_MD_CTX *ctx, unsigned char *md) | |||
86 | } | 86 | } |
87 | 87 | ||
88 | static const EVP_MD dsa_md = { | 88 | static const EVP_MD dsa_md = { |
89 | NID_dsaWithSHA, | 89 | .type = NID_dsaWithSHA, |
90 | NID_dsaWithSHA, | 90 | .pkey_type = NID_dsaWithSHA, |
91 | SHA_DIGEST_LENGTH, | 91 | .md_size = SHA_DIGEST_LENGTH, |
92 | EVP_MD_FLAG_PKEY_DIGEST, | 92 | .flags = EVP_MD_FLAG_PKEY_DIGEST, |
93 | init, | 93 | .init = init, |
94 | update, | 94 | .update = update, |
95 | final, | 95 | .final = final, |
96 | NULL, | 96 | .copy = NULL, |
97 | NULL, | 97 | .cleanup = NULL, |
98 | EVP_PKEY_DSA_method, | 98 | #ifndef OPENSSL_NO_DSA |
99 | SHA_CBLOCK, | 99 | .sign = (evp_sign_method *)DSA_sign, |
100 | sizeof(EVP_MD *) + sizeof(SHA_CTX), | 100 | .verify = (evp_verify_method *)DSA_verify, |
101 | .required_pkey_type = { | ||
102 | EVP_PKEY_DSA, EVP_PKEY_DSA2, EVP_PKEY_DSA3, EVP_PKEY_DSA4, 0, | ||
103 | }, | ||
104 | #endif | ||
105 | .block_size = SHA_CBLOCK, | ||
106 | .ctx_size = sizeof(EVP_MD *) + sizeof(SHA_CTX), | ||
101 | }; | 107 | }; |
102 | 108 | ||
103 | const EVP_MD * | 109 | const EVP_MD * |