summaryrefslogtreecommitdiffstats
path: root/crypto/evp
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2015-12-02 00:49:35 +0100
committerRichard Levitte <levitte@openssl.org>2015-12-07 17:40:20 +0100
commitbfb0641f932490c2e7fb5f9f7cb4a88017a5abfa (patch)
tree6b6b0a9dfe55b4b3a2e5961ed1778dd156128f35 /crypto/evp
parent959ed5316c84d0e12ad18acfd40cefe15603ddfb (diff)
Cleanup: fix all sources that used EVP_MD_CTX_(create|init|destroy)
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/evp')
-rw-r--r--crypto/evp/bio_md.c4
-rw-r--r--crypto/evp/bio_ok.c4
-rw-r--r--crypto/evp/digest.c4
-rw-r--r--crypto/evp/evp_key.c4
-rw-r--r--crypto/evp/m_sigver.c8
-rw-r--r--crypto/evp/p5_crpt.c4
-rw-r--r--crypto/evp/p_sign.c4
-rw-r--r--crypto/evp/p_verify.c4
8 files changed, 18 insertions, 18 deletions
diff --git a/crypto/evp/bio_md.c b/crypto/evp/bio_md.c
index 381ca599a7..24c7dc3bea 100644
--- a/crypto/evp/bio_md.c
+++ b/crypto/evp/bio_md.c
@@ -100,7 +100,7 @@ static int md_new(BIO *bi)
{
EVP_MD_CTX *ctx;
- ctx = EVP_MD_CTX_create();
+ ctx = EVP_MD_CTX_new();
if (ctx == NULL)
return (0);
@@ -114,7 +114,7 @@ static int md_free(BIO *a)
{
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;
diff --git a/crypto/evp/bio_ok.c b/crypto/evp/bio_ok.c
index 49105bd83c..5f3f2dea9f 100644
--- a/crypto/evp/bio_ok.c
+++ b/crypto/evp/bio_ok.c
@@ -183,7 +183,7 @@ static int ok_new(BIO *bi)
ctx->cont = 1;
ctx->sigio = 1;
- ctx->md = EVP_MD_CTX_create();
+ ctx->md = EVP_MD_CTX_new();
bi->init = 0;
bi->ptr = (char *)ctx;
bi->flags = 0;
@@ -194,7 +194,7 @@ static int ok_free(BIO *a)
{
if (a == NULL)
return (0);
- EVP_MD_CTX_destroy(((BIO_OK_CTX *)a->ptr)->md);
+ EVP_MD_CTX_free(((BIO_OK_CTX *)a->ptr)->md);
OPENSSL_clear_free(a->ptr, sizeof(BIO_OK_CTX));
a->ptr = NULL;
a->init = 0;
diff --git a/crypto/evp/digest.c b/crypto/evp/digest.c
index 0b1af6f3c6..5da0e01039 100644
--- a/crypto/evp/digest.c
+++ b/crypto/evp/digest.c
@@ -345,7 +345,7 @@ int EVP_Digest(const void *data, size_t count,
unsigned char *md, unsigned int *size, const EVP_MD *type,
ENGINE *impl)
{
- EVP_MD_CTX *ctx = EVP_MD_CTX_create();
+ EVP_MD_CTX *ctx = EVP_MD_CTX_new();
int ret;
if (ctx == NULL)
@@ -354,7 +354,7 @@ int EVP_Digest(const void *data, size_t count,
ret = EVP_DigestInit_ex(ctx, type, impl)
&& EVP_DigestUpdate(ctx, data, count)
&& EVP_DigestFinal_ex(ctx, md, size);
- EVP_MD_CTX_destroy(ctx);
+ EVP_MD_CTX_free(ctx);
return ret;
}
diff --git a/crypto/evp/evp_key.c b/crypto/evp/evp_key.c
index 231c06b86e..65f038138e 100644
--- a/crypto/evp/evp_key.c
+++ b/crypto/evp/evp_key.c
@@ -136,7 +136,7 @@ int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md,
if (data == NULL)
return (nkey);
- c = EVP_MD_CTX_create();
+ c = EVP_MD_CTX_new();
if (c == NULL)
goto err;
for (;;) {
@@ -191,7 +191,7 @@ int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md,
}
rv = type->key_len;
err:
- EVP_MD_CTX_destroy(c);
+ EVP_MD_CTX_free(c);
OPENSSL_cleanse(md_buf, sizeof(md_buf));
return rv;
}
diff --git a/crypto/evp/m_sigver.c b/crypto/evp/m_sigver.c
index b21000f864..067d330144 100644
--- a/crypto/evp/m_sigver.c
+++ b/crypto/evp/m_sigver.c
@@ -158,7 +158,7 @@ int EVP_DigestSignFinal(EVP_MD_CTX *ctx, unsigned char *sigret,
else
r = EVP_DigestFinal_ex(ctx, md, &mdlen);
} else {
- EVP_MD_CTX *tmp_ctx = EVP_MD_CTX_create();
+ EVP_MD_CTX *tmp_ctx = EVP_MD_CTX_new();
if (tmp_ctx == NULL || !EVP_MD_CTX_copy_ex(tmp_ctx, ctx))
return 0;
if (sctx)
@@ -166,7 +166,7 @@ int EVP_DigestSignFinal(EVP_MD_CTX *ctx, unsigned char *sigret,
sigret, siglen, tmp_ctx);
else
r = EVP_DigestFinal_ex(tmp_ctx, md, &mdlen);
- EVP_MD_CTX_destroy(tmp_ctx);
+ EVP_MD_CTX_free(tmp_ctx);
}
if (sctx || !r)
return r;
@@ -203,7 +203,7 @@ int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sig,
} else
r = EVP_DigestFinal_ex(ctx, md, &mdlen);
} else {
- EVP_MD_CTX *tmp_ctx = EVP_MD_CTX_create();
+ EVP_MD_CTX *tmp_ctx = EVP_MD_CTX_new();
if (tmp_ctx == NULL || !EVP_MD_CTX_copy_ex(tmp_ctx, ctx))
return -1;
if (vctx) {
@@ -211,7 +211,7 @@ int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sig,
sig, siglen, tmp_ctx);
} else
r = EVP_DigestFinal_ex(tmp_ctx, md, &mdlen);
- EVP_MD_CTX_destroy(tmp_ctx);
+ EVP_MD_CTX_free(tmp_ctx);
}
if (vctx || !r)
return r;
diff --git a/crypto/evp/p5_crpt.c b/crypto/evp/p5_crpt.c
index 26bf048989..d27d83f7ee 100644
--- a/crypto/evp/p5_crpt.c
+++ b/crypto/evp/p5_crpt.c
@@ -110,7 +110,7 @@ int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *cctx, const char *pass, int passlen,
else if (passlen == -1)
passlen = strlen(pass);
- ctx = EVP_MD_CTX_create();
+ ctx = EVP_MD_CTX_new();
if (ctx == NULL) {
EVPerr(EVP_F_PKCS5_PBE_KEYIVGEN, ERR_R_MALLOC_FAILURE);
goto err;
@@ -148,6 +148,6 @@ int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *cctx, const char *pass, int passlen,
OPENSSL_cleanse(iv, EVP_MAX_IV_LENGTH);
rv = 1;
err:
- EVP_MD_CTX_destroy(ctx);
+ EVP_MD_CTX_free(ctx);
return rv;
}
diff --git a/crypto/evp/p_sign.c b/crypto/evp/p_sign.c
index 8ddb89f69e..c5e479e8bd 100644
--- a/crypto/evp/p_sign.c
+++ b/crypto/evp/p_sign.c
@@ -78,7 +78,7 @@ int EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret,
goto err;
} else {
int rv = 0;
- EVP_MD_CTX *tmp_ctx = EVP_MD_CTX_create();
+ EVP_MD_CTX *tmp_ctx = EVP_MD_CTX_new();
if (tmp_ctx == NULL) {
EVPerr(EVP_F_EVP_SIGNFINAL, ERR_R_MALLOC_FAILURE);
return 0;
@@ -86,7 +86,7 @@ int EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret,
rv = EVP_MD_CTX_copy_ex(tmp_ctx, ctx);
if (rv)
rv = EVP_DigestFinal_ex(tmp_ctx, m, &m_len);
- EVP_MD_CTX_destroy(tmp_ctx);
+ EVP_MD_CTX_free(tmp_ctx);
if (!rv)
return 0;
}
diff --git a/crypto/evp/p_verify.c b/crypto/evp/p_verify.c
index c2328f2293..32ec0de121 100644
--- a/crypto/evp/p_verify.c
+++ b/crypto/evp/p_verify.c
@@ -76,7 +76,7 @@ int EVP_VerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sigbuf,
goto err;
} else {
int rv = 0;
- EVP_MD_CTX *tmp_ctx = EVP_MD_CTX_create();
+ EVP_MD_CTX *tmp_ctx = EVP_MD_CTX_new();
if (tmp_ctx == NULL) {
EVPerr(EVP_F_EVP_VERIFYFINAL, ERR_R_MALLOC_FAILURE);
return 0;
@@ -84,7 +84,7 @@ int EVP_VerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sigbuf,
rv = EVP_MD_CTX_copy_ex(tmp_ctx, ctx);
if (rv)
rv = EVP_DigestFinal_ex(tmp_ctx, m, &m_len);
- EVP_MD_CTX_destroy(tmp_ctx);
+ EVP_MD_CTX_free(tmp_ctx);
if (!rv)
return 0;
}