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<'_> {
254
254
attr. oid . cmp ( & const_oid:: db:: rfc5911:: ID_CONTENT_TYPE ) == Ordering :: Equal
255
255
} ) ;
256
256
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
+
257
266
// Check against `eContentType`
258
- if signed_attributes_content_type . oid != econtent_type {
267
+ if value != econtent_type {
259
268
// Mismatch between content types: encapsulated content info <-> signed attributes.
260
269
return Err ( der:: Error :: from ( ErrorKind :: Failed ) . into ( ) ) ;
261
270
}
You can’t perform that action at this time.
0 commit comments