From aa6575788302729a321c9a14816dd267fbcb0899 Mon Sep 17 00:00:00 2001 From: Iru Cai Date: Thu, 17 May 2018 00:02:54 +0800 Subject: kill unneeded signals and slots --- src/protocol/fqterm_ssh_socket.cpp | 5 ----- src/protocol/internal/fqterm_ssh_kex.cpp | 3 ++- src/protocol/internal/fqterm_ssh_kex.h | 3 --- src/protocol/internal/fqterm_ssh_packet.h | 14 ++++---------- 4 files changed, 6 insertions(+), 19 deletions(-) diff --git a/src/protocol/fqterm_ssh_socket.cpp b/src/protocol/fqterm_ssh_socket.cpp index 9c00cec..c0b8099 100644 --- a/src/protocol/fqterm_ssh_socket.cpp +++ b/src/protocol/fqterm_ssh_socket.cpp @@ -112,8 +112,6 @@ void FQTermSSHSocket::init(int ssh_version) { FQ_VERIFY(connect(key_exchanger_, SIGNAL(kexError(QString)), this, SLOT(handleError(QString)))); FQ_VERIFY(connect(key_exchanger_, SIGNAL(reKex()), packet_receiver_, SLOT(resetEncryption()))); FQ_VERIFY(connect(key_exchanger_, SIGNAL(reKex()), packet_sender_, SLOT(resetEncryption()))); - FQ_VERIFY(connect(key_exchanger_, SIGNAL(startEncryption(const u_char*)), packet_receiver_, SLOT(startEncryption(const u_char*)))); - FQ_VERIFY(connect(key_exchanger_, SIGNAL(startEncryption(const u_char*)), packet_sender_, SLOT(startEncryption(const u_char*)))); FQ_VERIFY(connect(authentication_, SIGNAL(requestUserPwd(QString *, QString *, bool *)), this, SIGNAL(requestUserPwd(QString *, QString *, bool *)))); FQ_VERIFY(connect(authentication_, SIGNAL(authOK()), this, SLOT(authOK()))); @@ -140,9 +138,6 @@ void FQTermSSHSocket::init(int ssh_version) { FQ_VERIFY(connect(key_exchanger_, SIGNAL(reKex()), packet_receiver_, SLOT(resetEncryption()))); FQ_VERIFY(connect(key_exchanger_, SIGNAL(reKex()), packet_sender_, SLOT(resetEncryption()))); - FQ_VERIFY(connect(key_exchanger_, SIGNAL(startEncryption(const u_char*)), packet_receiver_, SLOT(startEncryption(const u_char*)))); - FQ_VERIFY(connect(key_exchanger_, SIGNAL(startEncryption(const u_char*)), packet_sender_, SLOT(startEncryption(const u_char*)))); - FQ_VERIFY(connect(authentication_, SIGNAL(requestUserPwd(QString *, QString *, bool *)), this, SIGNAL(requestUserPwd(QString *, QString *, bool *)))); FQ_VERIFY(connect(authentication_, SIGNAL(authOK()), this, SLOT(authOK()))); FQ_VERIFY(connect(authentication_, SIGNAL(authError(QString)), this, SLOT(handleError(QString)))); diff --git a/src/protocol/internal/fqterm_ssh_kex.cpp b/src/protocol/internal/fqterm_ssh_kex.cpp index d46ba76..32db7d0 100644 --- a/src/protocol/internal/fqterm_ssh_kex.cpp +++ b/src/protocol/internal/fqterm_ssh_kex.cpp @@ -186,7 +186,8 @@ void FQTermSSH1Kex::makeSessionKey() { packet_sender_->putInt(1); packet_sender_->write(); - emit startEncryption(session_key_); + packet_sender_->startEncryption(session_key_, NULL); + packet_receiver_->startEncryption(session_key_, NULL); } void FQTermSSH1Kex::makeSessionId() { diff --git a/src/protocol/internal/fqterm_ssh_kex.h b/src/protocol/internal/fqterm_ssh_kex.h index 2bd46b8..bb668a6 100644 --- a/src/protocol/internal/fqterm_ssh_kex.h +++ b/src/protocol/internal/fqterm_ssh_kex.h @@ -61,9 +61,6 @@ signals: void kexOK(); void reKex(); void kexError(QString); - - void startEncryption(const u_char *sessionkey); - }; class FQTermSSH1Kex: public FQTermSSHKex { diff --git a/src/protocol/internal/fqterm_ssh_packet.h b/src/protocol/internal/fqterm_ssh_packet.h index 806918e..bb6adf5 100644 --- a/src/protocol/internal/fqterm_ssh_packet.h +++ b/src/protocol/internal/fqterm_ssh_packet.h @@ -57,14 +57,11 @@ class FQTermSSHPacketSender: public QObject { virtual int getKeySize() const { return cipher->keySize;} int getMacKeySize() const { return mac->keySize;} - public slots: void startEncryption(const u_char *key, const u_char *IV = NULL); - void resetEncryption(); - void startMac(const u_char *sessionkey); void resetMac(); - - void enableCompress(int enable) {is_compressed_ = enable;}; + public slots: + void resetEncryption(); signals: void dataToWrite(); @@ -109,14 +106,11 @@ class FQTermSSHPacketReceiver: public QObject { int getMacKeySize() const { return mac->keySize;} virtual void parseData(buffer *input) = 0; - public slots: void startEncryption(const u_char *key, const u_char *IV = NULL); - void resetEncryption(); - void startMac(const u_char *sessionkey); void resetMac(); - - void enableCompress(int enable) {is_compressed_ = enable;}; + public slots: + void resetEncryption(); signals: void packetAvaliable(int type); -- cgit v1.2.3