From 097d6caf63c0e24382e82d4045d6c866f31342a4 Mon Sep 17 00:00:00 2001 From: Matt Witherspoon <32485495+spoonincode@users.noreply.github.com> Date: Mon, 29 Aug 2022 14:00:51 -0400 Subject: [PATCH] remove nonworking Secure Enclave support from signature_provider_plugin --- .../signature_provider_plugin/CMakeLists.txt | 3 -- .../signature_provider_plugin.cpp | 28 ------------------- 2 files changed, 31 deletions(-) diff --git a/plugins/signature_provider_plugin/CMakeLists.txt b/plugins/signature_provider_plugin/CMakeLists.txt index 71447d6b2b..74815f2bfe 100644 --- a/plugins/signature_provider_plugin/CMakeLists.txt +++ b/plugins/signature_provider_plugin/CMakeLists.txt @@ -5,6 +5,3 @@ add_library( signature_provider_plugin target_link_libraries( signature_provider_plugin appbase fc http_client_plugin ) target_include_directories( signature_provider_plugin PUBLIC include ) -if(APPLE) - target_link_libraries( signature_provider_plugin se-helpers ) -endif() diff --git a/plugins/signature_provider_plugin/signature_provider_plugin.cpp b/plugins/signature_provider_plugin/signature_provider_plugin.cpp index 7dfa3dab64..8b279af81f 100644 --- a/plugins/signature_provider_plugin/signature_provider_plugin.cpp +++ b/plugins/signature_provider_plugin/signature_provider_plugin.cpp @@ -6,10 +6,6 @@ #include -#ifdef __APPLE__ -#include -#endif - namespace eosio { static appbase::abstract_plugin& _signature_provider_plugin = app().register_plugin(); @@ -24,23 +20,6 @@ class signature_provider_plugin_impl { }; } -#ifdef __APPLE__ - signature_provider_plugin::signature_provider_type - make_se_signature_provider(const chain::public_key_type pubkey) const { - EOS_ASSERT(secure_enclave::hardware_supports_secure_enclave(), chain::secure_enclave_exception, "Secure Enclave not supported on this hardware"); - EOS_ASSERT(secure_enclave::application_signed(), chain::secure_enclave_exception, "Application is not signed, Secure Enclave use not supported"); - - std::set allkeys = secure_enclave::get_all_keys(); - for(const auto& se_key : secure_enclave::get_all_keys()) - if(se_key.public_key() == pubkey) - return [se_key](const chain::digest_type& digest) { - return se_key.sign(digest); - }; - - EOS_THROW(chain::secure_enclave_exception, "${k} not found in Secure Enclave", ("k", pubkey)); - } -#endif - signature_provider_plugin::signature_provider_type make_keosd_signature_provider(const string& url_str, const chain::public_key_type pubkey) const { fc::url keosd_url; @@ -78,9 +57,6 @@ const char* const signature_provider_plugin::signature_provider_help_text() cons " \tis KEY, KEOSD, or SE\n\n" " KEY: \tis a string form of a valid EOSIO private key which maps to the provided public key\n\n" " KEOSD: \tis the URL where keosd is available and the approptiate wallet(s) are unlocked\n\n" -#ifdef __APPLE__ - " SE: \tindicates the key resides in Secure Enclave" -#endif ; } @@ -110,10 +86,6 @@ signature_provider_plugin::signature_provider_for_specification(const std::strin } else if(spec_type_str == "KEOSD") return std::make_pair(pubkey, my->make_keosd_signature_provider(spec_data, pubkey)); -#ifdef __APPLE__ - else if(spec_type_str == "SE") - return std::make_pair(pubkey, my->make_se_signature_provider(pubkey)); -#endif EOS_THROW(chain::plugin_config_exception, "Unsupported key provider type \"${t}\"", ("t", spec_type_str)); }