RustCrypto / formats

Cryptography-related format encoders/decoders: DER, PEM, PKCS, PKIX
243 stars 130 forks source link

const-oid: fix `Encoder` size check and off-by-one error #1304

Closed tarcieri closed 9 months ago

tarcieri commented 9 months ago

The Encoder previously returned Error::Length even when there was one remaining byte in the buffer.

This fixes that error and adds an edge case test.

baloo commented 9 months ago

Missing the test?

tarcieri commented 9 months ago

The test is the existing one in encoder.rs, however it passed before because it was using the wrong length