145 #ifndef OPENSSL_NO_COMP
148 #ifndef OPENSSL_NO_ENGINE
153 #define SSL_ENC_DES_IDX 0
154 #define SSL_ENC_3DES_IDX 1
155 #define SSL_ENC_RC4_IDX 2
156 #define SSL_ENC_RC2_IDX 3
157 #define SSL_ENC_IDEA_IDX 4
158 #define SSL_ENC_NULL_IDX 5
159 #define SSL_ENC_AES128_IDX 6
160 #define SSL_ENC_AES256_IDX 7
161 #define SSL_ENC_CAMELLIA128_IDX 8
162 #define SSL_ENC_CAMELLIA256_IDX 9
163 #define SSL_ENC_GOST89_IDX 10
164 #define SSL_ENC_SEED_IDX 11
165 #define SSL_ENC_AES128GCM_IDX 12
166 #define SSL_ENC_AES256GCM_IDX 13
167 #define SSL_ENC_NUM_IDX 14
171 NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL
174 #define SSL_COMP_NULL_IDX 0
175 #define SSL_COMP_ZLIB_IDX 1
176 #define SSL_COMP_NUM_IDX 2
180 #define SSL_MD_MD5_IDX 0
181 #define SSL_MD_SHA1_IDX 1
182 #define SSL_MD_GOST94_IDX 2
183 #define SSL_MD_GOST89MAC_IDX 3
184 #define SSL_MD_SHA256_IDX 4
185 #define SSL_MD_SHA384_IDX 5
189 #define SSL_MD_NUM_IDX SSL_MAX_DIGEST
191 NULL,NULL,NULL,NULL,NULL,NULL
213 #define CIPHER_KILL 2
216 #define CIPHER_SPECIAL 5
228 {0,
SSL_TXT_ALL,0, 0,0,~
SSL_eNULL,0,0,0,0,0,0},
230 {0,
SSL_TXT_CMPALL,0, 0,0,
SSL_eNULL,0,0,0,0,0,0},
233 {0,
SSL_TXT_CMPDEF,0,
SSL_kEDH|
SSL_kEECDH,
SSL_aNULL,~
SSL_eNULL,0,0,0,0,0,0},
239 {0,
SSL_TXT_kRSA,0,
SSL_kRSA, 0,0,0,0,0,0,0,0},
241 {0,
SSL_TXT_kDHr,0,
SSL_kDHr, 0,0,0,0,0,0,0,0},
242 {0,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T_IDEA,0, 0,0,
SSL_IDEA, 0,0,0,0,0,0},
292 {0,
SSL_TXT_SEED,0, 0,0,
SSL_SEED, 0,0,0,0,0,0},
293 {0,
SSL_TXT_eNULL,0, 0,0,
SSL_eNULL, 0,0,0,0,0,0},
294 {0,
SSL_TXT_AES128,0, 0,0,
SSL_AES128|
SSL_AES128GCM,0,0,0,0,0,0},
295 {0,
SSL_TXT_AES256,0, 0,0,
SSL_AES256|
SSL_AES256GCM,0,0,0,0,0,0},
296 {0,
SSL_TXT_AES,0, 0,0,
SSL_AES,0,0,0,0,0,0},
297 {0,
SSL_TXT_AES_GCM,0, 0,0,
SSL_AES128GCM|
SSL_AES256GCM,0,0,0,0,0,0},
298 {0,
SSL_TXT_CAMELLIA128,0,0,0,
SSL_CAMELLIA128,0,0,0,0,0,0},
299 {0,
SSL_TXT_CAMELLIA256,0,0,0,
SSL_CAMELLIA256,0,0,0,0,0,0},
300 {0,
SSL_TXT_CAMELLIA ,0,0,0,
SSL_CAMELLIA128|
SSL_CAMELLIA256,0,0,0,0,0,0},
303 {0,
SSL_TXT_MD5,0, 0,0,0,
SSL_MD5, 0,0,0,0,0},
304 {0,
SSL_TXT_SHA1,0, 0,0,0,
SSL_SHA1, 0,0,0,0,0},
305 {0,
SSL_TXT_SHA,0, 0,0,0,
SSL_SHA1, 0,0,0,0,0},
306 {0,
SSL_TXT_GOST94,0, 0,0,0,
SSL_GOST94, 0,0,0,0,0},
307 {0,
SSL_TXT_GOST89MAC,0, 0,0,0,
SSL_GOST89MAC, 0,0,0,0,0},
308 {0,
SSL_TXT_SHA256,0, 0,0,0,
SSL_SHA256, 0,0,0,0,0},
309 {0,
SSL_TXT_SHA384,0, 0,0,0,
SSL_SHA384, 0,0,0,0,0},
312 {0,
SSL_TXT_SSLV2,0, 0,0,0,0,
SSL_SSLV2, 0,0,0,0},
313 {0,
SSL_TXT_SSLV3,0, 0,0,0,0,
SSL_SSLV3, 0,0,0,0},
314 {0,
SSL_TXT_TLSV1,0, 0,0,0,0,
SSL_TLSV1, 0,0,0,0},
317 {0,
SSL_TXT_EXP,0, 0,0,0,0,0,
SSL_EXPORT,0,0,0},
318 {0,
SSL_TXT_EXPORT,0, 0,0,0,0,0,
SSL_EXPORT,0,0,0},
321 {0,
SSL_TXT_EXP40,0, 0,0,0,0,0,
SSL_EXP40, 0,0,0},
322 {0,
SSL_TXT_EXP56,0, 0,0,0,0,0,
SSL_EXP56, 0,0,0},
323 {0,
SSL_TXT_LOW,0, 0,0,0,0,0,
SSL_LOW, 0,0,0},
324 {0,
SSL_TXT_MEDIUM,0, 0,0,0,0,0,
SSL_MEDIUM,0,0,0},
325 {0,
SSL_TXT_HIGH,0, 0,0,0,0,0,
SSL_HIGH, 0,0,0},
327 {0,
SSL_TXT_FIPS,0, 0,0,~
SSL_eNULL,0,0,
SSL_FIPS, 0,0,0},
332 #ifdef OPENSSL_NO_ENGINE
334 static int get_optional_pkey_id(
const char *pkey_name)
348 static int get_optional_pkey_id(
const char *pkey_name)
374 #ifndef OPENSSL_NO_IDEA
412 ssl_mac_secret_size[SSL_MD_GOST94_IDX]=
413 EVP_MD_size(ssl_digest_methods[SSL_MD_GOST94_IDX]);
420 ssl_mac_secret_size[SSL_MD_GOST89MAC_IDX]=32;
432 #ifndef OPENSSL_NO_COMP
434 static int sk_comp_cmp(
const SSL_COMP *
const *
a,
437 return((*a)->id-(*b)->id);
440 static void load_builtin_compressions(
void)
442 int got_write_lock = 0;
445 if (ssl_comp_methods == NULL)
451 if (ssl_comp_methods == NULL)
457 if (ssl_comp_methods != NULL)
487 const EVP_MD **md,
int *mac_pkey_type,
int *mac_secret_size,
SSL_COMP **comp)
493 if (c == NULL)
return(0);
497 #ifndef OPENSSL_NO_COMP
498 load_builtin_compressions();
503 if (ssl_comp_methods != NULL)
513 if ((enc == NULL) || (md == NULL))
return(0);
571 *enc=ssl_cipher_methods[i];
601 if (mac_pkey_type!=NULL) *mac_pkey_type =
NID_undef;
602 if (mac_secret_size!=NULL) *mac_secret_size = 0;
604 mac_pkey_type = NULL;
608 *md=ssl_digest_methods[i];
609 if (mac_pkey_type!=NULL) *mac_pkey_type = ssl_mac_pkey_id[i];
610 if (mac_secret_size!=NULL) *mac_secret_size = ssl_mac_secret_size[i];
613 if ((*enc != NULL) &&
615 (!mac_pkey_type||*mac_pkey_type !=
NID_undef))
631 *enc = evp, *md = NULL;
635 *enc = evp, *md = NULL;
639 *enc = evp, *md = NULL;
652 *mask = ssl_handshake_digest_flag[idx];
654 *md = ssl_digest_methods[idx];
660 #define ITEM_SEP(a) \
661 (((a) == ':') || ((a) == ' ') || ((a) == ';') || ((a) == ','))
666 if (curr == *tail)
return;
669 if (curr->
prev != NULL)
671 if (curr->
next != NULL)
682 if (curr == *head)
return;
685 if (curr->
next != NULL)
687 if (curr->
prev != NULL)
695 static void ssl_cipher_get_disabled(
unsigned long *mkey,
unsigned long *auth,
unsigned long *
enc,
unsigned long *mac,
unsigned long *ssl)
703 #ifdef OPENSSL_NO_RSA
707 #ifdef OPENSSL_NO_DSA
716 #ifdef OPENSSL_NO_KRB5
720 #ifdef OPENSSL_NO_ECDSA
723 #ifdef OPENSSL_NO_ECDH
727 #ifdef OPENSSL_NO_PSK
731 #ifdef OPENSSL_NO_SRP
736 if (!get_optional_pkey_id(
"gost94")) {
739 if (!get_optional_pkey_id(
"gost2001")) {
746 #ifdef SSL_FORBID_ENULL
775 static void ssl_cipher_collect_ciphers(
const SSL_METHOD *ssl_method,
777 unsigned long disabled_mkey,
unsigned long disabled_auth,
778 unsigned long disabled_enc,
unsigned long disabled_mac,
779 unsigned long disabled_ssl,
795 for (i = 0; i < num_of_ciphers; i++)
799 if ((c != NULL) && c->
valid &&
809 co_list[co_list_num].
cipher = c;
810 co_list[co_list_num].
next = NULL;
811 co_list[co_list_num].
prev = NULL;
812 co_list[co_list_num].
active = 0;
828 co_list[0].
prev = NULL;
832 co_list[0].
next = &co_list[1];
834 for (i = 1; i < co_list_num - 1; i++)
836 co_list[i].
prev = &co_list[i - 1];
837 co_list[i].
next = &co_list[i + 1];
840 co_list[co_list_num - 1].
prev = &co_list[co_list_num - 2];
843 co_list[co_list_num - 1].
next = NULL;
845 *head_p = &co_list[0];
846 *tail_p = &co_list[co_list_num - 1];
850 static void ssl_cipher_collect_aliases(
const SSL_CIPHER **ca_list,
851 int num_of_group_aliases,
852 unsigned long disabled_mkey,
unsigned long disabled_auth,
853 unsigned long disabled_enc,
unsigned long disabled_mac,
854 unsigned long disabled_ssl,
860 unsigned long mask_mkey = ~disabled_mkey;
861 unsigned long mask_auth = ~disabled_auth;
862 unsigned long mask_enc = ~disabled_enc;
863 unsigned long mask_mac = ~disabled_mac;
864 unsigned long mask_ssl = ~disabled_ssl;
871 while (ciph_curr != NULL)
873 *ca_curr = ciph_curr->
cipher;
875 ciph_curr = ciph_curr->
next;
884 for (i = 0; i < num_of_group_aliases; i++)
888 unsigned long algorithm_enc = cipher_aliases[i].
algorithm_enc;
889 unsigned long algorithm_mac = cipher_aliases[i].
algorithm_mac;
890 unsigned long algorithm_ssl = cipher_aliases[i].
algorithm_ssl;
893 if ((algorithm_mkey & mask_mkey) == 0)
897 if ((algorithm_auth & mask_auth) == 0)
901 if ((algorithm_enc & mask_enc) == 0)
905 if ((algorithm_mac & mask_mac) == 0)
909 if ((algorithm_ssl & mask_ssl) == 0)
912 *ca_curr = (
SSL_CIPHER *)(cipher_aliases + i);
919 static void ssl_cipher_apply_rule(
unsigned long cipher_id,
920 unsigned long alg_mkey,
unsigned long alg_auth,
921 unsigned long alg_enc,
unsigned long alg_mac,
922 unsigned long alg_ssl,
923 unsigned long algo_strength,
924 int rule,
int strength_bits,
932 printf(
"Applying rule %d with %08lx/%08lx/%08lx/%08lx/%08lx %08lx (%d)\n",
933 rule, alg_mkey, alg_auth, alg_enc, alg_mac, alg_ssl, algo_strength, strength_bits);
956 if ((curr == NULL) || (curr == last))
break;
958 curr2 = reverse ? curr->
prev : curr->
next;
966 if (strength_bits >= 0)
994 printf(
"Action = %d\n", rule);
1003 ll_append_tail(&head, curr, &tail);
1013 ll_append_tail(&head, curr, &tail);
1024 ll_append_head(&head, curr, &tail);
1038 if (curr->
next != NULL)
1040 if (curr->
prev != NULL)
1051 static int ssl_cipher_strength_sort(
CIPHER_ORDER **head_p,
1054 int max_strength_bits, i, *number_uses;
1062 max_strength_bits = 0;
1064 while (curr != NULL)
1072 number_uses =
OPENSSL_malloc((max_strength_bits + 1) *
sizeof(
int));
1078 memset(number_uses, 0, (max_strength_bits + 1) *
sizeof(
int));
1084 while (curr != NULL)
1094 for (i = max_strength_bits; i >= 0; i--)
1095 if (number_uses[i] > 0)
1096 ssl_cipher_apply_rule(0, 0, 0, 0, 0, 0, 0,
CIPHER_ORD, i, head_p, tail_p);
1102 static int ssl_cipher_process_rulestr(
const char *
rule_str,
1106 unsigned long alg_mkey, alg_auth, alg_enc, alg_mac, alg_ssl, algo_strength;
1107 const char *l, *buf;
1108 int j, multi, found, rule, retval, ok, buflen;
1109 unsigned long cipher_id = 0;
1149 #ifndef CHARSET_EBCDIC
1150 while ( ((ch >=
'A') && (ch <=
'Z')) ||
1151 ((ch >=
'0') && (ch <=
'9')) ||
1152 ((ch >=
'a') && (ch <=
'z')) ||
1155 while ( isalnum(ch) || (ch ==
'-'))
1206 if (!strncmp(buf, ca_list[j]->name, buflen) &&
1207 (ca_list[j]->name[buflen] ==
'\0'))
1219 if (ca_list[j]->algorithm_mkey)
1224 if (!alg_mkey) { found = 0;
break; }
1230 if (ca_list[j]->algorithm_auth)
1235 if (!alg_auth) { found = 0;
break; }
1241 if (ca_list[j]->algorithm_enc)
1246 if (!alg_enc) { found = 0;
break; }
1252 if (ca_list[j]->algorithm_mac)
1257 if (!alg_mac) { found = 0;
break; }
1263 if (ca_list[j]->algo_strength & SSL_EXP_MASK)
1265 if (algo_strength & SSL_EXP_MASK)
1268 if (!(algo_strength & SSL_EXP_MASK)) { found = 0;
break; }
1274 if (ca_list[j]->algo_strength & SSL_STRONG_MASK)
1276 if (algo_strength & SSL_STRONG_MASK)
1279 if (!(algo_strength & SSL_STRONG_MASK)) { found = 0;
break; }
1285 if (ca_list[j]->valid)
1290 cipher_id = ca_list[j]->
id;
1297 if (ca_list[j]->algorithm_ssl)
1302 if (!alg_ssl) { found = 0;
break; }
1318 if ((buflen == 8) &&
1319 !strncmp(buf,
"STRENGTH", 8))
1320 ok = ssl_cipher_strength_sort(head_p, tail_p);
1332 while ((*l !=
'\0') && !
ITEM_SEP(*l))
1337 ssl_cipher_apply_rule(cipher_id,
1338 alg_mkey, alg_auth, alg_enc, alg_mac, alg_ssl, algo_strength,
1339 rule, -1, head_p, tail_p);
1343 while ((*l !=
'\0') && !
ITEM_SEP(*l))
1346 if (*l ==
'\0')
break;
1355 const char *rule_str)
1357 int ok, num_of_ciphers, num_of_alias_max, num_of_group_aliases;
1358 unsigned long disabled_mkey, disabled_auth, disabled_enc, disabled_mac, disabled_ssl;
1361 CIPHER_ORDER *co_list = NULL, *head = NULL, *tail = NULL, *curr;
1367 if (rule_str == NULL || cipher_list == NULL || cipher_list_by_id == NULL)
1374 ssl_cipher_get_disabled(&disabled_mkey, &disabled_auth, &disabled_enc, &disabled_mac, &disabled_ssl);
1383 printf(
"ssl_create_cipher_list() for %d ciphers\n", num_of_ciphers);
1386 if (co_list == NULL)
1392 ssl_cipher_collect_ciphers(ssl_method, num_of_ciphers,
1393 disabled_mkey, disabled_auth, disabled_enc, disabled_mac, disabled_ssl,
1394 co_list, &head, &tail);
1400 ssl_cipher_apply_rule(0,
SSL_kEECDH, 0, 0, 0, 0, 0,
CIPHER_ADD, -1, &head, &tail);
1401 ssl_cipher_apply_rule(0,
SSL_kEECDH, 0, 0, 0, 0, 0,
CIPHER_DEL, -1, &head, &tail);
1404 ssl_cipher_apply_rule(0, 0, 0,
SSL_AES, 0, 0, 0,
CIPHER_ADD, -1, &head, &tail);
1407 ssl_cipher_apply_rule(0, 0, 0, 0, 0, 0, 0,
CIPHER_ADD, -1, &head, &tail);
1410 ssl_cipher_apply_rule(0, 0, 0, 0,
SSL_MD5, 0, 0,
CIPHER_ORD, -1, &head, &tail);
1415 ssl_cipher_apply_rule(0, 0,
SSL_aNULL, 0, 0, 0, 0,
CIPHER_ORD, -1, &head, &tail);
1418 ssl_cipher_apply_rule(0, 0,
SSL_aECDH, 0, 0, 0, 0,
CIPHER_ORD, -1, &head, &tail);
1420 ssl_cipher_apply_rule(0,
SSL_kRSA, 0, 0, 0, 0, 0,
CIPHER_ORD, -1, &head, &tail);
1421 ssl_cipher_apply_rule(0,
SSL_kPSK, 0,0, 0, 0, 0,
CIPHER_ORD, -1, &head, &tail);
1422 ssl_cipher_apply_rule(0,
SSL_kKRB5, 0,0, 0, 0, 0,
CIPHER_ORD, -1, &head, &tail);
1425 ssl_cipher_apply_rule(0, 0, 0,
SSL_RC4, 0, 0, 0,
CIPHER_ORD, -1, &head, &tail);
1429 if (!ssl_cipher_strength_sort(&head, &tail))
1436 ssl_cipher_apply_rule(0, 0, 0, 0, 0, 0, 0,
CIPHER_DEL, -1, &head, &tail);
1447 num_of_group_aliases =
sizeof(cipher_aliases) /
sizeof(
SSL_CIPHER);
1448 num_of_alias_max = num_of_ciphers + num_of_group_aliases + 1;
1450 if (ca_list == NULL)
1456 ssl_cipher_collect_aliases(ca_list, num_of_group_aliases,
1457 disabled_mkey, disabled_auth, disabled_enc,
1458 disabled_mac, disabled_ssl, head);
1466 if (strncmp(rule_str,
"DEFAULT",7) == 0)
1469 &head, &tail, ca_list);
1475 if (ok && (strlen(rule_p) > 0))
1476 ok = ssl_cipher_process_rulestr(rule_p, &head, &tail, ca_list);
1500 for (curr = head; curr != NULL; curr = curr->next)
1510 printf(
"<%s>\n",curr->cipher->name);
1517 if (tmp_cipher_list == NULL)
1522 if (*cipher_list != NULL)
1524 *cipher_list = cipherstack;
1525 if (*cipher_list_by_id != NULL)
1527 *cipher_list_by_id = tmp_cipher_list;
1531 return(cipherstack);
1536 int is_export,pkl,kl;
1537 const char *ver,*exp_str;
1538 const char *kx,*au,*
enc,*mac;
1539 unsigned long alg_mkey,alg_auth,alg_enc,alg_mac,alg_ssl,alg2;
1541 static const char *
format=
"%-23s %s Kx=%-8s Au=%-4s Enc=%-9s Mac=%-4s%s AL=%lx/%lx/%lx/%lx/%lx\n";
1543 static const char *format=
"%-23s %s Kx=%-8s Au=%-4s Enc=%-9s Mac=%-4s%s\n";
1557 exp_str=is_export?
" export":
"";
1571 kx=is_export?(pkl == 512 ?
"RSA(512)" :
"RSA(1024)"):
"RSA";
1583 kx=is_export?(pkl == 512 ?
"DH(512)" :
"DH(1024)"):
"DH";
1638 enc=(is_export && kl == 5)?
"DES(40)":
"DES(56)";
1644 enc=is_export?(kl == 5 ?
"RC4(40)" :
"RC4(56)")
1648 enc=is_export?(kl == 5 ?
"RC2(40)" :
"RC2(56)"):
"RC2(128)";
1669 enc=
"Camellia(128)";
1672 enc=
"Camellia(256)";
1708 if (buf == NULL)
return(
"OPENSSL_malloc Error");
1711 return(
"Buffer too small");
1714 BIO_snprintf(buf,len,format,cipher->
name,ver,kx,au,enc,mac,exp_str,alg_mkey,alg_auth,alg_enc,alg_mac,alg_ssl);
1725 if (c == NULL)
return(
"(NONE)");
1726 i=(int)(c->
id>>24L);
1728 return(
"TLSv1/SSLv3");
1750 if (alg_bits != NULL) *alg_bits = c->
alg_bits;
1766 if ((n == 0) || (sk == NULL))
return(NULL);
1768 for (i=0; i<nn; i++)
1777 #ifdef OPENSSL_NO_COMP
1778 void *SSL_COMP_get_compression_methods(
void)
1794 load_builtin_compressions();
1795 return(ssl_comp_methods);
1811 if (id < 193 || id > 255)
1821 load_builtin_compressions();
1822 if (ssl_comp_methods
1830 else if ((ssl_comp_methods == NULL)