From b98d5992e41952f0908f66d62720115e85494ea4 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Mon, 5 Sep 2022 17:49:03 +0200 Subject: [PATCH] Add ZRTP post quantum, activated with ENABLE_PQCRYPTO=ON. Change encryptions mode selection from buttons into combobox. Display encryptions in call statistics. --- CHANGELOG.md | 1 + README.md | 1 + linphone-app/assets/images/secure_pq_zrtp.svg | 299 ++++++++++++++++++ linphone-app/assets/languages/da.ts | 35 ++ linphone-app/assets/languages/de.ts | 35 ++ linphone-app/assets/languages/en.ts | 35 ++ linphone-app/assets/languages/es.ts | 35 ++ linphone-app/assets/languages/fr_FR.ts | 35 ++ linphone-app/assets/languages/hu.ts | 35 ++ linphone-app/assets/languages/it.ts | 35 ++ linphone-app/assets/languages/ja.ts | 35 ++ linphone-app/assets/languages/lt.ts | 35 ++ linphone-app/assets/languages/pt_BR.ts | 35 ++ linphone-app/assets/languages/ru.ts | 35 ++ linphone-app/assets/languages/sv.ts | 35 ++ linphone-app/assets/languages/tr.ts | 35 ++ linphone-app/assets/languages/uk.ts | 35 ++ linphone-app/assets/languages/zh_CN.ts | 35 ++ linphone-app/assets/linphonerc-factory | 1 + linphone-app/resources.qrc | 1 + .../src/components/call/CallModel.cpp | 31 +- .../src/components/call/CallModel.hpp | 4 + .../src/components/settings/SettingsModel.cpp | 17 +- .../src/components/settings/SettingsModel.hpp | 3 + .../modules/Linphone/Calls/CallStatistics.qml | 65 +++- .../ui/modules/Linphone/Contact/Contact.qml | 14 +- .../Styles/Calls/CallStatisticsStyle.qml | 2 +- linphone-app/ui/views/App/Calls/Incall.qml | 4 +- .../App/Calls/ZrtpTokenAuthentication.qml | 9 + .../views/App/Settings/SettingsCallsChat.qml | 34 +- .../ui/views/App/Styles/Calls/CallStyle.qml | 2 + linphone-sdk | 2 +- 32 files changed, 966 insertions(+), 49 deletions(-) create mode 100644 linphone-app/assets/images/secure_pq_zrtp.svg diff --git a/CHANGELOG.md b/CHANGELOG.md index 833cd45bd..27d812681 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Round progress bar for transferring a file and allow to cancel it. - hide all accounts if their custom parameter 'hidden' is set to 1. - Right-click on a timeline will show a slide menu to do actions on the timeline. +- Post quantum ZRTP. ### Fixed - Crash on exit. diff --git a/README.md b/README.md index e8c3ef0ab..7ce63b23c 100644 --- a/README.md +++ b/README.md @@ -217,6 +217,7 @@ Also, more configurations are available in the docker-files folder of linphone-s | ENABLE_BUILD_EXAMPLES | Enable the build of examples | NO | | ENABLE_BUILD_VERBOSE | Enable the build generation to be more verbose | NO | | ENABLE_DAEMON | Enable the linphone daemon interface. | NO | +| ENABLE_PQCRYPTO | Enable post quantum ZRTP. | NO | | ENABLE_STRICT | Build with strict compilator flags e.g. -Wall -Werror | NO | | ENABLE_TESTS | Build with testing binaries of SDK | NO | | ENABLE_TESTS_COMPONENTS | Build libbctoolbox-tester | NO | diff --git a/linphone-app/assets/images/secure_pq_zrtp.svg b/linphone-app/assets/images/secure_pq_zrtp.svg new file mode 100644 index 000000000..59d4c0d3c --- /dev/null +++ b/linphone-app/assets/images/secure_pq_zrtp.svg @@ -0,0 +1,299 @@ + + + + + + + + + + diff --git a/linphone-app/assets/languages/da.ts b/linphone-app/assets/languages/da.ts index b10c489bd..61f6f1661 100644 --- a/linphone-app/assets/languages/da.ts +++ b/linphone-app/assets/languages/da.ts @@ -381,6 +381,36 @@ callErrorHangUp + + callStatsMediaEncryption + 'Media encryption' : label in encryption section of call statistics + + + + callStatsCipherAlgo + 'Cipher algorithm' : label in encryption section of call statistics + + + + callStatsKeyAgreementAlgo + 'Key agreement algorithm' : label in encryption section of call statistics + + + + callStatsHashAlgo + 'Hash algorithm' : label in encryption section of call statistics + + + + callStatsAuthAlgo + 'Authentication algorithm' : label in encryption section of call statistics + + + + callStatsSasAlgo + 'SAS algorithm' : label in encryption section of call statistics + + CallSipAddress @@ -403,6 +433,11 @@ videoStatsLabel Video + + mediaEncryptionLabel + 'Media encryption' : title in call statistics for the encryption section + + CallTransfer diff --git a/linphone-app/assets/languages/de.ts b/linphone-app/assets/languages/de.ts index f1c1400dc..2ee87c2af 100644 --- a/linphone-app/assets/languages/de.ts +++ b/linphone-app/assets/languages/de.ts @@ -381,6 +381,36 @@ callErrorHangUp + + callStatsMediaEncryption + 'Media encryption' : label in encryption section of call statistics + + + + callStatsCipherAlgo + 'Cipher algorithm' : label in encryption section of call statistics + + + + callStatsKeyAgreementAlgo + 'Key agreement algorithm' : label in encryption section of call statistics + + + + callStatsHashAlgo + 'Hash algorithm' : label in encryption section of call statistics + + + + callStatsAuthAlgo + 'Authentication algorithm' : label in encryption section of call statistics + + + + callStatsSasAlgo + 'SAS algorithm' : label in encryption section of call statistics + + CallSipAddress @@ -403,6 +433,11 @@ videoStatsLabel Video + + mediaEncryptionLabel + 'Media encryption' : title in call statistics for the encryption section + + CallTransfer diff --git a/linphone-app/assets/languages/en.ts b/linphone-app/assets/languages/en.ts index 7eb7dc06e..56d889f53 100644 --- a/linphone-app/assets/languages/en.ts +++ b/linphone-app/assets/languages/en.ts @@ -381,6 +381,36 @@ callErrorHangUp Remote party hanged up the call. + + callStatsMediaEncryption + 'Media encryption' : label in encryption section of call statistics + Media encryption + + + callStatsCipherAlgo + 'Cipher algorithm' : label in encryption section of call statistics + Cipher algorithm + + + callStatsKeyAgreementAlgo + 'Key agreement algorithm' : label in encryption section of call statistics + Key agreement algorithm' + + + callStatsHashAlgo + 'Hash algorithm' : label in encryption section of call statistics + Hash algorithm + + + callStatsAuthAlgo + 'Authentication algorithm' : label in encryption section of call statistics + Authentication algorithm + + + callStatsSasAlgo + 'SAS algorithm' : label in encryption section of call statistics + SAS algorithm + CallSipAddress @@ -403,6 +433,11 @@ videoStatsLabel Video + + mediaEncryptionLabel + 'Media encryption' : title in call statistics for the encryption section + Media encryption + CallTransfer diff --git a/linphone-app/assets/languages/es.ts b/linphone-app/assets/languages/es.ts index 0e94ea46e..59b6550b3 100644 --- a/linphone-app/assets/languages/es.ts +++ b/linphone-app/assets/languages/es.ts @@ -381,6 +381,36 @@ callErrorHangUp + + callStatsMediaEncryption + 'Media encryption' : label in encryption section of call statistics + + + + callStatsCipherAlgo + 'Cipher algorithm' : label in encryption section of call statistics + + + + callStatsKeyAgreementAlgo + 'Key agreement algorithm' : label in encryption section of call statistics + + + + callStatsHashAlgo + 'Hash algorithm' : label in encryption section of call statistics + + + + callStatsAuthAlgo + 'Authentication algorithm' : label in encryption section of call statistics + + + + callStatsSasAlgo + 'SAS algorithm' : label in encryption section of call statistics + + CallSipAddress @@ -403,6 +433,11 @@ videoStatsLabel Video + + mediaEncryptionLabel + 'Media encryption' : title in call statistics for the encryption section + + CallTransfer diff --git a/linphone-app/assets/languages/fr_FR.ts b/linphone-app/assets/languages/fr_FR.ts index ab93e92da..1febcb7f9 100644 --- a/linphone-app/assets/languages/fr_FR.ts +++ b/linphone-app/assets/languages/fr_FR.ts @@ -381,6 +381,36 @@ callErrorHangUp + + callStatsMediaEncryption + 'Media encryption' : label in encryption section of call statistics + + + + callStatsCipherAlgo + 'Cipher algorithm' : label in encryption section of call statistics + + + + callStatsKeyAgreementAlgo + 'Key agreement algorithm' : label in encryption section of call statistics + + + + callStatsHashAlgo + 'Hash algorithm' : label in encryption section of call statistics + + + + callStatsAuthAlgo + 'Authentication algorithm' : label in encryption section of call statistics + + + + callStatsSasAlgo + 'SAS algorithm' : label in encryption section of call statistics + + CallSipAddress @@ -403,6 +433,11 @@ videoStatsLabel Vidéo + + mediaEncryptionLabel + 'Media encryption' : title in call statistics for the encryption section + + CallTransfer diff --git a/linphone-app/assets/languages/hu.ts b/linphone-app/assets/languages/hu.ts index c4a0794d8..08597a416 100644 --- a/linphone-app/assets/languages/hu.ts +++ b/linphone-app/assets/languages/hu.ts @@ -381,6 +381,36 @@ callErrorHangUp + + callStatsMediaEncryption + 'Media encryption' : label in encryption section of call statistics + + + + callStatsCipherAlgo + 'Cipher algorithm' : label in encryption section of call statistics + + + + callStatsKeyAgreementAlgo + 'Key agreement algorithm' : label in encryption section of call statistics + + + + callStatsHashAlgo + 'Hash algorithm' : label in encryption section of call statistics + + + + callStatsAuthAlgo + 'Authentication algorithm' : label in encryption section of call statistics + + + + callStatsSasAlgo + 'SAS algorithm' : label in encryption section of call statistics + + CallSipAddress @@ -403,6 +433,11 @@ videoStatsLabel Videó + + mediaEncryptionLabel + 'Media encryption' : title in call statistics for the encryption section + + CallTransfer diff --git a/linphone-app/assets/languages/it.ts b/linphone-app/assets/languages/it.ts index 6376e23bf..f72787403 100644 --- a/linphone-app/assets/languages/it.ts +++ b/linphone-app/assets/languages/it.ts @@ -381,6 +381,36 @@ callErrorHangUp + + callStatsMediaEncryption + 'Media encryption' : label in encryption section of call statistics + + + + callStatsCipherAlgo + 'Cipher algorithm' : label in encryption section of call statistics + + + + callStatsKeyAgreementAlgo + 'Key agreement algorithm' : label in encryption section of call statistics + + + + callStatsHashAlgo + 'Hash algorithm' : label in encryption section of call statistics + + + + callStatsAuthAlgo + 'Authentication algorithm' : label in encryption section of call statistics + + + + callStatsSasAlgo + 'SAS algorithm' : label in encryption section of call statistics + + CallSipAddress @@ -403,6 +433,11 @@ videoStatsLabel Video + + mediaEncryptionLabel + 'Media encryption' : title in call statistics for the encryption section + + CallTransfer diff --git a/linphone-app/assets/languages/ja.ts b/linphone-app/assets/languages/ja.ts index 37b8b6376..652fbe28a 100644 --- a/linphone-app/assets/languages/ja.ts +++ b/linphone-app/assets/languages/ja.ts @@ -381,6 +381,36 @@ callErrorHangUp + + callStatsMediaEncryption + 'Media encryption' : label in encryption section of call statistics + + + + callStatsCipherAlgo + 'Cipher algorithm' : label in encryption section of call statistics + + + + callStatsKeyAgreementAlgo + 'Key agreement algorithm' : label in encryption section of call statistics + + + + callStatsHashAlgo + 'Hash algorithm' : label in encryption section of call statistics + + + + callStatsAuthAlgo + 'Authentication algorithm' : label in encryption section of call statistics + + + + callStatsSasAlgo + 'SAS algorithm' : label in encryption section of call statistics + + CallSipAddress @@ -403,6 +433,11 @@ videoStatsLabel 映像 + + mediaEncryptionLabel + 'Media encryption' : title in call statistics for the encryption section + + CallTransfer diff --git a/linphone-app/assets/languages/lt.ts b/linphone-app/assets/languages/lt.ts index 2b9ffde74..ce36b7937 100644 --- a/linphone-app/assets/languages/lt.ts +++ b/linphone-app/assets/languages/lt.ts @@ -381,6 +381,36 @@ callErrorHangUp + + callStatsMediaEncryption + 'Media encryption' : label in encryption section of call statistics + + + + callStatsCipherAlgo + 'Cipher algorithm' : label in encryption section of call statistics + + + + callStatsKeyAgreementAlgo + 'Key agreement algorithm' : label in encryption section of call statistics + + + + callStatsHashAlgo + 'Hash algorithm' : label in encryption section of call statistics + + + + callStatsAuthAlgo + 'Authentication algorithm' : label in encryption section of call statistics + + + + callStatsSasAlgo + 'SAS algorithm' : label in encryption section of call statistics + + CallSipAddress @@ -403,6 +433,11 @@ videoStatsLabel Vaizdas + + mediaEncryptionLabel + 'Media encryption' : title in call statistics for the encryption section + + CallTransfer diff --git a/linphone-app/assets/languages/pt_BR.ts b/linphone-app/assets/languages/pt_BR.ts index d8c2c5960..477bbb69c 100644 --- a/linphone-app/assets/languages/pt_BR.ts +++ b/linphone-app/assets/languages/pt_BR.ts @@ -381,6 +381,36 @@ callErrorHangUp + + callStatsMediaEncryption + 'Media encryption' : label in encryption section of call statistics + + + + callStatsCipherAlgo + 'Cipher algorithm' : label in encryption section of call statistics + + + + callStatsKeyAgreementAlgo + 'Key agreement algorithm' : label in encryption section of call statistics + + + + callStatsHashAlgo + 'Hash algorithm' : label in encryption section of call statistics + + + + callStatsAuthAlgo + 'Authentication algorithm' : label in encryption section of call statistics + + + + callStatsSasAlgo + 'SAS algorithm' : label in encryption section of call statistics + + CallSipAddress @@ -403,6 +433,11 @@ videoStatsLabel Vídeo + + mediaEncryptionLabel + 'Media encryption' : title in call statistics for the encryption section + + CallTransfer diff --git a/linphone-app/assets/languages/ru.ts b/linphone-app/assets/languages/ru.ts index fdc3c0814..3bfa7e2bd 100644 --- a/linphone-app/assets/languages/ru.ts +++ b/linphone-app/assets/languages/ru.ts @@ -381,6 +381,36 @@ callErrorHangUp + + callStatsMediaEncryption + 'Media encryption' : label in encryption section of call statistics + + + + callStatsCipherAlgo + 'Cipher algorithm' : label in encryption section of call statistics + + + + callStatsKeyAgreementAlgo + 'Key agreement algorithm' : label in encryption section of call statistics + + + + callStatsHashAlgo + 'Hash algorithm' : label in encryption section of call statistics + + + + callStatsAuthAlgo + 'Authentication algorithm' : label in encryption section of call statistics + + + + callStatsSasAlgo + 'SAS algorithm' : label in encryption section of call statistics + + CallSipAddress @@ -403,6 +433,11 @@ videoStatsLabel Видео + + mediaEncryptionLabel + 'Media encryption' : title in call statistics for the encryption section + + CallTransfer diff --git a/linphone-app/assets/languages/sv.ts b/linphone-app/assets/languages/sv.ts index eb3adad86..b8e771b3e 100644 --- a/linphone-app/assets/languages/sv.ts +++ b/linphone-app/assets/languages/sv.ts @@ -381,6 +381,36 @@ callErrorHangUp + + callStatsMediaEncryption + 'Media encryption' : label in encryption section of call statistics + + + + callStatsCipherAlgo + 'Cipher algorithm' : label in encryption section of call statistics + + + + callStatsKeyAgreementAlgo + 'Key agreement algorithm' : label in encryption section of call statistics + + + + callStatsHashAlgo + 'Hash algorithm' : label in encryption section of call statistics + + + + callStatsAuthAlgo + 'Authentication algorithm' : label in encryption section of call statistics + + + + callStatsSasAlgo + 'SAS algorithm' : label in encryption section of call statistics + + CallSipAddress @@ -403,6 +433,11 @@ videoStatsLabel Video + + mediaEncryptionLabel + 'Media encryption' : title in call statistics for the encryption section + + CallTransfer diff --git a/linphone-app/assets/languages/tr.ts b/linphone-app/assets/languages/tr.ts index 8e20ea1a9..5d86724a8 100644 --- a/linphone-app/assets/languages/tr.ts +++ b/linphone-app/assets/languages/tr.ts @@ -381,6 +381,36 @@ callErrorHangUp + + callStatsMediaEncryption + 'Media encryption' : label in encryption section of call statistics + + + + callStatsCipherAlgo + 'Cipher algorithm' : label in encryption section of call statistics + + + + callStatsKeyAgreementAlgo + 'Key agreement algorithm' : label in encryption section of call statistics + + + + callStatsHashAlgo + 'Hash algorithm' : label in encryption section of call statistics + + + + callStatsAuthAlgo + 'Authentication algorithm' : label in encryption section of call statistics + + + + callStatsSasAlgo + 'SAS algorithm' : label in encryption section of call statistics + + CallSipAddress @@ -403,6 +433,11 @@ videoStatsLabel Görüntü + + mediaEncryptionLabel + 'Media encryption' : title in call statistics for the encryption section + + CallTransfer diff --git a/linphone-app/assets/languages/uk.ts b/linphone-app/assets/languages/uk.ts index ba521fe7a..3e395ece3 100644 --- a/linphone-app/assets/languages/uk.ts +++ b/linphone-app/assets/languages/uk.ts @@ -381,6 +381,36 @@ callErrorHangUp + + callStatsMediaEncryption + 'Media encryption' : label in encryption section of call statistics + + + + callStatsCipherAlgo + 'Cipher algorithm' : label in encryption section of call statistics + + + + callStatsKeyAgreementAlgo + 'Key agreement algorithm' : label in encryption section of call statistics + + + + callStatsHashAlgo + 'Hash algorithm' : label in encryption section of call statistics + + + + callStatsAuthAlgo + 'Authentication algorithm' : label in encryption section of call statistics + + + + callStatsSasAlgo + 'SAS algorithm' : label in encryption section of call statistics + + CallSipAddress @@ -403,6 +433,11 @@ videoStatsLabel Відео + + mediaEncryptionLabel + 'Media encryption' : title in call statistics for the encryption section + + CallTransfer diff --git a/linphone-app/assets/languages/zh_CN.ts b/linphone-app/assets/languages/zh_CN.ts index 2f2ac04e5..55b5ddf4f 100644 --- a/linphone-app/assets/languages/zh_CN.ts +++ b/linphone-app/assets/languages/zh_CN.ts @@ -381,6 +381,36 @@ callErrorHangUp + + callStatsMediaEncryption + 'Media encryption' : label in encryption section of call statistics + + + + callStatsCipherAlgo + 'Cipher algorithm' : label in encryption section of call statistics + + + + callStatsKeyAgreementAlgo + 'Key agreement algorithm' : label in encryption section of call statistics + + + + callStatsHashAlgo + 'Hash algorithm' : label in encryption section of call statistics + + + + callStatsAuthAlgo + 'Authentication algorithm' : label in encryption section of call statistics + + + + callStatsSasAlgo + 'SAS algorithm' : label in encryption section of call statistics + + CallSipAddress @@ -403,6 +433,11 @@ videoStatsLabel 视频 + + mediaEncryptionLabel + 'Media encryption' : title in call statistics for the encryption section + + CallTransfer diff --git a/linphone-app/assets/linphonerc-factory b/linphone-app/assets/linphonerc-factory index 426f8ba6b..efe183760 100644 --- a/linphone-app/assets/linphonerc-factory +++ b/linphone-app/assets/linphonerc-factory @@ -10,6 +10,7 @@ record_aware=1 [sip] chat_messages_aggregation_delay=1000 chat_messages_aggregation=1 +zrtp_key_agreements_suites=MS_ZRTP_KEY_AGREEMENT_K255_KYB512 [video] max_mosaic_size=vga \ No newline at end of file diff --git a/linphone-app/resources.qrc b/linphone-app/resources.qrc index b7109d0cc..a8f6a5d58 100644 --- a/linphone-app/resources.qrc +++ b/linphone-app/resources.qrc @@ -144,6 +144,7 @@ assets/images/secure_level_2.svg assets/images/secure_off.svg assets/images/secure_on.svg + assets/images/secure_pq_zrtp.svg assets/images/send_custom.svg assets/images/settings_advanced_custom.svg assets/images/settings_audio_custom.svg diff --git a/linphone-app/src/components/call/CallModel.cpp b/linphone-app/src/components/call/CallModel.cpp index 3c36fe736..570700afd 100644 --- a/linphone-app/src/components/call/CallModel.cpp +++ b/linphone-app/src/components/call/CallModel.cpp @@ -273,6 +273,7 @@ void CallModel::updateStats (const shared_ptr &callSt case linphone::StreamType::Audio: updateStats(callStats, mAudioStats); + updateEncrypionStats(callStats, mEncryptionStats); break; case linphone::StreamType::Video: updateStats(callStats, mVideoStats); @@ -1071,7 +1072,9 @@ QString CallModel::getSecuredString () const { case linphone::MediaEncryption::SRTP: return QStringLiteral("SRTP"); case linphone::MediaEncryption::ZRTP: - return QStringLiteral("ZRTP"); + return CoreManager::getInstance()->getCore()->getPostQuantumAvailable() + ? QStringLiteral("Post Quantum ZRTP") + : QStringLiteral("ZRTP"); case linphone::MediaEncryption::DTLS: return QStringLiteral("DTLS"); case linphone::MediaEncryption::None: @@ -1092,6 +1095,10 @@ QVariantList CallModel::getVideoStats () const { return mVideoStats; } +QVariantList CallModel::getEncryptionStats () const { + return mEncryptionStats; +} + // ----------------------------------------------------------------------------- static inline QVariantMap createStat (const QString &key, const QString &value) { @@ -1175,6 +1182,28 @@ void CallModel::updateStats (const shared_ptr &callSt } } } +void CallModel::updateEncrypionStats (const shared_ptr &callStats, QVariantList &statsList) { + if( callStats->getType() == linphone::StreamType::Audio) {// just in case + statsList.clear(); + if(isSecured()) { + //: 'Media encryption' : label in encryption section of call statistics + statsList << createStat(tr("callStatsMediaEncryption"), getSecuredString()); + if(mCall->getCurrentParams()->getMediaEncryption() == linphone::MediaEncryption::ZRTP){ + //: 'Cipher algorithm' : label in encryption section of call statistics + statsList << createStat(tr("callStatsCipherAlgo"), Utils::coreStringToAppString(callStats->getZrtpCipherAlgo())); + //: 'Key agreement algorithm' : label in encryption section of call statistics + statsList << createStat(tr("callStatsKeyAgreementAlgo"), Utils::coreStringToAppString(callStats->getZrtpKeyAgreementAlgo())); + //: 'Hash algorithm' : label in encryption section of call statistics + statsList << createStat(tr("callStatsHashAlgo"), Utils::coreStringToAppString(callStats->getZrtpHashAlgo())); + //: 'Authentication algorithm' : label in encryption section of call statistics + statsList << createStat(tr("callStatsAuthAlgo"), Utils::coreStringToAppString(callStats->getZrtpAuthTagAlgo())); + //: 'SAS algorithm' : label in encryption section of call statistics + statsList << createStat(tr("callStatsSasAlgo"), Utils::coreStringToAppString(callStats->getZrtpSasAlgo())); + } + } + } +} + // ----------------------------------------------------------------------------- diff --git a/linphone-app/src/components/call/CallModel.hpp b/linphone-app/src/components/call/CallModel.hpp index 047704fdb..d44288749 100644 --- a/linphone-app/src/components/call/CallModel.hpp +++ b/linphone-app/src/components/call/CallModel.hpp @@ -81,6 +81,7 @@ class CallModel : public QObject { Q_PROPERTY(QVariantList audioStats READ getAudioStats NOTIFY statsUpdated) Q_PROPERTY(QVariantList videoStats READ getVideoStats NOTIFY statsUpdated) + Q_PROPERTY(QVariantList encryptionStats READ getEncryptionStats NOTIFY statsUpdated) Q_PROPERTY(CallEncryption encryption READ getEncryption NOTIFY securityUpdated) Q_PROPERTY(bool isSecured READ isSecured NOTIFY securityUpdated) @@ -286,7 +287,9 @@ public: QVariantList getAudioStats () const; QVariantList getVideoStats () const; + QVariantList getEncryptionStats () const; void updateStats (const std::shared_ptr &callStats, QVariantList &statsList); + void updateEncrypionStats (const std::shared_ptr &callStats, QVariantList &statsList); QString iceStateToString (linphone::IceState state) const; @@ -320,6 +323,7 @@ private: QVariantList mAudioStats; QVariantList mVideoStats; + QVariantList mEncryptionStats; std::shared_ptr mSearch; QString mTransferAddress; QSharedPointer mConferenceModel; diff --git a/linphone-app/src/components/settings/SettingsModel.cpp b/linphone-app/src/components/settings/SettingsModel.cpp index 4c79edead..f0c91d73e 100644 --- a/linphone-app/src/components/settings/SettingsModel.cpp +++ b/linphone-app/src/components/settings/SettingsModel.cpp @@ -933,7 +933,10 @@ bool SettingsModel::getLimeIsSupported () const { // ----------------------------------------------------------------------------- static inline QVariant buildEncryptionDescription (SettingsModel::MediaEncryption encryption, const char *description) { - return QVariantList() << encryption << description; + QVariantMap m; + m["key"] = description; + m["value"] = encryption; + return m; } QVariantList SettingsModel::getSupportedMediaEncryptions () const { @@ -943,8 +946,12 @@ QVariantList SettingsModel::getSupportedMediaEncryptions () const { if (core->mediaEncryptionSupported(linphone::MediaEncryption::SRTP)) list << buildEncryptionDescription(MediaEncryptionSrtp, "SRTP"); - if (core->mediaEncryptionSupported(linphone::MediaEncryption::ZRTP)) - list << buildEncryptionDescription(MediaEncryptionZrtp, "ZRTP"); + if (core->mediaEncryptionSupported(linphone::MediaEncryption::ZRTP)){ + if( core->getPostQuantumAvailable()) + list << buildEncryptionDescription(MediaEncryptionZrtp, "PQ-ZRTP"); + else + list << buildEncryptionDescription(MediaEncryptionZrtp, "ZRTP"); + } if (core->mediaEncryptionSupported(linphone::MediaEncryption::DTLS)) list << buildEncryptionDescription(MediaEncryptionDtls, "DTLS"); @@ -995,6 +1002,10 @@ void SettingsModel::enableMandatoryMediaEncryption(bool mandatory) { } } +bool SettingsModel::getPostQuantumAvailable() const{ + return CoreManager::getInstance()->getCore() && CoreManager::getInstance()->getCore()->getPostQuantumAvailable(); +} + // ----------------------------------------------------------------------------- bool SettingsModel::getLimeState () const { diff --git a/linphone-app/src/components/settings/SettingsModel.hpp b/linphone-app/src/components/settings/SettingsModel.hpp index 8f5d42709..57b8d3c7d 100644 --- a/linphone-app/src/components/settings/SettingsModel.hpp +++ b/linphone-app/src/components/settings/SettingsModel.hpp @@ -143,6 +143,7 @@ class SettingsModel : public QObject { Q_PROPERTY(MediaEncryption mediaEncryption READ getMediaEncryption WRITE setMediaEncryption NOTIFY mediaEncryptionChanged) Q_PROPERTY(bool mediaEncryptionMandatory READ mandatoryMediaEncryptionEnabled WRITE enableMandatoryMediaEncryption NOTIFY mediaEncryptionChanged) + Q_PROPERTY(bool isPostQuantumAvailable READ getPostQuantumAvailable CONSTANT) Q_PROPERTY(bool limeState READ getLimeState WRITE setLimeState NOTIFY limeStateChanged) @@ -456,6 +457,8 @@ public: bool mandatoryMediaEncryptionEnabled () const; void enableMandatoryMediaEncryption(bool mandatory); + bool getPostQuantumAvailable() const; + bool getLimeState () const; void setLimeState (const bool& state); diff --git a/linphone-app/ui/modules/Linphone/Calls/CallStatistics.qml b/linphone-app/ui/modules/Linphone/Calls/CallStatistics.qml index 1e9cb9e09..2eb9ba479 100644 --- a/linphone-app/ui/modules/Linphone/Calls/CallStatistics.qml +++ b/linphone-app/ui/modules/Linphone/Calls/CallStatistics.qml @@ -30,28 +30,62 @@ Popup { anchors.leftMargin: CallStatisticsStyle.popup.leftMargin anchors.rightMargin: CallStatisticsStyle.popup.rightMargin radius: 10 - Row { + RowLayout { + id: mainLayout anchors { fill: parent topMargin: CallStatisticsStyle.topMargin leftMargin: CallStatisticsStyle.leftMargin rightMargin: CallStatisticsStyle.rightMargin } - - Loader { - property string $label: qsTr('audioStatsLabel') - property var $data: callStatistics.call?callStatistics.call.audioStats:null + Layout.alignment: Qt.AlignCenter + Item{ + Layout.preferredWidth: videoLoader.sourceComponent ? 0 : parent.width /7 + Layout.fillHeight: true + } + Item{ + Layout.fillWidth: true + Layout.fillHeight: true - sourceComponent: media - width: parent.width / 2 + Column{ + anchors.fill: parent + spacing: 30 + Loader { + property string $label: qsTr('audioStatsLabel') + property var $data: callStatistics.call?callStatistics.call.audioStats:null + property bool $fillLayout: !encryptionLoader.active + + sourceComponent: media + width: parent.width + } + Loader { + id: encryptionLoader + //: 'Media encryption' : title in call statistics for the encryption section + property string $label: qsTr('mediaEncryptionLabel') + property var $data: callStatistics.call ? callStatistics.call.encryptionStats : null + + sourceComponent: callStatistics.call && callStatistics.call.isSecured ? media : undefined + width: parent.width + } + } } - Loader { - property string $label: qsTr('videoStatsLabel') - property var $data: callStatistics.call?callStatistics.call.videoStats:null - - sourceComponent: media - width: parent.width / 2 + + Item{ + Layout.fillWidth: videoLoader.sourceComponent + Layout.fillHeight: true + Loader { + id: videoLoader + property string $label: qsTr('videoStatsLabel') + property var $data: callStatistics.call?callStatistics.call.videoStats:null + + sourceComponent: callStatistics.call && callStatistics.call.videoEnabled ? media : undefined + width: sourceComponent ? parent.width : 0 + } + } + Item{ + Layout.preferredWidth: videoLoader.sourceComponent ? 0 : parent.width /7 + Layout.fillHeight: true } } @@ -64,7 +98,7 @@ Popup { RowLayout { spacing: CallStatisticsStyle.spacing - width: parent.width + width: parent ? parent.width : undefined Text { Layout.preferredWidth: CallStatisticsStyle.key.width @@ -102,7 +136,8 @@ Popup { Component { id: media - Column { + Column{ + width: parent.width Text { color: CallStatisticsStyle.title.color diff --git a/linphone-app/ui/modules/Linphone/Contact/Contact.qml b/linphone-app/ui/modules/Linphone/Contact/Contact.qml index be018b71d..a59fc1e98 100644 --- a/linphone-app/ui/modules/Linphone/Contact/Contact.qml +++ b/linphone-app/ui/modules/Linphone/Contact/Contact.qml @@ -26,14 +26,16 @@ Rectangle { property bool showSubtitle : true property string subtitle: '' - property string subject: (entry != undefined && entry.conferenceInfoModel && entry.conferenceInfoModel.subject + property string subject: (entry && entry.conferenceInfoModel && entry.conferenceInfoModel.subject ? entry.conferenceInfoModel.subject : '') - property string username: (entry != undefined && entry.username != undefined - ? entry.username - : entry.contactModel != undefined - ? entry.contactModel.vcard.username - : UtilsCpp.getDisplayName(entry.sipAddress || entry.fullPeerAddress || entry.peerAddress || '')) + property string username: entry + ? entry.username + ? entry.username + : entry.contactModel + ? entry.contactModel.vcard.username + : UtilsCpp.getDisplayName(entry.sipAddress || entry.fullPeerAddress || entry.peerAddress || '') + : '' property string organizer: entry.conferenceInfoModel ? UtilsCpp.getDisplayName(entry.conferenceInfoModel.organizer) : '' signal avatarClicked(var mouse) diff --git a/linphone-app/ui/modules/Linphone/Styles/Calls/CallStatisticsStyle.qml b/linphone-app/ui/modules/Linphone/Styles/Calls/CallStatisticsStyle.qml index a4001ecb8..0391a3bfd 100644 --- a/linphone-app/ui/modules/Linphone/Styles/Calls/CallStatisticsStyle.qml +++ b/linphone-app/ui/modules/Linphone/Styles/Calls/CallStatisticsStyle.qml @@ -13,8 +13,8 @@ QtObject { property int height: 280 property int leftMargin: 12 property int rightMargin: 12 + property int topMargin: 40 property int spacing: 8 - property int topMargin: 100 property QtObject popup: QtObject{ property int topMargin: 60 property int bottomMargin: 100 diff --git a/linphone-app/ui/views/App/Calls/Incall.qml b/linphone-app/ui/views/App/Calls/Incall.qml index b1dfa0302..649cd007b 100644 --- a/linphone-app/ui/views/App/Calls/Incall.qml +++ b/linphone-app/ui/views/App/Calls/Incall.qml @@ -373,8 +373,10 @@ Rectangle { id: zrtp anchors.horizontalCenter: parent.horizontalCenter - anchors.margins: CallStyle.container.margins anchors.bottom: actionsButtons.top + anchors.leftMargin: CallStyle.container.margins + anchors.rightMargin: CallStyle.container.margins + anchors.bottomMargin: CallStyle.container.margins height: visible ? implicitHeight : 0 call: callModel diff --git a/linphone-app/ui/views/App/Calls/ZrtpTokenAuthentication.qml b/linphone-app/ui/views/App/Calls/ZrtpTokenAuthentication.qml index 050a8dc21..26638a58e 100644 --- a/linphone-app/ui/views/App/Calls/ZrtpTokenAuthentication.qml +++ b/linphone-app/ui/views/App/Calls/ZrtpTokenAuthentication.qml @@ -2,6 +2,7 @@ import QtQuick 2.7 import QtQuick.Layouts 1.3 import Common 1.0 +import Linphone 1.0 import App.Styles 1.0 @@ -23,6 +24,14 @@ Rectangle{ Layout.fillWidth: true anchors.bottom: parent.bottom + + Icon{ + Layout.alignment: Qt.AlignHCenter + Layout.bottomMargin: 5 + visible: SettingsModel.isPostQuantumAvailable + icon: CallStyle.zrtpArea.pqIcon + iconSize: CallStyle.zrtpArea.iconSize + } // --------------------------------------------------------------------------- // Main text. diff --git a/linphone-app/ui/views/App/Settings/SettingsCallsChat.qml b/linphone-app/ui/views/App/Settings/SettingsCallsChat.qml index 066638ed9..9f5a921d4 100644 --- a/linphone-app/ui/views/App/Settings/SettingsCallsChat.qml +++ b/linphone-app/ui/views/App/Settings/SettingsCallsChat.qml @@ -20,41 +20,33 @@ TabContainer { width: parent.width FormLine { - visible: !!encryption.encryptions.length + visible: !!encryption.model.length FormGroup { label: qsTr('encryptionLabel') - ExclusiveButtons { + ComboBox { id: encryption + textRole: 'key' - property var encryptions: (function () { + model: (function () { var encryptions = SettingsModel.supportedMediaEncryptions if (encryptions.length) { - encryptions.unshift([ SettingsModel.MediaEncryptionNone, qsTr('noEncryption') ]) + encryptions.unshift({value:SettingsModel.MediaEncryptionNone, key:qsTr('noEncryption')}) } return encryptions })() - texts: encryptions.map(function (value) { - return value[1] - }) - - onClicked: SettingsModel.mediaEncryption = encryptions[button][0] - - Binding { - property: 'selectedButton' - target: encryption - value: { - var toFound = SettingsModel.mediaEncryption - return Number( - Utils.findIndex(encryption.encryptions, function (value) { - return toFound === value[0] - }) - ) - } + Component.onCompleted: { + var toFound = SettingsModel.mediaEncryption + currentIndex = Number( + Utils.findIndex(encryption.model, function (value) { + return toFound === value.value + }) + ) } + onActivated: SettingsModel.mediaEncryption = model[index].value } } FormGroup { diff --git a/linphone-app/ui/views/App/Styles/Calls/CallStyle.qml b/linphone-app/ui/views/App/Styles/Calls/CallStyle.qml index 1a58459ea..76fe0550b 100644 --- a/linphone-app/ui/views/App/Styles/Calls/CallStyle.qml +++ b/linphone-app/ui/views/App/Styles/Calls/CallStyle.qml @@ -87,6 +87,8 @@ QtObject { property QtObject zrtpArea: QtObject { property int height: 50 + property string pqIcon: 'secure_pq_zrtp' + property int iconSize: 30 property QtObject buttons: QtObject { property int spacing: 10 diff --git a/linphone-sdk b/linphone-sdk index 5a9c5ac7a..51e5432a9 160000 --- a/linphone-sdk +++ b/linphone-sdk @@ -1 +1 @@ -Subproject commit 5a9c5ac7a46a2a2677e258611b3e4bf4839b50dd +Subproject commit 51e5432a98a42a889e7cbb4dba52c5be3b433d69