feat: v1.9.2, fix compile issue
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -1880,7 +1880,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tiny-encrypt"
|
||||
version = "1.9.1"
|
||||
version = "1.9.2"
|
||||
dependencies = [
|
||||
"aes-gcm-stream",
|
||||
"base64 0.22.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tiny-encrypt"
|
||||
version = "1.9.1"
|
||||
version = "1.9.2"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
description = "A simple and tiny file encrypt tool"
|
||||
|
||||
5
justfile
5
justfile
@@ -1,6 +1,10 @@
|
||||
_:
|
||||
@just --list
|
||||
|
||||
# publish
|
||||
publish:
|
||||
cargo publish --registry crates-io
|
||||
|
||||
# Install local
|
||||
install:
|
||||
cargo install --path .
|
||||
@@ -27,5 +31,4 @@ try-build-all:
|
||||
cargo build --no-default-features --features smartcard
|
||||
cargo build --no-default-features --features decrypt
|
||||
cargo build --no-default-features --features macos
|
||||
cargo build --no-default-features --features secure-enclave
|
||||
cargo build
|
||||
|
||||
@@ -569,12 +569,19 @@ fn try_decrypt_se_key_ecdh(config: &Option<TinyEncryptConfig>,
|
||||
return simple_error!("Not enough arguments for: {}", &envelop.kid);
|
||||
}
|
||||
|
||||
#[cfg(feature = "macos")]
|
||||
let private_key_base64 = if let Ok(keychain_key) = KeychainKey::parse(&config_envelop_args[0]) {
|
||||
let key = opt_value_result!(keychain_key.get_password()?, "Key: {} not found", &keychain_key.to_str());
|
||||
opt_result!(String::from_utf8(key), "Parse key failed: {}")
|
||||
} else {
|
||||
config_envelop_args[0].clone()
|
||||
};
|
||||
#[cfg(not(feature = "macos"))]
|
||||
let private_key_base64 = if config_envelop_args[0].starts_with("keychain:") {
|
||||
return simple_error!("Require macos feature: {}", &config_envelop_args[0]);
|
||||
} else {
|
||||
config_envelop_args[0].clone()
|
||||
};
|
||||
|
||||
let shared_secret = opt_result!(util_keychainkey::decrypt_data(
|
||||
&private_key_base64,
|
||||
|
||||
Reference in New Issue
Block a user