We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d382a37 commit 944d3b7Copy full SHA for 944d3b7
rcgen/src/lib.rs
@@ -937,7 +937,8 @@ impl CertificateParams {
937
} else {
938
let hash = digest::digest(&digest::SHA256, pub_key.raw_bytes());
939
// RFC 5280 specifies at most 20 bytes for a serial number
940
- let sl = &hash.as_ref()[0..20];
+ let mut sl = hash.as_ref()[0..20].to_vec();
941
+ sl[0] = sl[0] & 0x7f; // MSB must be 0 to ensure encoding bignum in 20 bytes
942
writer.next().write_bigint_bytes(sl, true);
943
};
944
// Write signature
0 commit comments