diff options
author | schwarze <> | 2020-09-15 15:28:38 +0000 |
---|---|---|
committer | schwarze <> | 2020-09-15 15:28:38 +0000 |
commit | 042f3af67a1ee71c0530474205bf82a6674bea83 (patch) | |
tree | 510aac915f277e88f62fe31aeccae54bceeab3ec /src/lib/libssl/ssl_ciphers.c | |
parent | 0ca2324ae0cc18a6e5579bde76eae612194fa4e5 (diff) | |
download | openbsd-042f3af67a1ee71c0530474205bf82a6674bea83.tar.gz openbsd-042f3af67a1ee71c0530474205bf82a6674bea83.tar.bz2 openbsd-042f3af67a1ee71c0530474205bf82a6674bea83.zip |
Do not destroy an existing cipher list when ssl_parse_ciphersuites()
fails, to match the behaviour of ssl_create_cipher_list(). This also
agrees with the behaviour of SSL_set_ciphersuites(3) in OpenSSL.
Issue found while writing documentation.
OK jsing@
Diffstat (limited to 'src/lib/libssl/ssl_ciphers.c')
-rw-r--r-- | src/lib/libssl/ssl_ciphers.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lib/libssl/ssl_ciphers.c b/src/lib/libssl/ssl_ciphers.c index 0912fb6d25..399e274ad4 100644 --- a/src/lib/libssl/ssl_ciphers.c +++ b/src/lib/libssl/ssl_ciphers.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssl_ciphers.c,v 1.8 2020/09/14 17:52:38 tb Exp $ */ | 1 | /* $OpenBSD: ssl_ciphers.c,v 1.9 2020/09/15 15:28:38 schwarze Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2015-2017 Doug Hogan <doug@openbsd.org> | 3 | * Copyright (c) 2015-2017 Doug Hogan <doug@openbsd.org> |
4 | * Copyright (c) 2015-2018, 2020 Joel Sing <jsing@openbsd.org> | 4 | * Copyright (c) 2015-2018, 2020 Joel Sing <jsing@openbsd.org> |
@@ -220,9 +220,6 @@ ssl_parse_ciphersuites(STACK_OF(SSL_CIPHER) **out_ciphers, const char *str) | |||
220 | int i; | 220 | int i; |
221 | int ret = 0; | 221 | int ret = 0; |
222 | 222 | ||
223 | sk_SSL_CIPHER_free(*out_ciphers); | ||
224 | *out_ciphers = NULL; | ||
225 | |||
226 | if ((ciphers = sk_SSL_CIPHER_new_null()) == NULL) | 223 | if ((ciphers = sk_SSL_CIPHER_new_null()) == NULL) |
227 | goto err; | 224 | goto err; |
228 | 225 | ||
@@ -255,6 +252,7 @@ ssl_parse_ciphersuites(STACK_OF(SSL_CIPHER) **out_ciphers, const char *str) | |||
255 | } | 252 | } |
256 | 253 | ||
257 | done: | 254 | done: |
255 | sk_SSL_CIPHER_free(*out_ciphers); | ||
258 | *out_ciphers = ciphers; | 256 | *out_ciphers = ciphers; |
259 | ciphers = NULL; | 257 | ciphers = NULL; |
260 | ret = 1; | 258 | ret = 1; |