From b5cd5eac82b6bbd8a00fb39c045d473d6517b5f4 Mon Sep 17 00:00:00 2001 From: Saturneric Date: Sat, 25 Dec 2021 09:54:57 +0800 Subject: (core, test): core improved and test gpg alone mode 1. let modules known their channels. 2. let factory create a channel. 3. reduce dumplicate code. 4. add type check for function object. 5. test gpg alone mode. 6. remove some asserts. 7. rename importexportor to importexporter. 8. move args in gpg context constructor to a struct. --- src/gpg/function/GpgKeyGetter.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/gpg/function/GpgKeyGetter.cpp') diff --git a/src/gpg/function/GpgKeyGetter.cpp b/src/gpg/function/GpgKeyGetter.cpp index 664aff56..3457a8a7 100644 --- a/src/gpg/function/GpgKeyGetter.cpp +++ b/src/gpg/function/GpgKeyGetter.cpp @@ -65,6 +65,8 @@ GpgFrontend::KeyLinkListPtr GpgFrontend::GpgKeyGetter::FetchKey() { err = gpgme_op_keylist_end(ctx); + assert(check_gpg_error_2_err_code(err, GPG_ERR_EOF) == GPG_ERR_NO_ERROR); + return keys_list; } -- cgit v1.2.3 From 9a4fa7019dde788dd337f406dc2d52e4c94b696c Mon Sep 17 00:00:00 2001 From: Saturneric Date: Tue, 4 Jan 2022 02:33:35 +0800 Subject: (core, ui): add key in smart card support. 1.fix problem that when key is in a smart card, the result of FetchKey() is not equal with which provided by GetKey(). --- src/gpg/function/GpgKeyGetter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/gpg/function/GpgKeyGetter.cpp') diff --git a/src/gpg/function/GpgKeyGetter.cpp b/src/gpg/function/GpgKeyGetter.cpp index 3457a8a7..248e5630 100644 --- a/src/gpg/function/GpgKeyGetter.cpp +++ b/src/gpg/function/GpgKeyGetter.cpp @@ -58,7 +58,8 @@ GpgFrontend::KeyLinkListPtr GpgFrontend::GpgKeyGetter::FetchKey() { gpgme_key_t key; while ((err = gpgme_op_keylist_next(ctx, &key)) == GPG_ERR_NO_ERROR) { - keys_list->push_back(GpgKey(std::move(key))); + keys_list->push_back(GetKey(key->fpr)); + auto& _key = keys_list->back(); } assert(check_gpg_error_2_err_code(err, GPG_ERR_EOF) == GPG_ERR_EOF); -- cgit v1.2.3 From 5cc72a35de7128ed586830eb90f705fc3ee3cbbf Mon Sep 17 00:00:00 2001 From: Saturneric Date: Tue, 4 Jan 2022 04:24:01 +0800 Subject: (core, ui): key package import. 1. use gpgme_op_export_keys as multiply keys export. 2. improve ui. 3. write key package import done. --- src/gpg/function/GpgKeyGetter.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/gpg/function/GpgKeyGetter.cpp') diff --git a/src/gpg/function/GpgKeyGetter.cpp b/src/gpg/function/GpgKeyGetter.cpp index 248e5630..8a26dcd9 100644 --- a/src/gpg/function/GpgKeyGetter.cpp +++ b/src/gpg/function/GpgKeyGetter.cpp @@ -59,7 +59,6 @@ GpgFrontend::KeyLinkListPtr GpgFrontend::GpgKeyGetter::FetchKey() { gpgme_key_t key; while ((err = gpgme_op_keylist_next(ctx, &key)) == GPG_ERR_NO_ERROR) { keys_list->push_back(GetKey(key->fpr)); - auto& _key = keys_list->back(); } assert(check_gpg_error_2_err_code(err, GPG_ERR_EOF) == GPG_ERR_EOF); -- cgit v1.2.3