diff options
author | hklaas <71921312+hklaas@users.noreply.github.com> | 2020-09-26 10:54:13 +0100 |
---|---|---|
committer | Dmitry Belyavskiy <beldmit@gmail.com> | 2020-09-27 21:09:54 +0300 |
commit | d93bded6aa2852e681de2ed76fb43c415687af68 (patch) | |
tree | f6dbe93044f62a390c90a7b51615c56ec1471041 /ssl/s3_lib.c | |
parent | 8c27ee6e056257ab872598bb2a410b23f6c411a0 (diff) |
optimise ssl3_get_cipher_by_std_name()
Return immediately on matched cipher. Without this patch the code only breaks out of the inner for loop, meaning for a matched TLS13 cipher the code will still loop through 160ish SSL3 ciphers.
CLA: trivial
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/13000)
Diffstat (limited to 'ssl/s3_lib.c')
-rw-r--r-- | ssl/s3_lib.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index 88bab0edc4..94c2d8c2ce 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -4132,8 +4132,7 @@ const SSL_CIPHER *ssl3_get_cipher_by_std_name(const char *stdname) if (tbl->stdname == NULL) continue; if (strcmp(stdname, tbl->stdname) == 0) { - c = tbl; - break; + return tbl; } } } |