diff options
author | Iru Cai <mytbk920423@gmail.com> | 2018-04-28 17:46:22 +0800 |
---|---|---|
committer | Iru Cai <mytbk920423@gmail.com> | 2018-04-29 16:51:12 +0800 |
commit | c527d1f2e16b6be7b299164bf5c0112932a8dd3c (patch) | |
tree | f983cee4274e95cf25aba606a99e03d87398826d /src/protocol/internal/fqterm_ssh_packet.h | |
parent | b288c451e26295e173bc32f8a0017bd56fec93d3 (diff) | |
download | fqterm-c527d1f2e16b6be7b299164bf5c0112932a8dd3c.tar.xz |
refactor SSH MAC
Diffstat (limited to 'src/protocol/internal/fqterm_ssh_packet.h')
-rw-r--r-- | src/protocol/internal/fqterm_ssh_packet.h | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/protocol/internal/fqterm_ssh_packet.h b/src/protocol/internal/fqterm_ssh_packet.h index 705a11b..7caa663 100644 --- a/src/protocol/internal/fqterm_ssh_packet.h +++ b/src/protocol/internal/fqterm_ssh_packet.h @@ -27,7 +27,7 @@ #include "fqterm_ssh_types.h" #include "fqterm_ssh_buffer.h" -#include "fqterm_ssh_mac.h" +#include "ssh_mac.h" #include "fqterm_serialization.h" #include "ssh_cipher.h" @@ -39,6 +39,7 @@ class FQTermSSHPacketSender: public QObject { FQTermSSHBuffer *output_buffer_; FQTermSSHBuffer *buffer_; ssh_cipher_t *cipher; + ssh_mac_t *mac; FQTermSSHPacketSender(); virtual ~FQTermSSHPacketSender(); @@ -54,13 +55,12 @@ class FQTermSSHPacketSender: public QObject { virtual int getIVSize() const { return cipher->IVSize;} virtual int getKeySize() const { return cipher->keySize;} - int getMacKeySize() const { return mac_->keySize();} + int getMacKeySize() const { return mac->keySize;} public slots: void startEncryption(const u_char *key, const u_char *IV = NULL); void resetEncryption(); - void setMacType(int macType); void startMac(const u_char *sessionkey); void resetMac(); @@ -74,8 +74,6 @@ class FQTermSSHPacketSender: public QObject { int cipher_type_; bool is_mac_; - int mac_type_; - FQTermSSHMac *mac_; bool is_compressed_; @@ -89,6 +87,7 @@ class FQTermSSHPacketReceiver: public QObject { public: FQTermSSHBuffer *buffer_; ssh_cipher_t *cipher; + ssh_mac_t *mac; FQTermSSHPacketReceiver(); virtual ~FQTermSSHPacketReceiver(); @@ -108,14 +107,13 @@ class FQTermSSHPacketReceiver: public QObject { virtual int packetDataLen() const { return real_data_len_;} virtual int getIVSize() const { return cipher->IVSize;} virtual int getKeySize() const { return cipher->keySize;} - int getMacKeySize() const { return mac_->keySize();} + int getMacKeySize() const { return mac->keySize;} virtual void parseData(FQTermSSHBuffer *input) = 0; public slots: void startEncryption(const u_char *key, const u_char *IV = NULL); void resetEncryption(); - void setMacType(int macType); void startMac(const u_char *sessionkey); void resetMac(); @@ -130,8 +128,6 @@ class FQTermSSHPacketReceiver: public QObject { int cipher_type_; bool is_mac_; - int mac_type_; - FQTermSSHMac *mac_; bool is_compressed_; |