Skip to content

pkcs5: add belt-kwp support, tweak iv parsing in pbes2 - #2408

Draft
makavity wants to merge 2 commits into
RustCrypto:masterfrom
makavity:master
Draft

pkcs5: add belt-kwp support, tweak iv parsing in pbes2#2408
makavity wants to merge 2 commits into
RustCrypto:masterfrom
makavity:master

Conversation

@makavity

Copy link
Copy Markdown
Contributor

Need RustCrypto/key-wraps#98 to be merged, before this can be merged

@baloo
baloo marked this pull request as draft August 24, 2026 22:57
Comment thread pkcs5/src/pbes2.rs
Comment on lines +544 to +554
/// Decode an IV/nonce of exactly `N` bytes from an `AlgorithmIdentifier`'s
/// OCTET STRING parameters.
fn decode_iv<const N: usize>(params: Option<AnyRef<'_>>) -> der::Result<[u8; N]> {
params
.ok_or_else(|| Tag::OctetString.value_error())?
.decode_as::<&OctetStringRef>()?
.as_bytes()
.try_into()
.map_err(|_| Tag::OctetString.value_error().into())
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, @tarcieri!
What do you think about that approach?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I should separate it into another PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant