From 38a8ba4b0cb305320f7f52da8803cb7415a1b19e Mon Sep 17 00:00:00 2001 From: jsing <> Date: Sun, 15 Jun 2014 15:44:39 +0000 Subject: Simplify EVP_CIPHER_CTX_new() - stop pretending that EVP_CIPHER_CTX_init() does something special... just use calloc() instead. ok beck@ miod@ --- src/lib/libcrypto/evp/evp_enc.c | 8 ++------ src/lib/libssl/src/crypto/evp/evp_enc.c | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/lib/libcrypto/evp/evp_enc.c b/src/lib/libcrypto/evp/evp_enc.c index d650d285df..5c3da7c476 100644 --- a/src/lib/libcrypto/evp/evp_enc.c +++ b/src/lib/libcrypto/evp/evp_enc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: evp_enc.c,v 1.19 2014/06/12 15:49:29 deraadt Exp $ */ +/* $OpenBSD: evp_enc.c,v 1.20 2014/06/15 15:44:39 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -74,16 +74,12 @@ void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *ctx) { memset(ctx, 0, sizeof(EVP_CIPHER_CTX)); - /* ctx->cipher=NULL; */ } EVP_CIPHER_CTX * EVP_CIPHER_CTX_new(void) { - EVP_CIPHER_CTX *ctx = malloc(sizeof *ctx); - if (ctx) - EVP_CIPHER_CTX_init(ctx); - return ctx; + return calloc(1, sizeof(EVP_CIPHER_CTX)); } int diff --git a/src/lib/libssl/src/crypto/evp/evp_enc.c b/src/lib/libssl/src/crypto/evp/evp_enc.c index d650d285df..5c3da7c476 100644 --- a/src/lib/libssl/src/crypto/evp/evp_enc.c +++ b/src/lib/libssl/src/crypto/evp/evp_enc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: evp_enc.c,v 1.19 2014/06/12 15:49:29 deraadt Exp $ */ +/* $OpenBSD: evp_enc.c,v 1.20 2014/06/15 15:44:39 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -74,16 +74,12 @@ void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *ctx) { memset(ctx, 0, sizeof(EVP_CIPHER_CTX)); - /* ctx->cipher=NULL; */ } EVP_CIPHER_CTX * EVP_CIPHER_CTX_new(void) { - EVP_CIPHER_CTX *ctx = malloc(sizeof *ctx); - if (ctx) - EVP_CIPHER_CTX_init(ctx); - return ctx; + return calloc(1, sizeof(EVP_CIPHER_CTX)); } int -- cgit v1.2.3-55-g6feb