Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ description = "Authentication extension and backend for Trussed"

[dependencies]
serde = { version = "1", default-features = false }
serde-byte-array = "0.1.0"
serde-byte-array = "0.1.2"
sha2 = { version = "0.10.6", default-features = false }
subtle = { version = "2.4.1", default-features = false }
trussed = { git = "https://github.com/trussed-dev/trussed", rev = "1c55b3b2dd6a9e1cfc55758635baf0d0bbf387d1", features = ["serde-extensions"] }
Expand Down
6 changes: 3 additions & 3 deletions src/backend/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ impl<'a> PinDataMut<'a> {
return false;
}
let success = hash(self.id, pin, &self.salt)
.as_ref()
.ct_eq(self.hash.as_ref())
.as_slice()
.ct_eq(self.hash.as_slice())
.into();
if let Some(retries) = &mut self.data.retries {
if success {
Expand Down Expand Up @@ -173,7 +173,7 @@ fn hash(id: PinId, pin: &Pin, salt: &Salt) -> Hash {
digest.update([u8::from(id)]);
digest.update([pin_len(pin)]);
digest.update(pin);
digest.update(salt.as_ref());
digest.update(salt);
Hash::new(digest.finalize().into())
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ pub const MAX_PIN_LENGTH: usize = MAX_SHORT_DATA_LENGTH;
/// A PIN.
pub type Pin = Bytes<MAX_PIN_LENGTH>;

const PIN_PATH: &str = "backend/auth/pin";
const PIN_PATH: &str = "backend-auth/pin";

/// The ID of a PIN within the namespace of a client.
///
Expand Down