Skip to content

Commit

Permalink
Merge branch 'feature/trace' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
John-Chan committed Apr 28, 2024
2 parents 40c9b2f + 8f14210 commit fc59ac6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions skf-rs/src/engine/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ impl AppSecurity for SkfAppImpl {
}
}

#[instrument]
#[instrument(skip(pin))]
fn verify_pin(&self, pin_type: u8, pin: &str) -> crate::Result<()> {
let func = self.symbols.pin_verify.as_ref().expect("Symbol not load");
let pin = param::as_cstring("pin", pin)?;
Expand Down Expand Up @@ -147,7 +147,7 @@ impl AppSecurity for SkfAppImpl {
}
}

#[instrument]
#[instrument(skip(admin_pin, new_pin))]
fn unblock_pin(&self, admin_pin: &str, new_pin: &str) -> crate::Result<()> {
let func = self.symbols.pin_unblock.as_ref().expect("Symbol not load");
let admin_pin = param::as_cstring("admin_pin", admin_pin)?;
Expand Down Expand Up @@ -282,7 +282,7 @@ impl FileManager for SkfAppImpl {
Ok(buff)
}

#[instrument]
#[instrument(skip(data))]
fn write_file(&self, name: &str, offset: u32, data: &[u8]) -> crate::Result<()> {
let func = self.symbols.file_write.as_ref().expect("Symbol not load");
let name = param::as_cstring("name", name)?;
Expand Down
8 changes: 4 additions & 4 deletions skf-rs/src/engine/crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl SkfBlockCipher for SkfBlockCipherImpl {
Ok(())
}

#[instrument(skip(key))]
#[instrument(skip(key, data))]
fn encrypt(&self, key: &dyn ManagedKey, data: &[u8], buffer_size: usize) -> Result<Vec<u8>> {
let func = self.symbols.encrypt.as_ref().expect("Symbol not load");
let mut len = buffer_size as ULONG;
Expand All @@ -103,7 +103,7 @@ impl SkfBlockCipher for SkfBlockCipherImpl {
Ok(buffer)
}

#[instrument(skip(key))]
#[instrument(skip(key, data))]
fn encrypt_update(
&self,
key: &dyn ManagedKey,
Expand Down Expand Up @@ -166,7 +166,7 @@ impl SkfBlockCipher for SkfBlockCipherImpl {
Ok(())
}

#[instrument(skip(key))]
#[instrument(skip(key, data))]
fn decrypt(&self, key: &dyn ManagedKey, data: &[u8], buffer_size: usize) -> Result<Vec<u8>> {
let func = self.symbols.decrypt.as_ref().expect("Symbol not load");
let mut len = buffer_size as ULONG;
Expand All @@ -189,7 +189,7 @@ impl SkfBlockCipher for SkfBlockCipherImpl {
Ok(buffer)
}

#[instrument(skip(key))]
#[instrument(skip(key, data))]
fn decrypt_update(
&self,
key: &dyn ManagedKey,
Expand Down
18 changes: 9 additions & 9 deletions skf-rs/src/engine/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl Debug for SkfDeviceImpl {
}

impl DeviceAuth for SkfDeviceImpl {
#[instrument]
#[instrument(skip(data))]
fn device_auth(&self, data: &[u8]) -> Result<()> {
let func = self.symbols.dev_auth.as_ref().expect("Symbol not load");
let ret = unsafe {
Expand All @@ -79,7 +79,7 @@ impl DeviceAuth for SkfDeviceImpl {
Ok(())
}

#[instrument]
#[instrument(skip(key))]
fn change_device_auth_key(&self, key: &[u8]) -> Result<()> {
let func = self
.symbols
Expand Down Expand Up @@ -186,7 +186,7 @@ impl DeviceCrypto for SkfDeviceImpl {
Ok(buffer)
}

#[instrument]
#[instrument(skip(key))]
fn set_symmetric_key(&self, alg_id: u32, key: &[u8]) -> Result<Box<dyn ManagedKey>> {
let func = self
.symbols
Expand All @@ -210,7 +210,7 @@ impl DeviceCrypto for SkfDeviceImpl {
Ok(Box::new(managed_key))
}

#[instrument]
#[instrument(skip(key, data))]
fn ext_ecc_encrypt(&self, key: &ECCPublicKeyBlob, data: &[u8]) -> Result<ECCEncryptedData> {
let func = self
.symbols
Expand Down Expand Up @@ -251,7 +251,7 @@ impl DeviceCrypto for SkfDeviceImpl {
Ok(blob)
}

#[instrument]
#[instrument(skip(key, cipher))]
fn ext_ecc_decrypt(
&self,
key: &ECCPrivateKeyBlob,
Expand Down Expand Up @@ -286,7 +286,7 @@ impl DeviceCrypto for SkfDeviceImpl {
Ok(buff)
}

#[instrument]
#[instrument(skip(key, data))]
fn ext_ecc_sign(&self, key: &ECCPrivateKeyBlob, data: &[u8]) -> Result<ECCSignatureBlob> {
let func = self.symbols.ecc_ext_sign.as_ref().expect("Symbol not load");

Expand All @@ -308,7 +308,7 @@ impl DeviceCrypto for SkfDeviceImpl {
Ok(sign)
}

#[instrument]
#[instrument(skip(key, data, signature))]
fn ext_ecc_verify(
&self,
key: &ECCPublicKeyBlob,
Expand Down Expand Up @@ -337,7 +337,7 @@ impl DeviceCrypto for SkfDeviceImpl {
Ok(())
}

#[instrument]
#[instrument(skip(key, hash, signature))]
fn ecc_verify(
&self,
key: &ECCPublicKeyBlob,
Expand All @@ -362,7 +362,7 @@ impl DeviceCrypto for SkfDeviceImpl {
Ok(())
}

#[instrument(skip(agreement_key))]
#[instrument(skip(agreement_key, responder_key, responder_tmp_key, responder_id))]
fn ecc_gen_session_key(
&self,
agreement_key: &dyn ManagedKey,
Expand Down

0 comments on commit fc59ac6

Please sign in to comment.