File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -254,8 +254,17 @@ impl Builder for SignerInfoBuilder<'_> {
254254 attr. oid . cmp ( & const_oid:: db:: rfc5911:: ID_CONTENT_TYPE ) == Ordering :: Equal
255255 } ) ;
256256 if let Some ( signed_attributes_content_type) = signed_attributes_content_type {
257+ if signed_attributes_content_type. values . len ( ) != 1 {
258+ return Err ( der:: Error :: from ( ErrorKind :: Failed ) . into ( ) ) ;
259+ }
260+ let Some ( value) = signed_attributes_content_type. values . get ( 0 ) else {
261+ return Err ( der:: Error :: from ( ErrorKind :: Failed ) . into ( ) ) ;
262+ } ;
263+
264+ let value = value. decode_as :: < ObjectIdentifier > ( ) ?;
265+
257266 // Check against `eContentType`
258- if signed_attributes_content_type . oid != econtent_type {
267+ if value != econtent_type {
259268 // Mismatch between content types: encapsulated content info <-> signed attributes.
260269 return Err ( der:: Error :: from ( ErrorKind :: Failed ) . into ( ) ) ;
261270 }
You can’t perform that action at this time.
0 commit comments