#ifdef OPENSSL_FIPS
#include <openssl/fips.h>
+#include "evp_locl.h"
#endif
void EVP_MD_CTX_init(EVP_MD_CTX *ctx)
const EVP_MD *fipsmd;
if (type)
{
- fipsmd = FIPS_get_digestbynid(EVP_MD_type(type));
+ fipsmd = evp_get_fips_md(type);
if (fipsmd)
type = fipsmd;
}
void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx)
{
- EVP_MD_CTX_cleanup(ctx);
- OPENSSL_free(ctx);
+ if (ctx)
+ {
+ EVP_MD_CTX_cleanup(ctx);
+ OPENSSL_free(ctx);
+ }
}
/* This call frees resources associated with the context */