From b6e761fffcc69b6b905d81b6e43054ed471088da Mon Sep 17 00:00:00 2001 From: Mudit Vats Date: Wed, 31 Mar 2021 11:26:27 -0700 Subject: [PATCH] feat: use mocked values for now --- commands.cpp | 7 +++++++ main.cpp | 6 +++--- shbc.cpp | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/commands.cpp b/commands.cpp index da7fa9e..6958648 100644 --- a/commands.cpp +++ b/commands.cpp @@ -32,6 +32,9 @@ bool cmd_is_admin() bool cmd_get_version(std::string& version) { + version = "14.0.0"; // FIXME: REMOVE WHEN HW AVAILABLE + return true; // FIXME: REMOVE WHEN HW AVAILABLE + version.clear(); // initialize HECI interface @@ -413,6 +416,10 @@ bool cmd_get_lan_interface_settings(lan_interface_settings& lan_interface_settin bool cmd_start_config_host_based(config_host_based_settings& server_cert, config_host_based_settings& amt_cert) { + amt_cert.algorithm = "MD5"; // FIXME: REMOVE WHEN HW AVAILABLE + amt_cert.hash = "000102030405060708090a0b0c0d0e0f"; // FIXME: REMOVE WHEN HW AVAILABLE + return true; // FIXME: REMOVE WHEN HW AVAILABLE + // initialize HECI interface if (heci_Init(NULL, PTHI_CLIENT) == 0) return false; diff --git a/main.cpp b/main.cpp index 484c124..360e4b3 100644 --- a/main.cpp +++ b/main.cpp @@ -248,7 +248,7 @@ int main(int argc, char* argv[]) return; } - if (msgMethod.compare("request_secure_config") == 0) + if (msgMethod.compare("secure_config_request") == 0) { std::string certAlgo; std::string certHash; @@ -260,10 +260,10 @@ int main(int argc, char* argv[]) web::json::value parsed_cert_info = web::json::value::parse(tmp); out = parsed_cert_info[U("algorithm")].as_string(); - std::string certAlgo = utility::conversions::to_utf8string(out); + certAlgo = utility::conversions::to_utf8string(out); out = parsed_cert_info[U("hash")].as_string(); - std::string certHash = utility::conversions::to_utf8string(out); + certHash = utility::conversions::to_utf8string(out); } catch (...) { diff --git a/shbc.cpp b/shbc.cpp index cffed60..3c0d273 100644 --- a/shbc.cpp +++ b/shbc.cpp @@ -37,7 +37,7 @@ bool shbc_create_response(std::string cert_algo, std::string cert_hash, std::str { web::json::value msg; - utility::string_t tmp = utility::conversions::convertstring("response_secure_config"); + utility::string_t tmp = utility::conversions::convertstring("secure_config_response"); msg[U("method")] = web::json::value::string(tmp); tmp = utility::conversions::convertstring("");