aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/function
diff options
context:
space:
mode:
authorSaturn&Eric <[email protected]>2022-05-20 19:13:55 +0000
committerGitHub <[email protected]>2022-05-20 19:13:55 +0000
commit306cc5b41af9596875c2999af638eaa35899e404 (patch)
tree6d8d5b3cdb35e79527d33c63d4e69995f9c3f2df /src/core/function
parentMerge pull request #65 from saturneric/develop-2.0.8 (diff)
parentfix(ui): there is possible null pointer dereference (diff)
downloadGpgFrontend-306cc5b41af9596875c2999af638eaa35899e404.tar.gz
GpgFrontend-306cc5b41af9596875c2999af638eaa35899e404.zip
Merge pull request #66 from saturneric/develop-2.0.8
Develop 2.0.8.2
Diffstat (limited to 'src/core/function')
-rw-r--r--src/core/function/CharsetOperator.h2
-rw-r--r--src/core/function/DataObjectOperator.h4
-rw-r--r--src/core/function/GlobalSettingStation.h7
-rw-r--r--src/core/function/gpg/GpgBasicOperator.cpp2
-rw-r--r--src/core/function/result_analyse/GpgVerifyResultAnalyse.cpp9
5 files changed, 8 insertions, 16 deletions
diff --git a/src/core/function/CharsetOperator.h b/src/core/function/CharsetOperator.h
index c04430f2..41ce62f4 100644
--- a/src/core/function/CharsetOperator.h
+++ b/src/core/function/CharsetOperator.h
@@ -29,8 +29,6 @@
#ifndef GPGFRONTEND_CHARSETDETECTOR_H
#define GPGFRONTEND_CHARSETDETECTOR_H
-#include <string>
-
#include "core/GpgFrontendCore.h"
namespace GpgFrontend {
diff --git a/src/core/function/DataObjectOperator.h b/src/core/function/DataObjectOperator.h
index 1b52ec32..97abc607 100644
--- a/src/core/function/DataObjectOperator.h
+++ b/src/core/function/DataObjectOperator.h
@@ -29,8 +29,6 @@
#ifndef GPGFRONTEND_DATAOBJECTOPERATOR_H
#define GPGFRONTEND_DATAOBJECTOPERATOR_H
-#include <json/single_include/nlohmann/json.hpp>
-
#include "core/GpgFrontendCore.h"
#include "core/GpgFunctionObject.h"
#include "core/function/GlobalSettingStation.h"
@@ -38,7 +36,7 @@
namespace GpgFrontend {
class GPGFRONTEND_CORE_EXPORT DataObjectOperator
- : public SingletonFunctionObject<DataObjectOperator> {
+ : public SingletonFunctionObject<DataObjectOperator> {
public:
/**
* @brief DataObjectOperator constructor
diff --git a/src/core/function/GlobalSettingStation.h b/src/core/function/GlobalSettingStation.h
index 0df6bd21..ccf8e8f0 100644
--- a/src/core/function/GlobalSettingStation.h
+++ b/src/core/function/GlobalSettingStation.h
@@ -29,11 +29,6 @@
#ifndef GPGFRONTEND_GLOBALSETTINGSTATION_H
#define GPGFRONTEND_GLOBALSETTINGSTATION_H
-#include <openssl/x509.h>
-
-#include <boost/filesystem/operations.hpp>
-#include <boost/filesystem/path.hpp>
-
#include "GpgFrontendBuildInstallInfo.h"
#include "core/GpgFrontendCore.h"
#include "core/GpgFunctionObject.h"
@@ -148,7 +143,7 @@ class GPGFRONTEND_CORE_EXPORT GlobalSettingStation
private:
std::filesystem::path app_path_ =
- qApp->applicationDirPath().toStdString(); ///< Program Location
+ QCoreApplication::applicationDirPath().toStdString(); ///< Program Location
std::filesystem::path app_data_path_ =
QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)
.toStdString(); ///< Program Data Location
diff --git a/src/core/function/gpg/GpgBasicOperator.cpp b/src/core/function/gpg/GpgBasicOperator.cpp
index 97399b4e..a2c5d81b 100644
--- a/src/core/function/gpg/GpgBasicOperator.cpp
+++ b/src/core/function/gpg/GpgBasicOperator.cpp
@@ -86,7 +86,7 @@ GpgFrontend::GpgError GpgFrontend::GpgBasicOperator::Verify(
GpgData data_in(in_buffer.data(), in_buffer.size());
GpgData data_out;
- if (sig_buffer != nullptr) {
+ if (sig_buffer != nullptr && sig_buffer->size() > 0) {
GpgData sig_data(sig_buffer->data(), sig_buffer->size());
err = check_gpg_error(gpgme_op_verify(ctx_, sig_data, data_in, nullptr));
} else
diff --git a/src/core/function/result_analyse/GpgVerifyResultAnalyse.cpp b/src/core/function/result_analyse/GpgVerifyResultAnalyse.cpp
index 44031e67..79eb5282 100644
--- a/src/core/function/result_analyse/GpgVerifyResultAnalyse.cpp
+++ b/src/core/function/result_analyse/GpgVerifyResultAnalyse.cpp
@@ -34,8 +34,8 @@
#include "core/GpgConstants.h"
#include "function/gpg/GpgKeyGetter.h"
-GpgFrontend::GpgVerifyResultAnalyse::GpgVerifyResultAnalyse(GpgError error,
- GpgVerifyResult result)
+GpgFrontend::GpgVerifyResultAnalyse::GpgVerifyResultAnalyse(
+ GpgError error, GpgVerifyResult result)
: error_(error), result_(std::move(result)) {}
void GpgFrontend::GpgVerifyResultAnalyse::do_analyse() {
@@ -104,6 +104,7 @@ void GpgFrontend::GpgVerifyResultAnalyse::do_analyse() {
stream_ << _("Signature Fully Valid.") << std::endl;
} else {
stream_ << _("Signature Not Fully Valid.") << std::endl;
+ stream_ << _("(May used a subkey to sign)") << std::endl;
}
if (!(sign->status & GPGME_SIGSUM_KEY_MISSING)) {
@@ -172,8 +173,8 @@ void GpgFrontend::GpgVerifyResultAnalyse::do_analyse() {
}
}
-bool GpgFrontend::GpgVerifyResultAnalyse::print_signer(std::stringstream &stream,
- gpgme_signature_t sign) {
+bool GpgFrontend::GpgVerifyResultAnalyse::print_signer(
+ std::stringstream &stream, gpgme_signature_t sign) {
bool keyFound = true;
auto key = GpgFrontend::GpgKeyGetter::GetInstance().GetKey(sign->fpr);