Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ensure default serial generation fits 20 bytes (#203)
By default, s/n is generated taking digest of pub-key of the certificate. However, if the slice number representation is a negative number, then `write_bigint_bytes` is going to append an additional `0`-byte to ensure the positive sign. See: https://github.com/qnighy/yasna.rs/blob/b7e65f9a4c317494cce2d18ea02b3d6eaaea7985/src/writer/mod.rs#L493-L495 So it is possible the bigint encoding will take 21 bytes instead of 20. This CR sets MSB of digest to `0` to ensure encoding will take exactly 20 bytes Co-authored-by: est31 <[email protected]>
- Loading branch information