提交 88a9614b 编写于 作者: K Kurt Roeckx

Check algo_strength using SSL_STRONG_MASK

algo_strength contains 2 parts that need to be checked by their own.
Reviewed-by: NViktor Dukhovni <viktor@openssl.org>

MR: #2082
上级 d577a69a
...@@ -970,7 +970,8 @@ static void ssl_cipher_apply_rule(uint32_t cipher_id, uint32_t alg_mkey, ...@@ -970,7 +970,8 @@ static void ssl_cipher_apply_rule(uint32_t cipher_id, uint32_t alg_mkey,
continue; continue;
if (min_tls && (min_tls != cp->min_tls)) if (min_tls && (min_tls != cp->min_tls))
continue; continue;
if (algo_strength && !(algo_strength & cp->algo_strength)) if ((algo_strength & SSL_STRONG_MASK)
&& !(algo_strength & SSL_STRONG_MASK & cp->algo_strength))
continue; continue;
if ((algo_strength & SSL_DEFAULT_MASK) if ((algo_strength & SSL_DEFAULT_MASK)
&& !(algo_strength & SSL_DEFAULT_MASK & cp->algo_strength)) && !(algo_strength & SSL_DEFAULT_MASK & cp->algo_strength))
...@@ -1237,15 +1238,17 @@ static int ssl_cipher_process_rulestr(const char *rule_str, ...@@ -1237,15 +1238,17 @@ static int ssl_cipher_process_rulestr(const char *rule_str,
alg_mac = ca_list[j]->algorithm_mac; alg_mac = ca_list[j]->algorithm_mac;
} }
if (ca_list[j]->algo_strength) { if (ca_list[j]->algo_strength & SSL_STRONG_MASK) {
if (algo_strength) { if (algo_strength & SSL_STRONG_MASK) {
algo_strength &= ca_list[j]->algo_strength; algo_strength &=
if (!algo_strength) { (ca_list[j]->algo_strength & SSL_STRONG_MASK) |
~SSL_STRONG_MASK;
if (!(algo_strength & SSL_STRONG_MASK)) {
found = 0; found = 0;
break; break;
} }
} else } else
algo_strength = ca_list[j]->algo_strength; algo_strength = ca_list[j]->algo_strength & SSL_STRONG_MASK;
} }
if (ca_list[j]->algo_strength & SSL_DEFAULT_MASK) { if (ca_list[j]->algo_strength & SSL_DEFAULT_MASK) {
......
...@@ -417,6 +417,7 @@ ...@@ -417,6 +417,7 @@
*/ */
# define TLS1_STREAM_MAC 0x10000 # define TLS1_STREAM_MAC 0x10000
# define SSL_STRONG_MASK 0x0000001FU
# define SSL_DEFAULT_MASK 0X00000020U # define SSL_DEFAULT_MASK 0X00000020U
# define SSL_STRONG_NONE 0x00000001U # define SSL_STRONG_NONE 0x00000001U
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册