#include <openssl/params.h>
#include <openssl/core_names.h>
#include "internal/cryptlib.h"
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
#include "internal/provider.h"
-#include "evp_locl.h"
+#include "evp_local.h"
/* This call frees resources associated with the context */
int EVP_MD_CTX_reset(EVP_MD_CTX *ctx)
if (ctx == NULL)
return;
- if (ctx->digest == NULL || ctx->digest->prov == NULL)
- goto legacy;
-
EVP_MD_CTX_reset(ctx);
EVP_MD_free(ctx->fetched_digest);
OPENSSL_free(ctx);
return;
-
- /* TODO(3.0): Remove legacy code below */
- legacy:
- EVP_MD_CTX_reset(ctx);
- OPENSSL_free(ctx);
}
int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type)
return 0;
}
-const OSSL_PARAM *EVP_MD_CTX_settable_params(const EVP_MD *digest)
+const OSSL_PARAM *EVP_MD_settable_ctx_params(const EVP_MD *md)
+{
+ if (md != NULL && md->settable_ctx_params != NULL)
+ return md->settable_ctx_params();
+ return NULL;
+}
+
+const OSSL_PARAM *EVP_MD_CTX_settable_params(EVP_MD_CTX *ctx)
{
- if (digest != NULL && digest->settable_ctx_params != NULL)
- return digest->settable_ctx_params();
+ if (ctx != NULL
+ && ctx->digest != NULL
+ && ctx->digest->settable_ctx_params != NULL)
+ return ctx->digest->settable_ctx_params();
+
return NULL;
}
return 0;
}
-const OSSL_PARAM *EVP_MD_CTX_gettable_params(const EVP_MD *digest)
+const OSSL_PARAM *EVP_MD_gettable_ctx_params(const EVP_MD *md)
{
- if (digest != NULL && digest->gettable_ctx_params != NULL)
- return digest->gettable_ctx_params();
+ if (md != NULL && md->gettable_ctx_params != NULL)
+ return md->gettable_ctx_params();
+ return NULL;
+}
+
+const OSSL_PARAM *EVP_MD_CTX_gettable_params(EVP_MD_CTX *ctx)
+{
+ if (ctx != NULL
+ && ctx->digest != NULL
+ && ctx->digest->gettable_ctx_params != NULL)
+ return ctx->digest->gettable_ctx_params();
+
return NULL;
}