summaryrefslogtreecommitdiff
path: root/src/protocol/internal/fqterm_ssh_packet.h
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2016-11-05 14:54:10 +0800
committerIru Cai <mytbk920423@gmail.com>2016-11-08 15:16:40 +0800
commit0a817b9fcb8e7a1bf5c4a910eb0de1a549b5ba9f (patch)
treef765c09f54e47f0d1e34afb5d09885579e946c76 /src/protocol/internal/fqterm_ssh_packet.h
parent92c88c20fe34add9876e9d4e89813ea285f1bbac (diff)
downloadfqterm-0a817b9fcb8e7a1bf5c4a910eb0de1a549b5ba9f.tar.xz
Implement ssh_cipher_t for symmetric ciphers in SSH
* remove FQTermSSHCipher and FQTermSSH3DES, use ssh_cipher_t instead * implement EVP ciphers and 3DES-SSH1
Diffstat (limited to 'src/protocol/internal/fqterm_ssh_packet.h')
-rw-r--r--src/protocol/internal/fqterm_ssh_packet.h18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/protocol/internal/fqterm_ssh_packet.h b/src/protocol/internal/fqterm_ssh_packet.h
index ed5a488..705a11b 100644
--- a/src/protocol/internal/fqterm_ssh_packet.h
+++ b/src/protocol/internal/fqterm_ssh_packet.h
@@ -28,8 +28,8 @@
#include "fqterm_ssh_types.h"
#include "fqterm_ssh_buffer.h"
#include "fqterm_ssh_mac.h"
-#include "fqterm_ssh_cipher.h"
#include "fqterm_serialization.h"
+#include "ssh_cipher.h"
namespace FQTerm {
@@ -38,10 +38,11 @@ class FQTermSSHPacketSender: public QObject {
public:
FQTermSSHBuffer *output_buffer_;
FQTermSSHBuffer *buffer_;
+ ssh_cipher_t *cipher;
FQTermSSHPacketSender();
virtual ~FQTermSSHPacketSender();
-
+
void startPacket(int pkt_type);
void putByte(int data);
void putInt(u_int data);
@@ -51,12 +52,11 @@ class FQTermSSHPacketSender: public QObject {
void putBN2(BIGNUM *bignum);
void write();
- int getIVSize() const { return cipher_->getIVSize();}
- int getKeySize() const { return cipher_->getKeySize();}
+ virtual int getIVSize() const { return cipher->IVSize;}
+ virtual int getKeySize() const { return cipher->keySize;}
int getMacKeySize() const { return mac_->keySize();}
public slots:
- virtual void setEncryptionType(int cipherType);
void startEncryption(const u_char *key, const u_char *IV = NULL);
void resetEncryption();
@@ -72,7 +72,6 @@ class FQTermSSHPacketSender: public QObject {
protected:
bool is_encrypt_;
int cipher_type_;
- FQTermSSHCipher *cipher_;
bool is_mac_;
int mac_type_;
@@ -89,6 +88,7 @@ class FQTermSSHPacketReceiver: public QObject {
Q_OBJECT;
public:
FQTermSSHBuffer *buffer_;
+ ssh_cipher_t *cipher;
FQTermSSHPacketReceiver();
virtual ~FQTermSSHPacketReceiver();
@@ -106,13 +106,12 @@ class FQTermSSHPacketReceiver: public QObject {
void consume(int len);
virtual int packetDataLen() const { return real_data_len_;}
- int getIVSize() const { return cipher_->getIVSize();}
- int getKeySize() const { return cipher_->getKeySize();}
+ virtual int getIVSize() const { return cipher->IVSize;}
+ virtual int getKeySize() const { return cipher->keySize;}
int getMacKeySize() const { return mac_->keySize();}
virtual void parseData(FQTermSSHBuffer *input) = 0;
public slots:
- virtual void setEncryptionType(int cipherType);
void startEncryption(const u_char *key, const u_char *IV = NULL);
void resetEncryption();
@@ -129,7 +128,6 @@ class FQTermSSHPacketReceiver: public QObject {
protected:
bool is_decrypt_;
int cipher_type_;
- FQTermSSHCipher *cipher_;
bool is_mac_;
int mac_type_;