The encoding seems to be incorrect for certain object identifiers at the boundary of arc length. For example:
// decoded: 1.2.0
println!("decoded: {:?}", ObjectIdentifier::from_der(&ObjectIdentifier::new_unwrap("1.2.128").to_der().unwrap()));
// decoded: 1.2.0.0
println!("decoded: {:?}", ObjectIdentifier::from_der(&ObjectIdentifier::new_unwrap("1.2.16384").to_der().unwrap()));
I'm using this crate:
der = { version = "0.7.9", features = [ "alloc", "oid" ] }