librasn / rasn

A Safe #[no_std] ASN.1 Codec Framework
Other
183 stars 43 forks source link

OER: correctly encode null in option in extensions #277

Closed Nicceboy closed 1 week ago

Nicceboy commented 1 week ago

A bit corner case, but fixes encoding of null value in optional extended type.

I hope that I understood the use of () correctly.

The test should represent

Omitted ::= SEQUENCE { 
  a OctetString OPTIONAL,
  ...,
  omitted     NULL OPTIONAL
}
XAMPPRocky commented 1 week ago

Thank you for your PR!

Nicceboy commented 1 week ago

I think this bug is also present in PER. The logic was copied from there initially.

XAMPPRocky commented 1 week ago

@Nicceboy do you want to make a separate issue or PR for that? Just so it's tracked, as I don't know when I'll be able to get to it.