diff options
| author | jsing <> | 2014-06-10 14:14:07 +0000 |
|---|---|---|
| committer | jsing <> | 2014-06-10 14:14:07 +0000 |
| commit | ffd82070bf98c0a547b663e6bb65795c86d44d08 (patch) | |
| tree | e21d427847fe0052e8aaa1f761714867b6e0e12d /src/lib/libcrypto/evp/m_sha.c | |
| parent | c89ad5d60e5c36f87b2d7d346af77973e9201dd0 (diff) | |
| download | openbsd-ffd82070bf98c0a547b663e6bb65795c86d44d08.tar.gz openbsd-ffd82070bf98c0a547b663e6bb65795c86d44d08.tar.bz2 openbsd-ffd82070bf98c0a547b663e6bb65795c86d44d08.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.c | 30 |
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 | ||
| 90 | static const EVP_MD sha_md = { | 90 | static 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 | ||
| 105 | const EVP_MD * | 111 | const EVP_MD * |
