diff options
Diffstat (limited to 'src/gpg')
-rw-r--r-- | src/gpg/GpgContext.h | 8 | ||||
-rw-r--r-- | src/gpg/model/GpgData.cpp | 6 |
2 files changed, 6 insertions, 8 deletions
diff --git a/src/gpg/GpgContext.h b/src/gpg/GpgContext.h index 4a9b6fc0..5812f49f 100644 --- a/src/gpg/GpgContext.h +++ b/src/gpg/GpgContext.h @@ -26,7 +26,6 @@ #define __SGPGMEPP_CONTEXT_H__ #include "GpgConstants.h" - #include "GpgFunctionObject.h" #include "GpgInfo.h" #include "GpgModel.h" @@ -39,7 +38,7 @@ namespace GpgFrontend { class GpgContext : public SingletonFunctionObject<GpgContext> { public: explicit GpgContext(bool independent_database = false, - std::string path = std::string(), int channel = 0); + std::string path = std::string(), int channel = 0); ~GpgContext() override = default; @@ -71,8 +70,9 @@ class GpgContext : public SingletonFunctionObject<GpgContext> { int last_was_bad, int fd) { LOG(INFO) << "test_passphrase_cb Called"; size_t res; - char pass[] = "abcdefg\n"; - size_t pass_len = strlen(pass); + std::string pass = "abcdefg\n"; + auto pass_len = pass.size(); + size_t off = 0; (void)opaque; diff --git a/src/gpg/model/GpgData.cpp b/src/gpg/model/GpgData.cpp index 23cdaf2d..c6e9b2ce 100644 --- a/src/gpg/model/GpgData.cpp +++ b/src/gpg/model/GpgData.cpp @@ -52,12 +52,10 @@ GpgFrontend::GpgData::GpgData(void* buffer, size_t size, bool copy) { GpgFrontend::ByteArrayPtr GpgFrontend::GpgData::Read2Buffer() { gpgme_off_t ret = gpgme_data_seek(*this, 0, SEEK_SET); - gpgme_error_t err = gpg_error(GPG_ERR_NO_ERROR); - ByteArrayPtr out_buffer = std::make_unique<std::string>(); if (ret) { - err = gpgme_err_code_from_errno(errno); + gpgme_error_t err = gpgme_err_code_from_errno(errno); assert(gpgme_err_code(err) == GPG_ERR_NO_ERROR); } else { char buf[BUF_SIZE + 2]; @@ -68,7 +66,7 @@ GpgFrontend::ByteArrayPtr GpgFrontend::GpgData::Read2Buffer() { memcpy(out_buffer->data() + size, buf, ret); } if (ret < 0) { - err = gpgme_err_code_from_errno(errno); + gpgme_error_t err = gpgme_err_code_from_errno(errno); assert(gpgme_err_code(err) == GPG_ERR_NO_ERROR); } } |