diff options
Diffstat (limited to '')
| -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 37f58886a6..888b667fa1 100644 --- a/src/lib/libssl/ssl_ciph.c +++ b/src/lib/libssl/ssl_ciph.c | |||
| @@ -668,13 +668,14 @@ static int ssl_cipher_process_rulestr(const char *rule_str, | |||
| 668 | * So additionally check whether the cipher name found | 668 | * So additionally check whether the cipher name found |
| 669 | * has the correct length. We can save a strlen() call: | 669 | * has the correct length. We can save a strlen() call: |
| 670 | * just checking for the '\0' at the right place is | 670 | * just checking for the '\0' at the right place is |
| 671 | * sufficient, we have to strncmp() anyway. | 671 | * sufficient, we have to strncmp() anyway. (We cannot |
| 672 | * use strcmp(), because buf is not '\0' terminated.) | ||
| 672 | */ | 673 | */ |
| 673 | j = found = 0; | 674 | j = found = 0; |
| 674 | while (ca_list[j]) | 675 | while (ca_list[j]) |
| 675 | { | 676 | { |
| 676 | if ((ca_list[j]->name[buflen] == '\0') && | 677 | if (!strncmp(buf, ca_list[j]->name, buflen) && |
| 677 | !strncmp(buf, ca_list[j]->name, buflen)) | 678 | (ca_list[j]->name[buflen] == '\0')) |
| 678 | { | 679 | { |
| 679 | found = 1; | 680 | found = 1; |
| 680 | break; | 681 | break; |
| @@ -751,7 +752,12 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method, | |||
| 751 | */ | 752 | */ |
| 752 | if (rule_str == NULL) return(NULL); | 753 | if (rule_str == NULL) return(NULL); |
| 753 | 754 | ||
| 754 | if (init_ciphers) load_ciphers(); | 755 | if (init_ciphers) |
| 756 | { | ||
| 757 | CRYPTO_w_lock(CRYPTO_LOCK_SSL); | ||
| 758 | if (init_ciphers) load_ciphers(); | ||
| 759 | CRYPTO_w_unlock(CRYPTO_LOCK_SSL); | ||
| 760 | } | ||
| 755 | 761 | ||
| 756 | /* | 762 | /* |
| 757 | * To reduce the work to do we only want to process the compiled | 763 | * To reduce the work to do we only want to process the compiled |
