File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ use std::{
66 sync:: Arc ,
77} ;
88
9- use coset:: CborSerializable ;
9+ use coset:: { CborSerializable , TaggedCborSerializable } ;
1010
1111/// Catalyst Signed Document Content Encoding Key.
1212const CONTENT_ENCODING_KEY : & str = "content encoding" ;
@@ -128,7 +128,9 @@ impl TryFrom<Vec<u8>> for CatalystSignedDocument {
128128 type Error = anyhow:: Error ;
129129
130130 fn try_from ( cose_bytes : Vec < u8 > ) -> Result < Self , Self :: Error > {
131- let cose = coset:: CoseSign :: from_slice ( & cose_bytes)
131+ // Try reading as a tagged COSE SIGN, otherwise try reading as untagged.
132+ let cose = coset:: CoseSign :: from_tagged_slice ( & cose_bytes)
133+ . or ( coset:: CoseSign :: from_slice ( & cose_bytes) )
132134 . map_err ( |e| anyhow:: anyhow!( "Invalid COSE Sign document: {e}" ) ) ?;
133135
134136 let ( metadata, content_errors) = metadata_from_cose_protected_header ( & cose) ;
You can’t perform that action at this time.
0 commit comments