aboutsummaryrefslogtreecommitdiffstats
path: root/src/gpg/function/GpgFileOpera.cpp
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2021-11-29 04:43:00 +0000
committerSaturneric <[email protected]>2021-11-29 04:47:06 +0000
commit839878e0a2c5dff8ed9d9422aaeebeee0e5ba964 (patch)
tree2b93ba3943053871ba39fd1b80966521bd77b4e8 /src/gpg/function/GpgFileOpera.cpp
parentFix Known Bugs. (diff)
downloadGpgFrontend-839878e0a2c5dff8ed9d9422aaeebeee0e5ba964.tar.gz
GpgFrontend-839878e0a2c5dff8ed9d9422aaeebeee0e5ba964.zip
Solve uid management, related update and other known issues.
Diffstat (limited to 'src/gpg/function/GpgFileOpera.cpp')
-rw-r--r--src/gpg/function/GpgFileOpera.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/gpg/function/GpgFileOpera.cpp b/src/gpg/function/GpgFileOpera.cpp
index b8e204b8..ae912ada 100644
--- a/src/gpg/function/GpgFileOpera.cpp
+++ b/src/gpg/function/GpgFileOpera.cpp
@@ -53,7 +53,7 @@ GpgFrontend::GpgError GpgFrontend::GpgFileOpera::DecryptFile(
assert(check_gpg_error_2_err_code(err) == GPG_ERR_NO_ERROR);
- std::string out_file_name = get_file_name_with_path(path),
+ std::string out_file_name = get_only_file_name_with_path(path),
file_extension = get_file_extension(path);
if (!(file_extension == ".asc" || file_extension == ".gpg"))
@@ -131,20 +131,27 @@ gpg_error_t GpgFrontend::GpgFileOpera::EncryptSignFile(
gpg_error_t GpgFrontend::GpgFileOpera::DecryptVerifyFile(
const std::string& path, GpgDecrResult& decr_res,
GpgVerifyResult& verify_res) {
+ LOG(INFO) << "GpgFrontend::GpgFileOpera::DecryptVerifyFile Called";
+
auto in_buffer = read_all_data_in_file(path);
+
+ LOG(INFO) << "GpgFrontend::GpgFileOpera::DecryptVerifyFile in_buffer"
+ << in_buffer.size();
std::unique_ptr<std::string> out_buffer = nullptr;
auto err = BasicOperator::GetInstance().DecryptVerify(in_buffer, out_buffer,
decr_res, verify_res);
- assert(check_gpg_error_2_err_code(err) == GPG_ERR_NO_ERROR);
- std::string out_file_name = get_file_name_with_path(path),
+ std::string out_file_name = get_only_file_name_with_path(path),
file_extension = get_file_extension(path);
if (!(file_extension == ".asc" || file_extension == ".gpg"))
out_file_name = path + ".out";
-
- write_buffer_to_file(out_file_name, *out_buffer);
+ LOG(INFO) << "GpgFrontend::GpgFileOpera::DecryptVerifyFile out_file_name"
+ << out_file_name;
+ if (!write_buffer_to_file(out_file_name, *out_buffer)) {
+ throw std::runtime_error("write_buffer_to_file error");
+ };
return err;
}