summaryrefslogtreecommitdiffstats
path: root/lib/libssl/src
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2014-06-15 15:46:22 +0000
committerjsing <jsing@openbsd.org>2014-06-15 15:46:22 +0000
commita7c51866d3007c614ca4de0d4f27780ed30ba21f (patch)
treeb297276e36185f7ddc00a14e35b8ad2feaa3ee50 /lib/libssl/src
parentSimplify EVP_CIPHER_CTX_new() - stop pretending that EVP_CIPHER_CTX_init() (diff)
downloadwireguard-openbsd-a7c51866d3007c614ca4de0d4f27780ed30ba21f.tar.xz
wireguard-openbsd-a7c51866d3007c614ca4de0d4f27780ed30ba21f.zip
Simplify EVP_MD_CTX_create() by just using calloc(). Also, use 0 rather
than '\0' for several memset(). ok beck@ miod@
Diffstat (limited to 'lib/libssl/src')
-rw-r--r--lib/libssl/src/crypto/evp/digest.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/libssl/src/crypto/evp/digest.c b/lib/libssl/src/crypto/evp/digest.c
index 4071d71e1e1..f598e78911d 100644
--- a/lib/libssl/src/crypto/evp/digest.c
+++ b/lib/libssl/src/crypto/evp/digest.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: digest.c,v 1.17 2014/06/12 15:49:29 deraadt Exp $ */
+/* $OpenBSD: digest.c,v 1.18 2014/06/15 15:46:22 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -120,18 +120,13 @@
void
EVP_MD_CTX_init(EVP_MD_CTX *ctx)
{
- memset(ctx, '\0', sizeof *ctx);
+ memset(ctx, 0, sizeof *ctx);
}
EVP_MD_CTX *
EVP_MD_CTX_create(void)
{
- EVP_MD_CTX *ctx = malloc(sizeof *ctx);
-
- if (ctx)
- EVP_MD_CTX_init(ctx);
-
- return ctx;
+ return calloc(1, sizeof(EVP_MD_CTX));
}
int
@@ -367,7 +362,7 @@ EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx)
* functional reference we held for this reason. */
ENGINE_finish(ctx->engine);
#endif
- memset(ctx, '\0', sizeof *ctx);
+ memset(ctx, 0, sizeof *ctx);
return 1;
}