DH: added check for bad prime in encr chats

This commit is contained in:
Vysheng 2013-12-23 15:13:43 +04:00
parent b13434e378
commit 0396571877

View file

@ -2429,6 +2429,10 @@ int get_dh_config_on_answer (struct query *q UU) {
char *s = fetch_str (l);
int v = fetch_int ();
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; }
int l = prefetch_strlen ();