Skip to content

Commit

Permalink
fix: fix binding timeout error
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoguang1010 committed May 7, 2024
1 parent ace33f1 commit 67d4a35
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions imkey-core/ikc-device/src/device_binding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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];

Expand Down

0 comments on commit 67d4a35

Please sign in to comment.