aboutsummaryrefslogtreecommitdiff
path: root/providers/implementations/digests/blake2s_prov.c
diff options
context:
space:
mode:
Diffstat (limited to 'providers/implementations/digests/blake2s_prov.c')
-rw-r--r--providers/implementations/digests/blake2s_prov.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/providers/implementations/digests/blake2s_prov.c b/providers/implementations/digests/blake2s_prov.c
index a9a8f9d048a2..72cab1e9a12e 100644
--- a/providers/implementations/digests/blake2s_prov.c
+++ b/providers/implementations/digests/blake2s_prov.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2024 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -314,8 +314,10 @@ int ossl_blake2s_final(unsigned char *md, BLAKE2S_CTX *c)
for (i = 0; i < iter; ++i)
store32(target + sizeof(c->h[i]) * i, c->h[i]);
- if (target != md)
+ if (target != md) {
memcpy(md, target, c->outlen);
+ OPENSSL_cleanse(target, sizeof(outbuffer));
+ }
OPENSSL_cleanse(c, sizeof(BLAKE2S_CTX));
return 1;