aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2022-01-02 07:22:16 +0000
committerSaturneric <[email protected]>2022-01-02 07:23:16 +0000
commitd9ec5cc0d27047c172b6194f0f89ed0db1533bee (patch)
tree13371b40186ab06840b9dbe2e810085cf1116561
parent<feat, refactor, fixed>(core, ui): add & modify file operations (diff)
downloadGpgFrontend-d9ec5cc0d27047c172b6194f0f89ed0db1533bee.tar.gz
GpgFrontend-d9ec5cc0d27047c172b6194f0f89ed0db1533bee.zip
<fixed>(core, ui): fixed bugs in result analyse
1. let VerifyResultAnalyse.cpp dealing with when there is no signature found. 2. fixed some problem in DecryptResultAnalyse.cpp.
-rw-r--r--src/gpg/result_analyse/DecryptResultAnalyse.cpp8
-rw-r--r--src/gpg/result_analyse/VerifyResultAnalyse.cpp16
2 files changed, 12 insertions, 12 deletions
diff --git a/src/gpg/result_analyse/DecryptResultAnalyse.cpp b/src/gpg/result_analyse/DecryptResultAnalyse.cpp
index 4f5cf936..9a2ade34 100644
--- a/src/gpg/result_analyse/DecryptResultAnalyse.cpp
+++ b/src/gpg/result_analyse/DecryptResultAnalyse.cpp
@@ -33,7 +33,7 @@ GpgFrontend::DecryptResultAnalyse::DecryptResultAnalyse(GpgError m_error,
: error(m_error), result(std::move(m_result)) {}
void GpgFrontend::DecryptResultAnalyse::do_analyse() {
- stream << "[#]" << _("Decrypt Operation");
+ stream << "[#] " << _("Decrypt Operation");
if (gpgme_err_code(error) == GPG_ERR_NO_ERROR) {
stream << "[" << _("Success") << "]" << std::endl;
@@ -72,7 +72,7 @@ void GpgFrontend::DecryptResultAnalyse::do_analyse() {
void GpgFrontend::DecryptResultAnalyse::print_recipient(
std::stringstream &stream, gpgme_recipient_t recipient) {
// check
- if (recipient->keyid == nullptr || recipient->pubkey_algo) return;
+ if (recipient->keyid == nullptr) return;
stream << " {>} " << _("Recipient") << ": ";
auto key = GpgFrontend::GpgKeyGetter::GetInstance().GetKey(recipient->keyid);
@@ -88,7 +88,7 @@ void GpgFrontend::DecryptResultAnalyse::print_recipient(
stream << std::endl;
- stream << " " << _("Keu ID") << ": " << recipient->keyid << std::endl;
- stream << " " << _("Public Algo") << ": "
+ stream << " " << _("Key ID") << ": " << recipient->keyid << std::endl;
+ stream << " " << _("Public Key Algo") << ": "
<< gpgme_pubkey_algo_name(recipient->pubkey_algo) << std::endl;
}
diff --git a/src/gpg/result_analyse/VerifyResultAnalyse.cpp b/src/gpg/result_analyse/VerifyResultAnalyse.cpp
index 8f565b8e..99cbd528 100644
--- a/src/gpg/result_analyse/VerifyResultAnalyse.cpp
+++ b/src/gpg/result_analyse/VerifyResultAnalyse.cpp
@@ -35,7 +35,7 @@ GpgFrontend::VerifyResultAnalyse::VerifyResultAnalyse(GpgError error,
: error(error), result(std::move(result)) {}
void GpgFrontend::VerifyResultAnalyse::do_analyse() {
- LOG(INFO) << _("Verify Result Analyse Started");
+ LOG(INFO) << _("started");
stream << "[#] " << _("Verify Operation") << " ";
@@ -46,16 +46,10 @@ void GpgFrontend::VerifyResultAnalyse::do_analyse() {
setStatus(-1);
}
- if (result != nullptr && result->signatures) {
+ if (result != nullptr && result->signatures != nullptr) {
stream << "------------>" << std::endl;
auto sign = result->signatures;
- if (sign == nullptr) {
- stream << "[>] " << _("Not Signature Found") << std::endl;
- setStatus(0);
- return;
- }
-
stream << "[>] " << _("Signed On") << "(" << _("UTC") << ")"
<< " "
<< boost::posix_time::to_iso_extended_string(
@@ -163,6 +157,12 @@ void GpgFrontend::VerifyResultAnalyse::do_analyse() {
sign = sign->next;
}
stream << "<------------" << std::endl;
+ } else {
+ stream << "[>] "
+ << _("Could not find information that can be used for verification.")
+ << std::endl;
+ setStatus(0);
+ return;
}
}