diff options
Diffstat (limited to '')
-rw-r--r-- | src/gpg/result_analyse/VerifyResultAnalyse.cpp | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/src/gpg/result_analyse/VerifyResultAnalyse.cpp b/src/gpg/result_analyse/VerifyResultAnalyse.cpp index 55e50f38..74d2d204 100644 --- a/src/gpg/result_analyse/VerifyResultAnalyse.cpp +++ b/src/gpg/result_analyse/VerifyResultAnalyse.cpp @@ -24,6 +24,8 @@ #include "gpg/result_analyse/VerifyResultAnalyse.h" +#include <boost/format.hpp> + #include "GpgFrontend.h" #include "gpg/GpgConstants.h" #include "gpg/function/GpgKeyGetter.h" @@ -59,14 +61,18 @@ void GpgFrontend::VerifyResultAnalyse::do_analyse() { boost::posix_time::from_time_t(sign->timestamp)) << std::endl; - stream << std::endl << "[>] " << _("Signatures") << ":" << std::endl; + stream << std::endl << "[>] " << _("Signatures List") << ":" << std::endl; bool canContinue = true; + int count = 1; while (sign && canContinue) { + stream << boost::format(_("Signature [%1%]:")) % count++ << std::endl; switch (gpg_err_code(sign->status)) { case GPG_ERR_BAD_SIGNATURE: - stream << _("One or More Bad Signatures.") << std::endl; + stream << _("A Bad Signature.") << std::endl; + print_signer(stream, sign); + stream << _("This Signature is invalid.") << std::endl; canContinue = false; setStatus(-1); break; @@ -173,14 +179,17 @@ bool GpgFrontend::VerifyResultAnalyse::print_signer(std::stringstream &stream, stream << " " << _("Signed By") << ": " << key.uids()->front().uid() << std::endl; } - stream << " " << _("Public Key Algo") << ": " - << gpgme_pubkey_algo_name(sign->pubkey_algo) << std::endl; - stream << " " << _("Hash Algo") << ": " - << gpgme_hash_algo_name(sign->hash_algo) << std::endl; - stream << " " << _("Date & Time") << ": " - << boost::posix_time::to_iso_string( - boost::posix_time::from_time_t(sign->timestamp)) - << std::endl; + if (sign->pubkey_algo) + stream << " " << _("Public Key Algo") << ": " + << gpgme_pubkey_algo_name(sign->pubkey_algo) << std::endl; + if (sign->hash_algo) + stream << " " << _("Hash Algo") << ": " + << gpgme_hash_algo_name(sign->hash_algo) << std::endl; + if (sign->timestamp) + stream << " " << _("Date & Time") << ": " + << boost::posix_time::to_iso_string( + boost::posix_time::from_time_t(sign->timestamp)) + << std::endl; stream << std::endl; return keyFound; } |