diff options
author | Hugo Landau <hlandau@openssl.org> | 2023-11-23 15:50:03 +0000 |
---|---|---|
committer | Hugo Landau <hlandau@openssl.org> | 2023-11-25 09:14:05 +0000 |
commit | e64ad80c72b0743871f02badfe199d713b0cdadd (patch) | |
tree | dfcd110bedc2405efec1721e7abd75d79b0885cf /ssl | |
parent | 2db3fdb4578ca43624acda81b72bc02b08c8ce3a (diff) |
QUIC SRT GEN: Minor updates
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22599)
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/quic/quic_srt_gen.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ssl/quic/quic_srt_gen.c b/ssl/quic/quic_srt_gen.c index e43a55b29e..233e4aa628 100644 --- a/ssl/quic/quic_srt_gen.c +++ b/ssl/quic/quic_srt_gen.c @@ -65,7 +65,7 @@ int ossl_quic_srt_gen_calculate_token(QUIC_SRT_GEN *srt_gen, QUIC_STATELESS_RESET_TOKEN *token) { size_t outl = 0; - unsigned char mac[32]; + unsigned char mac[SHA256_DIGEST_LENGTH]; if (!EVP_MAC_init(srt_gen->mac_ctx, NULL, 0, NULL)) return 0; @@ -78,6 +78,7 @@ int ossl_quic_srt_gen_calculate_token(QUIC_SRT_GEN *srt_gen, || outl != sizeof(mac)) return 0; - memcpy(token, mac, sizeof(*token)); + assert(sizeof(mac) >= sizeof(token->token)); + memcpy(token->token, mac, sizeof(token->token)); return 1; } |