summaryrefslogtreecommitdiff
path: root/src/protocol/internal/fqterm_ssh2_kex.h
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2018-05-01 00:04:09 +0800
committerIru Cai <mytbk920423@gmail.com>2018-05-04 19:46:06 +0800
commit05fb446f43bd1853e81f77729f0d20084486ffb7 (patch)
treee58b8ec5920bca6d6028fb31e78fa35b44c9a054 /src/protocol/internal/fqterm_ssh2_kex.h
parentdffefc69bf9d0b9754e1a8b1426be9c51c8e5eb1 (diff)
downloadfqterm-05fb446f43bd1853e81f77729f0d20084486ffb7.tar.xz
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}
Diffstat (limited to 'src/protocol/internal/fqterm_ssh2_kex.h')
-rw-r--r--src/protocol/internal/fqterm_ssh2_kex.h16
1 files changed, 2 insertions, 14 deletions
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 <openssl/sha.h>
#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();