From ace33f14d6c7871aeedfed8575bbe15bacec05f2 Mon Sep 17 00:00:00 2001 From: xiaoguang Date: Fri, 12 Apr 2024 15:56:35 +0800 Subject: [PATCH 1/2] test: imKey switch to staging env --- imkey-core/ikc-common/src/constants.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imkey-core/ikc-common/src/constants.rs b/imkey-core/ikc-common/src/constants.rs index c003c6ad..032f704d 100644 --- a/imkey-core/ikc-common/src/constants.rs +++ b/imkey-core/ikc-common/src/constants.rs @@ -1,6 +1,6 @@ pub const VERSION: &str = "2.10.3"; -pub const URL: &str = "https://imkey.online:1000/imkey"; -// pub const URL: &str = "https://imkeyserver.com:10444/imkey"; +// pub const URL: &str = "https://imkey.online:1000/imkey"; +pub const URL: &str = "https://imkeyserver.com:10444/imkey"; pub const TSM_ACTION_SE_SECURE_CHECK: &str = "/seSecureCheck"; pub const TSM_ACTION_APP_DOWNLOAD: &str = "/appDownload"; From 67d4a350b94464cc3ec360295700b394bbbf6769 Mon Sep 17 00:00:00 2001 From: xiaoguang Date: Tue, 7 May 2024 14:29:46 +0800 Subject: [PATCH 2/2] fix: fix binding timeout error --- imkey-core/ikc-device/src/device_binding.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/imkey-core/ikc-device/src/device_binding.rs b/imkey-core/ikc-device/src/device_binding.rs index c06e49f1..affd88f8 100644 --- a/imkey-core/ikc-device/src/device_binding.rs +++ b/imkey-core/ikc-device/src/device_binding.rs @@ -8,12 +8,12 @@ use ikc_common::aes::cbc::encrypt_pkcs7; use ikc_common::apdu::{Apdu, ApduCheck, ImkApdu}; use ikc_common::constants::{ BIND_RESULT_ERROR, BIND_RESULT_SUCCESS, BIND_STATUS_BOUND_OTHER, BIND_STATUS_BOUND_THIS, - BIND_STATUS_UNBOUND, IMK_AID, + BIND_STATUS_UNBOUND, IMK_AID, TIMEOUT_LONG, }; use ikc_common::utility::sha256_hash; #[cfg(any(target_os = "macos", target_os = "windows", target_os = "linux"))] use ikc_transport::hid_api::hid_connect; -use ikc_transport::message::send_apdu; +use ikc_transport::message::{send_apdu, send_apdu_timeout}; use parking_lot::Mutex; use rand::rngs::OsRng; use regex::Regex; @@ -136,7 +136,7 @@ impl DeviceManage { let identity_verify_apdu = ImkApdu::identity_verify(&apdu_data); std::mem::drop(key_manager_obj); //send command to device - let bind_result = send_apdu(identity_verify_apdu)?; + let bind_result = send_apdu_timeout(identity_verify_apdu, TIMEOUT_LONG)?; ApduCheck::check_response(&bind_result)?; let result_code = &bind_result[..bind_result.len() - 4];