diff options
author | Otto Hollmann <otto@hollmann.cz> | 2020-10-19 16:25:26 +0200 |
---|---|---|
committer | Tomas Mraz <tmraz@fedoraproject.org> | 2021-01-07 17:38:56 +0100 |
commit | 981b4b95721907384f4add9de72bf90e0ba39288 (patch) | |
tree | 66ce01a42524d81584c1fbae2187f859179709fa /ssl | |
parent | 1c47539a2331ff0b58a4e8663bcc6db0dc2c6449 (diff) |
Fixed error and return code.
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/12100)
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/ssl_ciph.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/ssl/ssl_ciph.c b/ssl/ssl_ciph.c index abbe6b71e0..ad287e6fdf 100644 --- a/ssl/ssl_ciph.c +++ b/ssl/ssl_ciph.c @@ -1288,21 +1288,17 @@ static int ciphersuite_cb(const char *elem, int len, void *arg) /* Arbitrary sized temp buffer for the cipher name. Should be big enough */ char name[80]; - if (len > (int)(sizeof(name) - 1)) { - ERR_raise(ERR_LIB_SSL, SSL_R_NO_CIPHER_MATCH); - return 0; - } + if (len > (int)(sizeof(name) - 1)) + /* Anyway return 1 so we can parse rest of the list */ + return 1; memcpy(name, elem, len); name[len] = '\0'; cipher = ssl3_get_cipher_by_std_name(name); - if (cipher == NULL) { - ERR_raise(ERR_LIB_SSL, SSL_R_NO_CIPHER_MATCH); - return 0; + if (cipher == NULL) /* Ciphersuite not found but return 1 to parse rest of the list */ return 1; - } if (!sk_SSL_CIPHER_push(ciphersuites, cipher)) { ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR); @@ -1323,6 +1319,7 @@ static __owur int set_ciphersuites(STACK_OF(SSL_CIPHER) **currciphers, const cha if (*str != '\0' && (CONF_parse_list(str, ':', 1, ciphersuite_cb, newciphers) <= 0 || sk_SSL_CIPHER_num(newciphers) == 0 )) { + ERR_raise(ERR_LIB_SSL, SSL_R_NO_CIPHER_MATCH); sk_SSL_CIPHER_free(newciphers); return 0; } |