Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@chromium.org>2015-06-15 22:51:19 +0300
committerAdam Langley <agl@google.com>2015-06-25 03:03:02 +0300
commit65ee9b7ce94872b8265f7a5e4a09a5929ed61d61 (patch)
tree9c9d76304aecfb8aa9ee7bea5f41f5b34fe5169b /crypto/digest
parenta59347eb4c61a8a20f6353da9726fade6b125e87 (diff)
Remove EVP_PKEY_HMAC.
This removes EVP_PKEY_HMAC and all the support code around it. EVP_MD requires a lot of extra glue to support HMAC. This lets us prune it all away. As a bonus, it removes a (minor) dependency from EVP to the legacy ASN.1 stack. Change-Id: I5a9e3e39f518429828dbf13d14647fb37d9dc35a Reviewed-on: https://boringssl-review.googlesource.com/5120 Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto/digest')
-rw-r--r--crypto/digest/digest.c20
-rw-r--r--crypto/digest/internal.h17
2 files changed, 4 insertions, 33 deletions
diff --git a/crypto/digest/digest.c b/crypto/digest/digest.c
index f09948bb..4096fc53 100644
--- a/crypto/digest/digest.c
+++ b/crypto/digest/digest.c
@@ -164,12 +164,11 @@ int EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in) {
int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *engine) {
if (ctx->digest != type) {
- if (ctx->digest && ctx->digest->ctx_size) {
+ if (ctx->digest && ctx->digest->ctx_size > 0) {
OPENSSL_free(ctx->md_data);
}
ctx->digest = type;
- if (!(ctx->flags & EVP_MD_CTX_FLAG_NO_INIT) && type->ctx_size) {
- ctx->update = type->update;
+ if (type->ctx_size > 0) {
ctx->md_data = OPENSSL_malloc(type->ctx_size);
if (ctx->md_data == NULL) {
OPENSSL_PUT_ERROR(DIGEST, EVP_DigestInit_ex, ERR_R_MALLOC_FAILURE);
@@ -179,15 +178,6 @@ int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *engine) {
}
assert(ctx->pctx == NULL || ctx->pctx_ops != NULL);
- if (ctx->pctx_ops) {
- if (!ctx->pctx_ops->begin_digest(ctx)) {
- return 0;
- }
- }
-
- if (ctx->flags & EVP_MD_CTX_FLAG_NO_INIT) {
- return 1;
- }
ctx->digest->init(ctx);
return 1;
@@ -199,7 +189,7 @@ int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type) {
}
int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data, size_t len) {
- ctx->update(ctx, data, len);
+ ctx->digest->update(ctx, data, len);
return 1;
}
@@ -253,10 +243,6 @@ int EVP_MD_CTX_type(const EVP_MD_CTX *ctx) {
return EVP_MD_type(EVP_MD_CTX_md(ctx));
}
-void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, uint32_t flags) {
- 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 1572fa82..e3d812ad 100644
--- a/crypto/digest/internal.h
+++ b/crypto/digest/internal.h
@@ -92,7 +92,7 @@ struct env_md_st {
};
/* evp_md_pctx_ops contains function pointers to allow the |pctx| member of
- * |EVP_MD_CTX| to be manipulated without breaking laying by calling EVP
+ * |EVP_MD_CTX| to be manipulated without breaking layering by calling EVP
* functions. */
struct evp_md_pctx_ops {
/* free is called when an |EVP_MD_CTX| is being freed and the |pctx| also
@@ -102,23 +102,8 @@ struct evp_md_pctx_ops {
/* dup is called when an |EVP_MD_CTX| is copied and so the |pctx| also needs
* to be copied. */
EVP_PKEY_CTX* (*dup) (EVP_PKEY_CTX *pctx);
-
- /* begin_digest is called when a new digest operation is started. It returns
- * one on success and zero otherwise. */
- 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 */