From 539d931f66399c14baeafd199e2baf7123ca0c2d Mon Sep 17 00:00:00 2001 From: Luca Saiu Date: Thu, 13 Apr 2023 12:32:56 +0200 Subject: [PATCH] improve import_key: this change set had been apparently lost --- src/pEp/_pEp/basic_api.cc | 28 +--------------------------- src/pEp/_pEp/basic_api.hh | 4 +--- src/pEp/_pEp/pEpmodule.cc | 8 +------- 3 files changed, 3 insertions(+), 37 deletions(-) diff --git a/src/pEp/_pEp/basic_api.cc b/src/pEp/_pEp/basic_api.cc index c738d8f..d40d3af 100644 --- a/src/pEp/_pEp/basic_api.cc +++ b/src/pEp/_pEp/basic_api.cc @@ -110,33 +110,7 @@ namespace pEp { _throw_status(status); } - boost::python::list import_key(string key_data) - { - ::identity_list *private_keys = NULL; - PEP_STATUS status = ::import_key( - Adapter::session(), - key_data.c_str(), - key_data.size(), - &private_keys); - if (status && status != PEP_KEY_IMPORTED) - _throw_status(status); - - auto result = boost::python::list(); - for (::identity_list *il = private_keys; il && il->ident; il = il->next) { - ::pEp_identity *ident = ::identity_dup(il->ident); - if (!ident) { - free_identity_list(private_keys); - throw std::bad_alloc(); - } - result.append(Identity(ident)); - } - - free_identity_list(private_keys); - return result; - } - - - boost::python::tuple import_key_with_fpr_return(string key_data) + boost::python::tuple import_key(string key_data) { ::identity_list *private_keys = NULL; ::stringlist_t *imported_keys = NULL; diff --git a/src/pEp/_pEp/basic_api.hh b/src/pEp/_pEp/basic_api.hh index 579c007..1518cb4 100644 --- a/src/pEp/_pEp/basic_api.hh +++ b/src/pEp/_pEp/basic_api.hh @@ -23,9 +23,7 @@ namespace pEp { void key_reset_trust(Identity ident); - boost::python::list import_key(string key_data); - - boost::python::tuple import_key_with_fpr_return(string key_data); + boost::python::tuple import_key(string key_data); string export_key(Identity ident); diff --git a/src/pEp/_pEp/pEpmodule.cc b/src/pEp/_pEp/pEpmodule.cc index 53bbb5d..13f0d6a 100644 --- a/src/pEp/_pEp/pEpmodule.cc +++ b/src/pEp/_pEp/pEpmodule.cc @@ -650,13 +650,7 @@ namespace pEp { def("import_key", &import_key, - "private_key_list = import_key(key_data)\n" - "\n" - "import key(s) from key_data\n"); - - def("import_key_with_fpr_return", - &import_key_with_fpr_return, - "imported_keys, affected_own_identities = import_key_with_fpr_return(key_data)\n" + "imported_keys, affected_own_identities = import_key(key_data)\n" "\n" "import key(s) from key_data\n");