Skip to content

der: fix impl EncodeValue for &SequenceRef#2369

Open
dishmaker wants to merge 1 commit into
RustCrypto:masterfrom
dishmaker:dishmaker/der_fix_sequenceref_encodevalue
Open

der: fix impl EncodeValue for &SequenceRef#2369
dishmaker wants to merge 1 commit into
RustCrypto:masterfrom
dishmaker:dishmaker/der_fix_sequenceref_encodevalue

Conversation

@dishmaker

Copy link
Copy Markdown
Contributor

Fixes &SequenceRef to match &OctetStringRef:

impl EncodeValue for &OctetStringRef {

Adds test for SequenceRef from:

der: test: fix cfg feature oid in derive_no_alloc.rs

der: use `Encode::encode_to_slice` in derive_no_alloc.rs
@dishmaker dishmaker force-pushed the dishmaker/der_fix_sequenceref_encodevalue branch from 9cd32af to 01be48a Compare July 10, 2026 09:27
@baloo

baloo commented Jul 10, 2026

Copy link
Copy Markdown
Member

I'm not sure about this, that feels like a bug in the der_derive to me.

@dishmaker

Copy link
Copy Markdown
Contributor Author

Even the constructor returns &Self:

pub fn new(slice: &[u8]) -> Result<&Self> {

pub fn new(slice: &[u8]) -> Result<&Self, Error> {

@tarcieri

Copy link
Copy Markdown
Member

Yeah, due to the blanket impls the ergonomics of reference types leave a bit to be desired.

That's a wart we can potentially smooth over in the next breaking release, possibly adding blanket impls for e.g. Borrow rather than concrete types to abstract over the discrepancy.

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.

3 participants