Skip to content

Commit

Permalink
fix(shared): Don't accept inconsistent encoding lengths in IdCred KIDs
Browse files Browse the repository at this point in the history
  • Loading branch information
chrysn committed Nov 25, 2024
1 parent 516eee9 commit 978f8e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion shared/src/cred.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ impl IdCred {
.map_err(|_| EDHOCError::CredentialTooLongError)? // TODO: how to avoid map_err overuse?
}
// kid that has been encoded as CBOR byte string
&[0x41, x, ..] if !Self::bstr_representable_as_int(x) => {
&[0x41, x] if !Self::bstr_representable_as_int(x) => {
let mut bytes = BufferIdCred::new_from_slice(&[0xa1, KID_LABEL])
.map_err(|_| EDHOCError::CredentialTooLongError)?;
bytes
Expand Down

0 comments on commit 978f8e1

Please sign in to comment.