diff options
Diffstat (limited to 'src/lib/libssl/ssl_ciph.c')
-rw-r--r-- | src/lib/libssl/ssl_ciph.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/lib/libssl/ssl_ciph.c b/src/lib/libssl/ssl_ciph.c index df48245b2c..438d9eacbb 100644 --- a/src/lib/libssl/ssl_ciph.c +++ b/src/lib/libssl/ssl_ciph.c | |||
@@ -674,13 +674,14 @@ static int ssl_cipher_process_rulestr(const char *rule_str, | |||
674 | * So additionally check whether the cipher name found | 674 | * So additionally check whether the cipher name found |
675 | * has the correct length. We can save a strlen() call: | 675 | * has the correct length. We can save a strlen() call: |
676 | * just checking for the '\0' at the right place is | 676 | * just checking for the '\0' at the right place is |
677 | * sufficient, we have to strncmp() anyway. | 677 | * sufficient, we have to strncmp() anyway. (We cannot |
678 | * use strcmp(), because buf is not '\0' terminated.) | ||
678 | */ | 679 | */ |
679 | j = found = 0; | 680 | j = found = 0; |
680 | while (ca_list[j]) | 681 | while (ca_list[j]) |
681 | { | 682 | { |
682 | if ((ca_list[j]->name[buflen] == '\0') && | 683 | if (!strncmp(buf, ca_list[j]->name, buflen) && |
683 | !strncmp(buf, ca_list[j]->name, buflen)) | 684 | (ca_list[j]->name[buflen] == '\0')) |
684 | { | 685 | { |
685 | found = 1; | 686 | found = 1; |
686 | break; | 687 | break; |
@@ -757,7 +758,12 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method, | |||
757 | */ | 758 | */ |
758 | if (rule_str == NULL) return(NULL); | 759 | if (rule_str == NULL) return(NULL); |
759 | 760 | ||
760 | if (init_ciphers) load_ciphers(); | 761 | if (init_ciphers) |
762 | { | ||
763 | CRYPTO_w_lock(CRYPTO_LOCK_SSL); | ||
764 | if (init_ciphers) load_ciphers(); | ||
765 | CRYPTO_w_unlock(CRYPTO_LOCK_SSL); | ||
766 | } | ||
761 | 767 | ||
762 | /* | 768 | /* |
763 | * To reduce the work to do we only want to process the compiled | 769 | * To reduce the work to do we only want to process the compiled |