From 1e85b05f09d542b616f9d7bc6e1e28c8875c1cd5 Mon Sep 17 00:00:00 2001 From: sehraf Date: Sat, 15 Sep 2018 14:30:23 +0200 Subject: [PATCH] get rid of cipher_version variable. use plain output from openssl --- libresapi/src/api/PeersHandler.cpp | 9 +-------- libretroshare/src/pqi/pqiperson.cc | 2 -- libretroshare/src/pqi/pqissl.cc | 9 +-------- libretroshare/src/retroshare/rspeers.h | 1 - retroshare-gui/src/gui/connect/ConfCertDialog.cpp | 11 +---------- 5 files changed, 3 insertions(+), 29 deletions(-) diff --git a/libresapi/src/api/PeersHandler.cpp b/libresapi/src/api/PeersHandler.cpp index 71075e849..09e30e58d 100644 --- a/libresapi/src/api/PeersHandler.cpp +++ b/libresapi/src/api/PeersHandler.cpp @@ -1195,14 +1195,7 @@ void PeersHandler::handleGetNodeOptions(Request& req, Response& resp) std::string encryption; RsPeerCryptoParams cdet; if(RsControl::instance()->getPeerCryptoDetails(detail.id, cdet) && cdet.connexion_state != 0) - { - encryption = cdet.cipher_version; - encryption += ": "; - encryption += cdet.cipher_name; - - if(cdet.cipher_version != "TLSv1.2") - encryption += cdet.cipher_bits_1; - } + encryption = cdet.cipher_name; else encryption = "Not connected"; diff --git a/libretroshare/src/pqi/pqiperson.cc b/libretroshare/src/pqi/pqiperson.cc index 30f7d37d3..c3a39d5dd 100644 --- a/libretroshare/src/pqi/pqiperson.cc +++ b/libretroshare/src/pqi/pqiperson.cc @@ -606,7 +606,6 @@ bool pqiperson::getCryptoParams(RsPeerCryptoParams & params) params.cipher_name.clear(); params.cipher_bits_1 = 0; params.cipher_bits_2 = 0; - params.cipher_version.clear(); return false ; } @@ -627,7 +626,6 @@ bool pqiconnect::getCryptoParams(RsPeerCryptoParams & params) params.cipher_name.clear() ; params.cipher_bits_1 = 0 ; params.cipher_bits_2 = 0 ; - params.cipher_version.clear() ; return false ; } } diff --git a/libretroshare/src/pqi/pqissl.cc b/libretroshare/src/pqi/pqissl.cc index 32516c539..a52caf9f4 100644 --- a/libretroshare/src/pqi/pqissl.cc +++ b/libretroshare/src/pqi/pqissl.cc @@ -304,7 +304,6 @@ void pqissl::getCryptoParams(RsPeerCryptoParams& params) if(active) { params.connexion_state = 1 ; - params.cipher_name = std::string( SSL_get_cipher(ssl_connection)); int alg ; int al2 = SSL_get_cipher_bits(ssl_connection,&alg); @@ -313,12 +312,7 @@ void pqissl::getCryptoParams(RsPeerCryptoParams& params) params.cipher_bits_2 = al2 ; char *desc = SSL_CIPHER_description(SSL_get_current_cipher(ssl_connection), NULL, 0); - params.cipher_version = - std::string(desc).find("TLSv1.3") != std::string::npos ? - std::string("TLSv1.3") : - std::string(desc).find("TLSv1.2") != std::string::npos ? - std::string("TLSv1.2") : - std::string("TLSv1"); + params.cipher_name = std::string(desc); OPENSSL_free(desc); } else @@ -327,7 +321,6 @@ void pqissl::getCryptoParams(RsPeerCryptoParams& params) params.cipher_name.clear() ; params.cipher_bits_1 = 0 ; params.cipher_bits_2 = 0 ; - params.cipher_version.clear() ; } } diff --git a/libretroshare/src/retroshare/rspeers.h b/libretroshare/src/retroshare/rspeers.h index bd1dbf357..e490d5d20 100644 --- a/libretroshare/src/retroshare/rspeers.h +++ b/libretroshare/src/retroshare/rspeers.h @@ -335,7 +335,6 @@ struct RsPeerCryptoParams std::string cipher_name; int cipher_bits_1; int cipher_bits_2; - std::string cipher_version; }; struct RsGroupInfo : RsSerializable diff --git a/retroshare-gui/src/gui/connect/ConfCertDialog.cpp b/retroshare-gui/src/gui/connect/ConfCertDialog.cpp index 7e13a2227..3c873fdca 100644 --- a/retroshare-gui/src/gui/connect/ConfCertDialog.cpp +++ b/retroshare-gui/src/gui/connect/ConfCertDialog.cpp @@ -165,16 +165,7 @@ void ConfCertDialog::load() RsPeerCryptoParams cdet ; if(RsControl::instance()->getPeerCryptoDetails(detail.id,cdet) && cdet.connexion_state!=0) - { - QString ct ; - ct += QString::fromStdString(cdet.cipher_version) + ": "; - ct += QString::fromStdString(cdet.cipher_name); - - if(cdet.cipher_version != "TLSv1.2" && cdet.cipher_version != "TLSv1.3") - ct += QString::number(cdet.cipher_bits_1); - - ui.crypto_info->setText(ct) ; - } + ui.crypto_info->setText(QString::fromStdString(cdet.cipher_name)); else ui.crypto_info->setText(tr("Not connected")) ;