summaryrefslogtreecommitdiff
path: root/lib/libcrypto/evp/m_dss.c
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2014-06-10 14:14:08 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2014-06-10 14:14:08 +0000
commitcd5a0ffb7ba467378e0036ffb9f9a66bee17d759 (patch)
treea53e2d10a1748b4863fe2d4a1f606ee2cfba6ef0 /lib/libcrypto/evp/m_dss.c
parente216aa2f52f911ae503d69497fdb3426b5eaa235 (diff)
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 'lib/libcrypto/evp/m_dss.c')
-rw-r--r--lib/libcrypto/evp/m_dss.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/lib/libcrypto/evp/m_dss.c b/lib/libcrypto/evp/m_dss.c
index 9066b7b88f9..29ac76c4010 100644
--- a/lib/libcrypto/evp/m_dss.c
+++ b/lib/libcrypto/evp/m_dss.c
@@ -86,18 +86,24 @@ final(EVP_MD_CTX *ctx, unsigned char *md)
}
static const EVP_MD dsa_md = {
- NID_dsaWithSHA,
- NID_dsaWithSHA,
- SHA_DIGEST_LENGTH,
- EVP_MD_FLAG_PKEY_DIGEST,
- init,
- update,
- final,
- NULL,
- NULL,
- EVP_PKEY_DSA_method,
- SHA_CBLOCK,
- sizeof(EVP_MD *) + sizeof(SHA_CTX),
+ .type = NID_dsaWithSHA,
+ .pkey_type = NID_dsaWithSHA,
+ .md_size = SHA_DIGEST_LENGTH,
+ .flags = EVP_MD_FLAG_PKEY_DIGEST,
+ .init = init,
+ .update = update,
+ .final = final,
+ .copy = NULL,
+ .cleanup = NULL,
+#ifndef OPENSSL_NO_DSA
+ .sign = (evp_sign_method *)DSA_sign,
+ .verify = (evp_verify_method *)DSA_verify,
+ .required_pkey_type = {
+ EVP_PKEY_DSA, EVP_PKEY_DSA2, EVP_PKEY_DSA3, EVP_PKEY_DSA4, 0,
+ },
+#endif
+ .block_size = SHA_CBLOCK,
+ .ctx_size = sizeof(EVP_MD *) + sizeof(SHA_CTX),
};
const EVP_MD *