summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorPauli <pauli@openssl.org>2022-08-16 11:05:02 +1000
committerPauli <pauli@openssl.org>2022-08-22 14:44:19 +1000
commitec47c3060bd3b7c3e75dbcfada113de9d94de747 (patch)
tree7aafe203cb5370b4c48ca65538cc47368ec05c20 /crypto
parentaac139414e6f8fdfb4509f40811f1771f3ec193d (diff)
Coverity 1508506: misuse of time_t
Fixes a bug in the cookie code which would have caused problems for ten minutes before and after the lower 32 bits of time_t rolled over. Reviewed-by: Ben Kaduk <kaduk@mit.edu> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19023)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/packet.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/packet.c b/crypto/packet.c
index 09f6a9cea9..a9eb1ec4e4 100644
--- a/crypto/packet.c
+++ b/crypto/packet.c
@@ -207,7 +207,7 @@ int WPACKET_set_flags(WPACKET *pkt, unsigned int flags)
}
/* Store the |value| of length |len| at location |data| */
-static int put_value(unsigned char *data, size_t value, size_t len)
+static int put_value(unsigned char *data, uint64_t value, size_t len)
{
if (data == NULL)
return 1;
@@ -379,12 +379,12 @@ int WPACKET_start_sub_packet(WPACKET *pkt)
return WPACKET_start_sub_packet_len__(pkt, 0);
}
-int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size)
+int WPACKET_put_bytes__(WPACKET *pkt, uint64_t val, size_t size)
{
unsigned char *data;
/* Internal API, so should not fail */
- if (!ossl_assert(size <= sizeof(unsigned int))
+ if (!ossl_assert(size <= sizeof(uint64_t))
|| !WPACKET_allocate_bytes(pkt, size, &data)
|| !put_value(data, val, size))
return 0;