]> jfr.im git - irc/hexchat/hexchat.git/commitdiff
Fix key exchange
authoreimmot <redacted>
Fri, 17 Mar 2017 06:15:50 +0000 (02:15 -0400)
committerTingPing <redacted>
Thu, 30 Mar 2017 20:32:40 +0000 (16:32 -0400)
Clients will receive the proper shared secret.

Eliminates error message:
SSL_read: error:05066064:Diffie-Hellman routines:compute_key:no private value

Fixes #1974

plugins/fishlim/dh1080.c

index 7eef50c7fa0014926d5b79d678e3e1afda80df00..08b1a615ecfb0ab5e42a6d6a07143d47b1b9e35c 100644 (file)
@@ -189,6 +189,7 @@ dh1080_compute_key (const char *priv_key, const char *pub_key, char **secret_key
        char *pub_key_data;
        gsize pub_key_len;
        BIGNUM *pk;
+       BIGNUM *temp_pub_key = BN_new();
        DH *dh;
 
        g_assert (secret_key != NULL);
@@ -217,7 +218,7 @@ dh1080_compute_key (const char *priv_key, const char *pub_key, char **secret_key
 #ifndef HAVE_DH_SET0_KEY
                dh->priv_key = priv_key_num;
 #else
-               DH_set0_key (dh, NULL, priv_key_num);
+               DH_set0_key (dh, temp_pub_key, priv_key_num);
 #endif
 
                shared_len = DH_compute_key (shared_key, pk, dh);