From f56f075135c98eedc06cd7e53d5a2b4a3fd8f5b0 Mon Sep 17 00:00:00 2001 From: Bernd Krietenstein Date: Tue, 19 Dec 2023 16:13:57 +0100 Subject: [PATCH] Fixed invalid encoding of rsaEncryption AlgorithmIdentifier --- cms/src/builder.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cms/src/builder.rs b/cms/src/builder.rs index 6ba7b99c5..6fe1f0fcf 100644 --- a/cms/src/builder.rs +++ b/cms/src/builder.rs @@ -26,7 +26,7 @@ use cipher::{Key, KeyIvInit, KeySizeUser}; use const_oid::ObjectIdentifier; use core::cmp::Ordering; use core::fmt; -use der::asn1::{BitString, OctetString, OctetStringRef, SetOfVec}; +use der::asn1::{BitString, Null, OctetString, OctetStringRef, SetOfVec}; use der::oid::db::DB; use der::{Any, AnyRef, DateTime, Decode, Encode, ErrorKind, Tag}; use digest::Digest; @@ -599,7 +599,7 @@ where .map_err(|_| Error::Builder(String::from("Could not encrypt key")))?, AlgorithmIdentifierOwned { oid: const_oid::db::rfc5912::RSA_ENCRYPTION, - parameters: None, + parameters: Some(Any::from(Null)), }, ), };