diff options
author | David Benjamin <davidben@chromium.org> | 2015-06-02 02:49:30 +0300 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2015-06-02 04:08:10 +0300 |
commit | e216288109b857ff3b6820e2eebcfe8d660b3d43 (patch) | |
tree | 9ea5eb77140fe51b52331f78999b7c5033649d8a /crypto/digest | |
parent | af8731f7a530c07602f9a806604613ddaf79f58a (diff) |
Unexport and prune EVP_MD_CTX flags.
The only flag is EVP_MD_CTX_FLAG_NO_INIT and no good can possibly come of
anyone outside EVP_PKEY_HMAC calling it. (And indeed no one calls it.
EVP_MD_CTX_set_flags has a caller in wpa_supplicant, but it uses
EVP_MD_CTX_FLAG_NON_FIPS_ALLOW which we don't define. The call is guarded by a
pair of ifdefs for some FIPS mode wpa_supplicant.)
Change-Id: I70ab8ffa646f3f75dfa4d37c96b9e82448ff1e40
Reviewed-on: https://boringssl-review.googlesource.com/4971
Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto/digest')
-rw-r--r-- | crypto/digest/digest.c | 8 | ||||
-rw-r--r-- | crypto/digest/internal.h | 11 |
2 files changed, 11 insertions, 8 deletions
diff --git a/crypto/digest/digest.c b/crypto/digest/digest.c index d60bdc96..f09948bb 100644 --- a/crypto/digest/digest.c +++ b/crypto/digest/digest.c @@ -257,14 +257,6 @@ void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, uint32_t flags) { ctx->flags |= flags; } -void EVP_MD_CTX_clear_flags(EVP_MD_CTX *ctx, uint32_t flags) { - ctx->flags &= ~flags; -} - -uint32_t EVP_MD_CTX_test_flags(const EVP_MD_CTX *ctx, uint32_t flags) { - return ctx->flags & flags; -} - int EVP_add_digest(const EVP_MD *digest) { return 1; } diff --git a/crypto/digest/internal.h b/crypto/digest/internal.h index 1134702b..1572fa82 100644 --- a/crypto/digest/internal.h +++ b/crypto/digest/internal.h @@ -108,6 +108,17 @@ struct evp_md_pctx_ops { int (*begin_digest) (EVP_MD_CTX *ctx); }; +/* EVP_MD_CTX_set_flags ORs |flags| into the flags member of |ctx|. */ +OPENSSL_EXPORT void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, uint32_t flags); + +/* EVP_MD_CTX_FLAG_NO_INIT causes the |EVP_MD|'s |init| function not to be + * called, the |update| member not to be copied from the |EVP_MD| in + * |EVP_DigestInit_ex| and for |md_data| not to be initialised. + * + * TODO(davidben): This is an implementation detail of |EVP_PKEY_HMAC| and can + * be removed when it is gone. */ +#define EVP_MD_CTX_FLAG_NO_INIT 1 + #if defined(__cplusplus) } /* extern C */ |