Comments (3)
Seems like that current option values are based on mapping the Result to Option, so Option value is not really based on the decoder logic:
impl rasn::Decode for SequenceOptionals {
fn decode_with_tag_and_constraints<'constraints, D: rasn::Decoder>(
decoder: &mut D,
tag: rasn::Tag,
constraints: rasn::types::Constraints<'constraints>,
) -> core::result::Result<Self, D::Error> {
decoder.decode_sequence(tag, None::<fn() -> Self>, |decoder| {
Ok(Self {
it: {
decoder
.decode_explicit_prefix(rasn::Tag::new(rasn::types::Class::Context, 0))
.map_err(|error| {
rasn::de::Error::field_error(
"SequenceOptionals.it",
error.into(),
decoder.codec(),
)
})?
},
is: {
decoder
.decode_explicit_prefix(rasn::Tag::new(rasn::types::Class::Context, 1))
.ok()
},
late: {
decoder
.decode_explicit_prefix(rasn::Tag::new(rasn::types::Class::Context, 2))
.ok()
},
})
})
}
}
from rasn.
Seems like there is also bug in OER. When resolved, it which fixes this particular case, but I am not sure if this is still issue on some other scenarios.
from rasn.
We can probably remove the ok and/or add an explicit type parameter to decode explicit prefix.
from rasn.
Related Issues (20)
- stack overflow when comparing &ObjectIdentifier with &[u32] HOT 1
- DER decoding of empty sequences is incredibly slow HOT 4
- UnbindRequest encodes/decodes incorrectly
- Comparing Object Identifier causes SIGSEGV HOT 2
- `index_map` and `character_map` are broken (one static map is initialized for all types, and thus doesn't work for different types)
- Breaking change in 0.12.6 breaks compilation of apple-codesign HOT 1
- Tokei lines of code badge doesn't work
- Mutable Access to Encoded Values HOT 2
- Performance of PER codec HOT 10
- Is it possible to get &[u8] for the underlying decoded value
- Standards crates (`rasn-pkix`, `rasn-ocsp`, etc.) should not enable `rasn`'s default feature HOT 2
- Failed windows builds HOT 1
- OER encoder produces output that it can't decode HOT 5
- ia5 string decoding debug assertion reached from OER HOT 1
- OER/COER decode_sequence_of passes invalid data to bitvec load_be resulting in panic from assertion HOT 4
- Does not work in no-std environment HOT 3
- OER encoding rountrip confuses fields HOT 2
- OER/UPER/APER roundtrip fails with untagged sequence fields and optional types HOT 8
- Decoding the data stream
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rasn.