-/* crypto/evp/bio_md.c */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include "internal/cryptlib.h"
#include <openssl/buffer.h>
#include <openssl/evp.h>
+#include "internal/evp_int.h"
+#include "evp_locl.h"
/*
* BIO_put and BIO_get both add to the digest, BIO_gets returns the digest
static int md_free(BIO *data);
static long md_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp);
-static BIO_METHOD methods_md = {
+static const BIO_METHOD methods_md = {
BIO_TYPE_MD, "message digest",
md_write,
md_read,
md_callback_ctrl,
};
-BIO_METHOD *BIO_f_md(void)
+const BIO_METHOD *BIO_f_md(void)
{
return (&methods_md);
}
{
EVP_MD_CTX *ctx;
- ctx = EVP_MD_CTX_create();
+ ctx = EVP_MD_CTX_new();
if (ctx == NULL)
return (0);
{
if (a == NULL)
return (0);
- EVP_MD_CTX_destroy(a->ptr);
+ EVP_MD_CTX_free(a->ptr);
a->ptr = NULL;
a->init = 0;
a->flags = 0;