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

fix: fix ios17 ble error #46

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 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
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.6.5
2.6.6
8 changes: 7 additions & 1 deletion imkey-core/ikc-common/src/apdu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ impl BtcApdu {

pub fn btc_sign(index: u8, hash_type: u8, path: &str) -> String {
let path_bytes = path.as_bytes();
if path_bytes.len() as u32 > LC_MAX {
panic!("data to long");
}
let mut apdu =
ApduHeader::new(0x80, 0x42, index, hash_type, path_bytes.len() as u8).to_array();
apdu.extend(path_bytes.iter());
Expand Down Expand Up @@ -364,6 +367,9 @@ impl BtcForkApdu {

pub fn btc_fork_sign(ins: u8, index: u8, hash_type: u8, path: &str) -> String {
let path_bytes = path.as_bytes();
if path_bytes.len() as u32 > LC_MAX {
panic!("data to long");
}
let mut apdu =
ApduHeader::new(0x80, ins, index, hash_type, path_bytes.len() as u8).to_array();
apdu.extend(path_bytes.iter());
Expand Down Expand Up @@ -442,7 +448,7 @@ impl Apdu {
(data.len() as u32 - LC_MAX as u32 * (size - 1 as u32)) as u8,
)
} else {
(0x00, 0xF5)
(0x00, 0xE5)
};
let apdu_header = ApduHeader::new(0x80, ins, p1, p2, lc);
apdu.extend(apdu_header.to_array().iter());
Expand Down
2 changes: 1 addition & 1 deletion imkey-core/ikc-common/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub const TSM_ACTION_COS_UPGRADE: &str = "/seCosUpdate";
pub const TSM_ACTION_COS_CHECK_UPDATE: &str = "/cosCheckUpdate";

//apud related constant
pub const LC_MAX: u32 = 245;
pub const LC_MAX: u32 = 229;

pub const ETH_AID: &str = "695F657468";
pub const EOS_AID: &str = "695F656F73";
Expand Down
Loading