[openssl] master update
Dr. Paul Dale
pauli at openssl.org
Tue Apr 13 03:16:46 UTC 2021
The branch master has been updated
via 9acbbbae6b4c8eb7e967ea47f28b3e6bca8eebc8 (commit)
from 3fed27181a9b5e26216b3cad679b0f601c90ac2a (commit)
- Log -----------------------------------------------------------------
commit 9acbbbae6b4c8eb7e967ea47f28b3e6bca8eebc8
Author: Shane Lontis <shane.lontis at oracle.com>
Date: Tue Apr 13 12:24:25 2021 +1000
Fix windows compiler error in kmac_prov.c
Reviewed-by: Paul Dale <pauli at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14851)
-----------------------------------------------------------------------
Summary of changes:
providers/implementations/macs/kmac_prov.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/providers/implementations/macs/kmac_prov.c b/providers/implementations/macs/kmac_prov.c
index d6fccf442f..111e0e8ba7 100644
--- a/providers/implementations/macs/kmac_prov.c
+++ b/providers/implementations/macs/kmac_prov.c
@@ -59,6 +59,7 @@
#include "prov/provider_ctx.h"
#include "prov/provider_util.h"
#include "prov/providercommon.h"
+#include "internal/cryptlib.h" /* ossl_assert */
/*
* Forward declaration of everything implemented here. This is not strictly
@@ -497,7 +498,7 @@ static int encode_string(unsigned char *out, size_t *out_len,
return 0;
}
- out[0] = len;
+ out[0] = (unsigned char)len;
for (i = len; i > 0; --i) {
out[i] = (bits & 0xFF);
bits >>= 8;
@@ -534,9 +535,12 @@ static int bytepad(unsigned char *out, size_t *out_len,
return 1;
}
+ if (!ossl_assert(w <= 255))
+ return 0;
+
/* Left encoded w */
*p++ = 1;
- *p++ = w;
+ *p++ = (unsigned char)w;
/* || in1 */
memcpy(p, in1, in1_len);
p += in1_len;
More information about the openssl-commits
mailing list