diff options
author | Iru Cai <mytbk920423@gmail.com> | 2018-04-27 14:41:57 +0800 |
---|---|---|
committer | Iru Cai <mytbk920423@gmail.com> | 2018-04-29 16:51:12 +0800 |
commit | b288c451e26295e173bc32f8a0017bd56fec93d3 (patch) | |
tree | 6768da3c65349dcee3700fb355bc67aff76c1996 /src/protocol/internal/fqterm_ssh_kex.cpp | |
parent | a6519b094415341e055852812856ecd90f29940d (diff) | |
download | fqterm-b288c451e26295e173bc32f8a0017bd56fec93d3.tar.xz |
kill fqterm_ssh_md5
Diffstat (limited to 'src/protocol/internal/fqterm_ssh_kex.cpp')
-rw-r--r-- | src/protocol/internal/fqterm_ssh_kex.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/protocol/internal/fqterm_ssh_kex.cpp b/src/protocol/internal/fqterm_ssh_kex.cpp index eb3b012..e2975d1 100644 --- a/src/protocol/internal/fqterm_ssh_kex.cpp +++ b/src/protocol/internal/fqterm_ssh_kex.cpp @@ -19,8 +19,8 @@ ***************************************************************************/ #include "fqterm_ssh_kex.h" -#include "fqterm_ssh_md5.h" #include "fqterm_trace.h" +#include <openssl/md5.h> namespace FQTerm { @@ -191,13 +191,13 @@ void FQTermSSH1Kex::makeSessionKey() { void FQTermSSH1Kex::makeSessionId() { u_char *p; - FQTermSSHMD5 *md5; + MD5_CTX ctx; int servlen, hostlen; const BIGNUM *host_n; const BIGNUM *server_n; const BIGNUM *e, *d; - md5 = new FQTermSSHMD5; + MD5_Init(&ctx); ssh_pubkey_getrsa(server_key_, &server_n, &e, &d); ssh_pubkey_getrsa(host_key_, &host_n, &e, &d); servlen = BN_num_bytes(server_n); @@ -208,10 +208,10 @@ void FQTermSSH1Kex::makeSessionId() { BN_bn2bin(host_n, p); BN_bn2bin(server_n, p+hostlen); - md5->update(p, servlen + hostlen); - md5->update(cookie_, 8); - md5->final(session_id_); - delete md5; + MD5_Update(&ctx, p, servlen+hostlen); + MD5_Update(&ctx, cookie_, 8); + MD5_Final(session_id_, &ctx); + delete [] p; } |