diff options
author | Hugo Landau <hlandau@openssl.org> | 2022-07-11 19:16:20 +0100 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2022-07-29 16:28:37 +1000 |
commit | dffafaf48174497a724d546c3483d2493fc9b64c (patch) | |
tree | de3b4e5aac3398f1aa9258d363221b7d12cc03eb /crypto/packet.c | |
parent | 205957405d08ef199e6ab654e333a627bbca9ccc (diff) |
QUIC Frame Encoding and Decoding Functions
This adds functions for encoding and decoding QUIC frames.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18795)
Diffstat (limited to 'crypto/packet.c')
-rw-r--r-- | crypto/packet.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/packet.c b/crypto/packet.c index 5123426d75..753bbdc59c 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; @@ -396,12 +396,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; |