Commit dbffe269 authored by Vysheng's avatar Vysheng

DH: added check for bad prime in encr chats

parent 2ddd7a1d
...@@ -2429,6 +2429,10 @@ int get_dh_config_on_answer (struct query *q UU) { ...@@ -2429,6 +2429,10 @@ int get_dh_config_on_answer (struct query *q UU) {
char *s = fetch_str (l); char *s = fetch_str (l);
int v = fetch_int (); int v = fetch_int ();
bl_do_set_dh_params (a, (void *)s, v); bl_do_set_dh_params (a, (void *)s, v);
BIGNUM *p = BN_bin2bn ((void *)s, 256, 0);
assert (check_DH_params (p, a) >= 0);
BN_free (p);
} }
if (x == LOG_DH_CONFIG) { return 0; } if (x == LOG_DH_CONFIG) { return 0; }
int l = prefetch_strlen (); int l = prefetch_strlen ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment