diff options
author | tb <> | 2025-01-18 14:17:05 +0000 |
---|---|---|
committer | tb <> | 2025-01-18 14:17:05 +0000 |
commit | 506dd19accaff60f557599174031e46849d3a387 (patch) | |
tree | 7992b4643100aceb8451bdab92ce817e2039e7f0 /src | |
parent | f5e0c82260141013166e5f04eff3371c86297eb2 (diff) | |
download | openbsd-506dd19accaff60f557599174031e46849d3a387.tar.gz openbsd-506dd19accaff60f557599174031e46849d3a387.tar.bz2 openbsd-506dd19accaff60f557599174031e46849d3a387.zip |
Simplify tls1_check_ec_key()
It doesn't need to have optional arguments anymore, so we can pass
in values and don't need NULL checks and dereferencing.
ok jsing
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libssl/t1_lib.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/libssl/t1_lib.c b/src/lib/libssl/t1_lib.c index 5bbabb48b5..b200f78098 100644 --- a/src/lib/libssl/t1_lib.c +++ b/src/lib/libssl/t1_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: t1_lib.c,v 1.203 2025/01/18 13:26:51 tb Exp $ */ | 1 | /* $OpenBSD: t1_lib.c,v 1.204 2025/01/18 14:17:05 tb Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -652,7 +652,7 @@ tls1_set_ec_id(uint16_t *group_id, uint8_t *comp_id, EC_KEY *ec) | |||
652 | 652 | ||
653 | /* Check that an EC key is compatible with extensions. */ | 653 | /* Check that an EC key is compatible with extensions. */ |
654 | static int | 654 | static int |
655 | tls1_check_ec_key(SSL *s, const uint16_t *group_id, const uint8_t *comp_id) | 655 | tls1_check_ec_key(SSL *s, const uint16_t group_id, const uint8_t comp_id) |
656 | { | 656 | { |
657 | size_t groupslen, formatslen, i; | 657 | size_t groupslen, formatslen, i; |
658 | const uint16_t *groups; | 658 | const uint16_t *groups; |
@@ -663,9 +663,9 @@ tls1_check_ec_key(SSL *s, const uint16_t *group_id, const uint8_t *comp_id) | |||
663 | * is supported (see RFC4492). | 663 | * is supported (see RFC4492). |
664 | */ | 664 | */ |
665 | tls1_get_formatlist(s, 1, &formats, &formatslen); | 665 | tls1_get_formatlist(s, 1, &formats, &formatslen); |
666 | if (comp_id != NULL && formats != NULL) { | 666 | if (formats != NULL) { |
667 | for (i = 0; i < formatslen; i++) { | 667 | for (i = 0; i < formatslen; i++) { |
668 | if (formats[i] == *comp_id) | 668 | if (formats[i] == comp_id) |
669 | break; | 669 | break; |
670 | } | 670 | } |
671 | if (i == formatslen) | 671 | if (i == formatslen) |
@@ -676,9 +676,9 @@ tls1_check_ec_key(SSL *s, const uint16_t *group_id, const uint8_t *comp_id) | |||
676 | * Check group list if present, otherwise everything is supported. | 676 | * Check group list if present, otherwise everything is supported. |
677 | */ | 677 | */ |
678 | tls1_get_group_list(s, 1, &groups, &groupslen); | 678 | tls1_get_group_list(s, 1, &groups, &groupslen); |
679 | if (group_id != NULL && groups != NULL) { | 679 | if (groups != NULL) { |
680 | for (i = 0; i < groupslen; i++) { | 680 | for (i = 0; i < groupslen; i++) { |
681 | if (groups[i] == *group_id) | 681 | if (groups[i] == group_id) |
682 | break; | 682 | break; |
683 | } | 683 | } |
684 | if (i == groupslen) | 684 | if (i == groupslen) |
@@ -707,7 +707,7 @@ tls1_check_ec_server_key(SSL *s) | |||
707 | if (!tls1_set_ec_id(&group_id, &comp_id, eckey)) | 707 | if (!tls1_set_ec_id(&group_id, &comp_id, eckey)) |
708 | return 0; | 708 | return 0; |
709 | 709 | ||
710 | return tls1_check_ec_key(s, &group_id, &comp_id); | 710 | return tls1_check_ec_key(s, group_id, comp_id); |
711 | } | 711 | } |
712 | 712 | ||
713 | int | 713 | int |