aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranklin Wei <me@fwei.tk>2018-06-28 18:29:36 -0400
committerFranklin Wei <me@fwei.tk>2018-06-28 18:29:36 -0400
commit2194431ee8d67d6db89eb520140d358331f006c4 (patch)
treec928057752c86243b701587e6c1b1901b256ecbb
parent4676e8142430ad1a4415b43c8775c57098c17f5a (diff)
downloadcsaa-2194431ee8d67d6db89eb520140d358331f006c4.zip
csaa-2194431ee8d67d6db89eb520140d358331f006c4.tar.gz
csaa-2194431ee8d67d6db89eb520140d358331f006c4.tar.bz2
csaa-2194431ee8d67d6db89eb520140d358331f006c4.tar.xz
more fixes
-rw-r--r--crypto.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/crypto.c b/crypto.c
index 7b4b960..82d206e 100644
--- a/crypto.c
+++ b/crypto.c
@@ -227,6 +227,14 @@ hash_t hash_increment(hash_t h)
#include <string.h>
#include <openssl/engine.h>
+ static void *OPENSSL_zalloc(size_t num)
+ {
+ void *ret = OPENSSL_malloc(num);
+
+ if (ret != NULL)
+ memset(ret, 0, num);
+ return ret;
+ }
const unsigned char *EVP_CIPHER_CTX_iv(const EVP_CIPHER_CTX *ctx)
{
@@ -251,12 +259,7 @@ hash_t hash_increment(hash_t h)
HMAC_CTX *HMAC_CTX_new(void)
{
HMAC_CTX *ctx = OPENSSL_malloc(sizeof(*ctx));
- if (ctx != NULL) {
- if (!HMAC_CTX_reset(ctx)) {
- HMAC_CTX_free(ctx);
- return NULL;
- }
- }
+
return ctx;
}