aboutsummaryrefslogtreecommitdiffstats
path: root/src/gpg/function/GpgKeyOpera.cpp
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2021-12-02 22:30:34 +0000
committerSaturneric <[email protected]>2021-12-02 22:30:34 +0000
commit1a8626dfb31df145f32ad5ceaa480fbd2a0a42bf (patch)
tree73ff7ce9492c2da3e049b82a4c63908f82d6be20 /src/gpg/function/GpgKeyOpera.cpp
parentFixed. (diff)
downloadGpgFrontend-1a8626dfb31df145f32ad5ceaa480fbd2a0a42bf.tar.gz
GpgFrontend-1a8626dfb31df145f32ad5ceaa480fbd2a0a42bf.zip
Fixed
1. Fixed Known Issues.
Diffstat (limited to '')
-rw-r--r--src/gpg/function/GpgKeyOpera.cpp36
1 files changed, 29 insertions, 7 deletions
diff --git a/src/gpg/function/GpgKeyOpera.cpp b/src/gpg/function/GpgKeyOpera.cpp
index 2406cbb9..a7371904 100644
--- a/src/gpg/function/GpgKeyOpera.cpp
+++ b/src/gpg/function/GpgKeyOpera.cpp
@@ -93,21 +93,43 @@ GpgFrontend::GpgError GpgFrontend::GpgKeyOpera::SetExpire(
*/
void GpgFrontend::GpgKeyOpera::GenerateRevokeCert(
const GpgKey& key, const std::string& output_file_name) {
- auto args = std::vector<std::string>{"--command-fd", "0",
- "--status-fd", "1",
- "-o", output_file_name.c_str(),
- "--gen-revoke", key.fpr().c_str()};
+ auto args = std::vector<std::string>{
+ "--no-tty", "--command-fd", "0", "--status-fd", "1", "-o",
+ output_file_name, "--gen-revoke", key.fpr()};
+ using boost::asio::async_write;
using boost::process::async_pipe;
GpgCommandExecutor::GetInstance().Execute(
args, [](async_pipe& in, async_pipe& out) -> void {
boost::asio::streambuf buff;
boost::asio::read_until(in, buff, '\n');
- std::string line;
std::istream is(&buff);
- is >> line;
- // Code From Gpg4Win
+
+ while (!is.eof()) {
+ std::string line;
+ is >> line;
+ LOG(INFO) << "line" << line;
+ boost::algorithm::trim(line);
+ if (line == std::string("[GNUPG:] GET_BOOL gen_revoke.okay")) {
+
+ } else if (line ==
+ std::string(
+ "[GNUPG:] GET_LINE ask_revocation_reason.code")) {
+
+ } else if (line ==
+ std::string(
+ "[GNUPG:] GET_LINE ask_revocation_reason.text")) {
+
+ } else if (line ==
+ std::string("[GNUPG:] GET_BOOL openfile.overwrite.okay")) {
+
+ } else if (line ==
+ std::string(
+ "[GNUPG:] GET_BOOL ask_revocation_reason.okay")) {
+
+ }
+ }
});
}