Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cms/src/builder/kari.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,8 @@ where

#[cfg(test)]
mod tests {
extern crate std;

use std::eprintln;

use super::*;
Expand Down
8 changes: 4 additions & 4 deletions cms/src/enveloped_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use crate::content_info::CmsVersion;
use crate::revocation::RevocationInfoChoices;
use crate::signed_data::CertificateSet;

use alloc::vec;
use core::cmp::Ordering;
use der::asn1::{BitString, GeneralizedTime, ObjectIdentifier, OctetString, SetOfVec};
use der::{Any, Choice, Sequence, ValueOrd};
Expand Down Expand Up @@ -88,11 +89,10 @@ pub struct OriginatorInfo {
pub struct RecipientInfos(pub SetOfVec<RecipientInfo>);
impl_newtype!(RecipientInfos, SetOfVec<RecipientInfo>);

#[cfg(feature = "std")]
impl TryFrom<std::vec::Vec<RecipientInfo>> for RecipientInfos {
impl TryFrom<vec::Vec<RecipientInfo>> for RecipientInfos {
type Error = der::Error;

fn try_from(vec: std::vec::Vec<RecipientInfo>) -> der::Result<RecipientInfos> {
fn try_from(vec: vec::Vec<RecipientInfo>) -> der::Result<RecipientInfos> {
Ok(RecipientInfos(SetOfVec::try_from(vec)?))
}
}
Expand Down Expand Up @@ -268,7 +268,7 @@ pub struct OriginatorPublicKey {
/// ```
///
/// [RFC 5652 Section 6.2.2]: https://www.rfc-editor.org/rfc/rfc5652#section-6.2.2
pub type RecipientEncryptedKeys = alloc::vec::Vec<RecipientEncryptedKey>;
pub type RecipientEncryptedKeys = vec::Vec<RecipientEncryptedKey>;

/// The `RecipientEncryptedKey` type is defined in [RFC 5652 Section 6.2.2].
///
Expand Down
3 changes: 0 additions & 3 deletions cms/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@

extern crate alloc;

#[cfg(feature = "std")]
extern crate std;

pub mod attr;
pub mod authenticated_data;
pub mod authenveloped_data;
Expand Down
6 changes: 3 additions & 3 deletions cms/src/revocation.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! Revocation-related types
use alloc::vec;
use core::cmp::Ordering;

use der::asn1::SetOfVec;
Expand Down Expand Up @@ -47,11 +48,10 @@ impl ValueOrd for RevocationInfoChoice {
}
}

#[cfg(feature = "std")]
impl TryFrom<std::vec::Vec<RevocationInfoChoice>> for RevocationInfoChoices {
impl TryFrom<vec::Vec<RevocationInfoChoice>> for RevocationInfoChoices {
type Error = der::Error;

fn try_from(vec: std::vec::Vec<RevocationInfoChoice>) -> der::Result<RevocationInfoChoices> {
fn try_from(vec: vec::Vec<RevocationInfoChoice>) -> der::Result<RevocationInfoChoices> {
Ok(RevocationInfoChoices(SetOfVec::try_from(vec)?))
}
}
Expand Down
11 changes: 5 additions & 6 deletions cms/src/signed_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use crate::cert::{CertificateChoices, IssuerAndSerialNumber};
use crate::content_info::CmsVersion;
use crate::revocation::RevocationInfoChoices;

use alloc::vec;
use core::cmp::Ordering;
use der::asn1::{ObjectIdentifier, OctetString, SetOfVec};
use der::{Any, Choice, DerOrd, Sequence, ValueOrd};
Expand Down Expand Up @@ -59,11 +60,10 @@ pub type DigestAlgorithmIdentifiers = SetOfVec<AlgorithmIdentifierOwned>;
pub struct CertificateSet(pub SetOfVec<CertificateChoices>);
impl_newtype!(CertificateSet, SetOfVec<CertificateChoices>);

#[cfg(feature = "std")]
impl TryFrom<std::vec::Vec<CertificateChoices>> for CertificateSet {
impl TryFrom<vec::Vec<CertificateChoices>> for CertificateSet {
type Error = der::Error;

fn try_from(vec: std::vec::Vec<CertificateChoices>) -> der::Result<CertificateSet> {
fn try_from(vec: vec::Vec<CertificateChoices>) -> der::Result<CertificateSet> {
Ok(CertificateSet(SetOfVec::try_from(vec)?))
}
}
Expand All @@ -79,11 +79,10 @@ impl TryFrom<std::vec::Vec<CertificateChoices>> for CertificateSet {
pub struct SignerInfos(pub SetOfVec<SignerInfo>);
impl_newtype!(SignerInfos, SetOfVec<SignerInfo>);

#[cfg(feature = "std")]
impl TryFrom<std::vec::Vec<SignerInfo>> for SignerInfos {
impl TryFrom<vec::Vec<SignerInfo>> for SignerInfos {
type Error = der::Error;

fn try_from(vec: std::vec::Vec<SignerInfo>) -> der::Result<SignerInfos> {
fn try_from(vec: vec::Vec<SignerInfo>) -> der::Result<SignerInfos> {
Ok(SignerInfos(SetOfVec::try_from(vec)?))
}
}
Expand Down