Loading crypto/bn/bn_lib.c +1 −1 Original line number Diff line number Diff line Loading @@ -445,7 +445,7 @@ void BN_clear(BIGNUM *a) { bn_check_top(a); if (a->d != NULL) memset(a->d, 0, sizeof(*a->d) * a->dmax); OPENSSL_cleanse(a->d, sizeof(*a->d) * a->dmax); a->top = 0; a->neg = 0; } Loading crypto/buffer/buffer.c +0 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,6 @@ void BUF_MEM_free(BUF_MEM *a) return; if (a->data != NULL) { memset(a->data, 0, (unsigned int)a->max); if (a->flags & BUF_MEM_FLAG_SECURE) OPENSSL_secure_free(a->data); else Loading crypto/evp/digest.c +2 −2 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ int EVP_MD_CTX_reset(EVP_MD_CTX *ctx) #ifndef OPENSSL_NO_ENGINE ENGINE_finish(ctx->engine); #endif memset(ctx, 0, sizeof(*ctx)); OPENSSL_cleanse(ctx, sizeof(*ctx)); return 1; } Loading Loading @@ -170,7 +170,7 @@ int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size) ctx->digest->cleanup(ctx); EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_CLEANED); } memset(ctx->md_data, 0, ctx->digest->ctx_size); OPENSSL_cleanse(ctx->md_data, ctx->digest->ctx_size); return ret; } Loading crypto/include/internal/md32_common.h +9 −1 Original line number Diff line number Diff line Loading @@ -65,6 +65,8 @@ * <appro@fy.chalmers.se> */ #include <openssl/crypto.h> #if !defined(DATA_ORDER_IS_BIG_ENDIAN) && !defined(DATA_ORDER_IS_LITTLE_ENDIAN) # error "DATA_ORDER must be defined!" #endif Loading Loading @@ -276,6 +278,12 @@ int HASH_UPDATE(HASH_CTX *c, const void *data_, size_t len) data += n; len -= n; c->num = 0; /* * We use memset rather than OPENSSL_cleanse() here deliberately. * Using OPENSSL_cleanse() here could be a performance issue. It * will get properly cleansed on finalisation so this isn't a * security problem. */ memset(p, 0, HASH_CBLOCK); /* keep it zeroed */ } else { memcpy(p + n, data, len); Loading Loading @@ -331,7 +339,7 @@ int HASH_FINAL(unsigned char *md, HASH_CTX *c) p -= HASH_CBLOCK; HASH_BLOCK_DATA_ORDER(c, p, 1); c->num = 0; memset(p, 0, HASH_CBLOCK); OPENSSL_cleanse(p, HASH_CBLOCK); #ifndef HASH_MAKE_STRING # error "HASH_MAKE_STRING must be defined!" Loading crypto/md2/md2_dgst.c +1 −1 Original line number Diff line number Diff line Loading @@ -168,6 +168,6 @@ int MD2_Final(unsigned char *md, MD2_CTX *c) for (i = 0; i < 16; i++) md[i] = (UCHAR) (p1[i] & 0xff); memset(&c, 0, sizeof(c)); OPENSSL_cleanse(c, sizeof(*c)); return 1; } Loading
crypto/bn/bn_lib.c +1 −1 Original line number Diff line number Diff line Loading @@ -445,7 +445,7 @@ void BN_clear(BIGNUM *a) { bn_check_top(a); if (a->d != NULL) memset(a->d, 0, sizeof(*a->d) * a->dmax); OPENSSL_cleanse(a->d, sizeof(*a->d) * a->dmax); a->top = 0; a->neg = 0; } Loading
crypto/buffer/buffer.c +0 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,6 @@ void BUF_MEM_free(BUF_MEM *a) return; if (a->data != NULL) { memset(a->data, 0, (unsigned int)a->max); if (a->flags & BUF_MEM_FLAG_SECURE) OPENSSL_secure_free(a->data); else Loading
crypto/evp/digest.c +2 −2 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ int EVP_MD_CTX_reset(EVP_MD_CTX *ctx) #ifndef OPENSSL_NO_ENGINE ENGINE_finish(ctx->engine); #endif memset(ctx, 0, sizeof(*ctx)); OPENSSL_cleanse(ctx, sizeof(*ctx)); return 1; } Loading Loading @@ -170,7 +170,7 @@ int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size) ctx->digest->cleanup(ctx); EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_CLEANED); } memset(ctx->md_data, 0, ctx->digest->ctx_size); OPENSSL_cleanse(ctx->md_data, ctx->digest->ctx_size); return ret; } Loading
crypto/include/internal/md32_common.h +9 −1 Original line number Diff line number Diff line Loading @@ -65,6 +65,8 @@ * <appro@fy.chalmers.se> */ #include <openssl/crypto.h> #if !defined(DATA_ORDER_IS_BIG_ENDIAN) && !defined(DATA_ORDER_IS_LITTLE_ENDIAN) # error "DATA_ORDER must be defined!" #endif Loading Loading @@ -276,6 +278,12 @@ int HASH_UPDATE(HASH_CTX *c, const void *data_, size_t len) data += n; len -= n; c->num = 0; /* * We use memset rather than OPENSSL_cleanse() here deliberately. * Using OPENSSL_cleanse() here could be a performance issue. It * will get properly cleansed on finalisation so this isn't a * security problem. */ memset(p, 0, HASH_CBLOCK); /* keep it zeroed */ } else { memcpy(p + n, data, len); Loading Loading @@ -331,7 +339,7 @@ int HASH_FINAL(unsigned char *md, HASH_CTX *c) p -= HASH_CBLOCK; HASH_BLOCK_DATA_ORDER(c, p, 1); c->num = 0; memset(p, 0, HASH_CBLOCK); OPENSSL_cleanse(p, HASH_CBLOCK); #ifndef HASH_MAKE_STRING # error "HASH_MAKE_STRING must be defined!" Loading
crypto/md2/md2_dgst.c +1 −1 Original line number Diff line number Diff line Loading @@ -168,6 +168,6 @@ int MD2_Final(unsigned char *md, MD2_CTX *c) for (i = 0; i < 16; i++) md[i] = (UCHAR) (p1[i] & 0xff); memset(&c, 0, sizeof(c)); OPENSSL_cleanse(c, sizeof(*c)); return 1; }