diff options
author | jsing <> | 2021-01-05 17:32:39 +0000 |
---|---|---|
committer | jsing <> | 2021-01-05 17:32:39 +0000 |
commit | ce479dfa8834d99cf53bfcea2e6036301c921acb (patch) | |
tree | 3d9f1f670729120662da692624ce0aeb3e17a531 /src/lib | |
parent | 8e8301ad47bf0a141d94094f633bb082f23966a0 (diff) | |
download | openbsd-ce479dfa8834d99cf53bfcea2e6036301c921acb.tar.gz openbsd-ce479dfa8834d99cf53bfcea2e6036301c921acb.tar.bz2 openbsd-ce479dfa8834d99cf53bfcea2e6036301c921acb.zip |
Use consistent names in tls13_{client,server}_finished_{recv,send}().
In tls13_{client,server}_finished_recv() we use verify_data_len, which
makes more sense than hmac_len. Use the same name in
tls13_{client,server}_finished_send(), keeping things consistent between
functions.
ok tb@
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libssl/tls13_client.c | 12 | ||||
-rw-r--r-- | src/lib/libssl/tls13_server.c | 12 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/lib/libssl/tls13_client.c b/src/lib/libssl/tls13_client.c index f804f27293..25d78d1332 100644 --- a/src/lib/libssl/tls13_client.c +++ b/src/lib/libssl/tls13_client.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls13_client.c,v 1.68 2020/12/14 15:26:36 tb Exp $ */ | 1 | /* $OpenBSD: tls13_client.c,v 1.69 2021/01/05 17:32:39 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -1039,7 +1039,7 @@ tls13_client_finished_send(struct tls13_ctx *ctx, CBB *cbb) | |||
1039 | size_t transcript_hash_len; | 1039 | size_t transcript_hash_len; |
1040 | uint8_t key[EVP_MAX_MD_SIZE]; | 1040 | uint8_t key[EVP_MAX_MD_SIZE]; |
1041 | uint8_t *verify_data; | 1041 | uint8_t *verify_data; |
1042 | size_t hmac_len; | 1042 | size_t verify_data_len; |
1043 | unsigned int hlen; | 1043 | unsigned int hlen; |
1044 | HMAC_CTX *hmac_ctx = NULL; | 1044 | HMAC_CTX *hmac_ctx = NULL; |
1045 | CBS cbs; | 1045 | CBS cbs; |
@@ -1066,15 +1066,15 @@ tls13_client_finished_send(struct tls13_ctx *ctx, CBB *cbb) | |||
1066 | if (!HMAC_Update(hmac_ctx, transcript_hash, transcript_hash_len)) | 1066 | if (!HMAC_Update(hmac_ctx, transcript_hash, transcript_hash_len)) |
1067 | goto err; | 1067 | goto err; |
1068 | 1068 | ||
1069 | hmac_len = HMAC_size(hmac_ctx); | 1069 | verify_data_len = HMAC_size(hmac_ctx); |
1070 | if (!CBB_add_space(cbb, &verify_data, hmac_len)) | 1070 | if (!CBB_add_space(cbb, &verify_data, verify_data_len)) |
1071 | goto err; | 1071 | goto err; |
1072 | if (!HMAC_Final(hmac_ctx, verify_data, &hlen)) | 1072 | if (!HMAC_Final(hmac_ctx, verify_data, &hlen)) |
1073 | goto err; | 1073 | goto err; |
1074 | if (hlen != hmac_len) | 1074 | if (hlen != verify_data_len) |
1075 | goto err; | 1075 | goto err; |
1076 | 1076 | ||
1077 | CBS_init(&cbs, verify_data, hmac_len); | 1077 | CBS_init(&cbs, verify_data, verify_data_len); |
1078 | if (!CBS_write_bytes(&cbs, S3I(s)->tmp.finish_md, | 1078 | if (!CBS_write_bytes(&cbs, S3I(s)->tmp.finish_md, |
1079 | sizeof(S3I(s)->tmp.finish_md), &S3I(s)->tmp.finish_md_len)) | 1079 | sizeof(S3I(s)->tmp.finish_md), &S3I(s)->tmp.finish_md_len)) |
1080 | goto err; | 1080 | goto err; |
diff --git a/src/lib/libssl/tls13_server.c b/src/lib/libssl/tls13_server.c index 549383e331..9e5664b79a 100644 --- a/src/lib/libssl/tls13_server.c +++ b/src/lib/libssl/tls13_server.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls13_server.c,v 1.65 2021/01/05 17:14:46 jsing Exp $ */ | 1 | /* $OpenBSD: tls13_server.c,v 1.66 2021/01/05 17:32:39 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2019, 2020 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2019, 2020 Joel Sing <jsing@openbsd.org> |
4 | * Copyright (c) 2020 Bob Beck <beck@openbsd.org> | 4 | * Copyright (c) 2020 Bob Beck <beck@openbsd.org> |
@@ -775,7 +775,7 @@ tls13_server_finished_send(struct tls13_ctx *ctx, CBB *cbb) | |||
775 | size_t transcript_hash_len; | 775 | size_t transcript_hash_len; |
776 | uint8_t key[EVP_MAX_MD_SIZE]; | 776 | uint8_t key[EVP_MAX_MD_SIZE]; |
777 | uint8_t *verify_data; | 777 | uint8_t *verify_data; |
778 | size_t hmac_len; | 778 | size_t verify_data_len; |
779 | unsigned int hlen; | 779 | unsigned int hlen; |
780 | HMAC_CTX *hmac_ctx = NULL; | 780 | HMAC_CTX *hmac_ctx = NULL; |
781 | CBS cbs; | 781 | CBS cbs; |
@@ -802,15 +802,15 @@ tls13_server_finished_send(struct tls13_ctx *ctx, CBB *cbb) | |||
802 | if (!HMAC_Update(hmac_ctx, transcript_hash, transcript_hash_len)) | 802 | if (!HMAC_Update(hmac_ctx, transcript_hash, transcript_hash_len)) |
803 | goto err; | 803 | goto err; |
804 | 804 | ||
805 | hmac_len = HMAC_size(hmac_ctx); | 805 | verify_data_len = HMAC_size(hmac_ctx); |
806 | if (!CBB_add_space(cbb, &verify_data, hmac_len)) | 806 | if (!CBB_add_space(cbb, &verify_data, verify_data_len)) |
807 | goto err; | 807 | goto err; |
808 | if (!HMAC_Final(hmac_ctx, verify_data, &hlen)) | 808 | if (!HMAC_Final(hmac_ctx, verify_data, &hlen)) |
809 | goto err; | 809 | goto err; |
810 | if (hlen != hmac_len) | 810 | if (hlen != verify_data_len) |
811 | goto err; | 811 | goto err; |
812 | 812 | ||
813 | CBS_init(&cbs, verify_data, hmac_len); | 813 | CBS_init(&cbs, verify_data, verify_data_len); |
814 | if (!CBS_write_bytes(&cbs, S3I(s)->tmp.finish_md, | 814 | if (!CBS_write_bytes(&cbs, S3I(s)->tmp.finish_md, |
815 | sizeof(S3I(s)->tmp.finish_md), &S3I(s)->tmp.finish_md_len)) | 815 | sizeof(S3I(s)->tmp.finish_md), &S3I(s)->tmp.finish_md_len)) |
816 | goto err; | 816 | goto err; |