summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_ciph.c
diff options
context:
space:
mode:
authormarkus <>2003-05-11 21:36:58 +0000
committermarkus <>2003-05-11 21:36:58 +0000
commit1c98a87f0daac81245653c227eb2f2508a22a965 (patch)
tree3de6d603296ec563b936da4e6a8a1e33d48f8884 /src/lib/libssl/ssl_ciph.c
parent31392c89d1135cf2a416f97295f6d21681b3fbc4 (diff)
downloadopenbsd-1c98a87f0daac81245653c227eb2f2508a22a965.tar.gz
openbsd-1c98a87f0daac81245653c227eb2f2508a22a965.tar.bz2
openbsd-1c98a87f0daac81245653c227eb2f2508a22a965.zip
import 0.9.7b (without idea and rc5)
Diffstat (limited to 'src/lib/libssl/ssl_ciph.c')
-rw-r--r--src/lib/libssl/ssl_ciph.c14
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