From ef70cc73c69d04e93c9af5fb49c5d762ba226801 Mon Sep 17 00:00:00 2001 From: Iru Cai Date: Sat, 28 Apr 2018 21:50:54 +0800 Subject: Add a connection info field in FQTermSocket - the connection info record contains the name of the cipher and MAC algorithms, and the key hash - after doing a key exchange, the connection info will be filled --- src/protocol/internal/fqterm_ssh2_kex.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 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 0a09cc1..80da76d 100644 --- a/src/protocol/internal/fqterm_ssh2_kex.h +++ b/src/protocol/internal/fqterm_ssh2_kex.h @@ -55,6 +55,8 @@ private: char *I_C_; int I_S_len_; char *I_S_; + int K_S_len_; + char *K_S_; SSH_DH *dh; BIGNUM *bn_x_; @@ -70,9 +72,6 @@ private: bool is_first_kex_; - ssh_pubkey_t *host_key_; - ssh_pubkey_t *server_key_; - u_char cookie_[16]; int server_flag_, ciphers_, auth_; // u_char session_id_[16]; @@ -92,6 +91,10 @@ public: virtual void initKex(FQTermSSHPacketReceiver *packetReceiver, FQTermSSHPacketSender *outputSender); + void hostKeyHash(unsigned char *md) + { + SHA256((const unsigned char*)K_S_, K_S_len_, md); + } public slots: void handlePacket(int type); -- cgit v1.2.3