Skip to content

Commit

Permalink
Merge pull request openwsn-berkeley#271 from chrysn-pull-requests/acc…
Browse files Browse the repository at this point in the history
…ept-cwt-by-value

r_parse_message_3: Tolerate unparsable credential-by-value
  • Loading branch information
geonnave authored May 16, 2024
2 parents 9abbef4 + d25f38f commit 40f7cd7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/src/edhoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,17 @@ pub fn r_parse_message_3(
let Ok(buffer) = EdhocMessageBuffer::new_from_slice(cred) else {
return Err(EDHOCError::ParsingError);
};
CredentialRPK::new(buffer)?
if let Ok(parsed_rpk) = CredentialRPK::new(buffer) {
parsed_rpk
} else {
// This is incomplete, and the application will need to fill in the gaps --
// just as in the CompactKid case the CredentialRPK is also incomplete.
CredentialRPK {
value: buffer,
public_key: Default::default(),
kid: Default::default(),
}
}
}
};

Expand Down

0 comments on commit 40f7cd7

Please sign in to comment.