Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove nonworking Secure Enclave support from signature_provider_plugin #65

Merged
merged 1 commit into from
Aug 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions plugins/signature_provider_plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
28 changes: 0 additions & 28 deletions plugins/signature_provider_plugin/signature_provider_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@

#include <boost/algorithm/string.hpp>

#ifdef __APPLE__
#include <eosio/se-helpers/se-helpers.hpp>
#endif

namespace eosio {
static appbase::abstract_plugin& _signature_provider_plugin = app().register_plugin<signature_provider_plugin>();

Expand All @@ -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<secure_enclave::secure_enclave_key> 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;
Expand Down Expand Up @@ -78,9 +57,6 @@ const char* const signature_provider_plugin::signature_provider_help_text() cons
" <provider-type> \tis KEY, KEOSD, or SE\n\n"
" KEY:<data> \tis a string form of a valid EOSIO private key which maps to the provided public key\n\n"
" KEOSD:<data> \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
;

}
Expand Down Expand Up @@ -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));
}

Expand Down