From 05fb446f43bd1853e81f77729f0d20084486ffb7 Mon Sep 17 00:00:00 2001 From: Iru Cai Date: Tue, 1 May 2018 00:04:09 +0800 Subject: refactor using ssh_session structure * move computeKey to C code * Use `mpint_e`, `secret` instead of bn_e, bn_K, drop bn_f * compute DH image and secret in DH related code * drop {get,put}{BN2,SSH2BN} --- src/protocol/internal/fqterm_ssh2_kex.h | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'src/protocol/internal/fqterm_ssh2_kex.h') diff --git a/src/protocol/internal/fqterm_ssh2_kex.h b/src/protocol/internal/fqterm_ssh2_kex.h index 80da76d..978cb17 100644 --- a/src/protocol/internal/fqterm_ssh2_kex.h +++ b/src/protocol/internal/fqterm_ssh2_kex.h @@ -24,7 +24,7 @@ #include #include "fqterm_ssh_kex.h" -#include "ssh_diffie-hellman.h" +#include "ssh_session.h" namespace FQTerm { @@ -58,17 +58,7 @@ private: int K_S_len_; char *K_S_; - SSH_DH *dh; - BIGNUM *bn_x_; - BIGNUM *bn_e_; - BN_CTX *ctx_; - - BIGNUM *bn_K_; - BIGNUM *bn_f_; - - unsigned char H_[SHA512_DIGEST_LENGTH]; - - unsigned char *session_id_; + ssh_session sess; bool is_first_kex_; @@ -83,8 +73,6 @@ private: void sendNewKeys(); bool changeKeyAlg(); - unsigned char *computeKey(int len, char flag); - public: FQTermSSH2Kex(const char *V_C, const char *V_S); ~FQTermSSH2Kex(); -- cgit v1.2.3