diff options
Diffstat (limited to 'src/x509_ca.cpp')
-rw-r--r-- | src/x509_ca.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/x509_ca.cpp b/src/x509_ca.cpp index 13e1520a1..602649930 100644 --- a/src/x509_ca.cpp +++ b/src/x509_ca.cpp @@ -91,13 +91,17 @@ X509_Certificate X509_CA::make_cert(PK_Signer* signer, const u32bit X509_CERT_VERSION = 3; const u32bit SERIAL_BITS = 128; + BigInt serial_no = random_integer(global_state().prng_reference(), + SERIAL_BITS); + DataSource_Memory source(X509_Object::make_signed(signer, sig_algo, DER_Encoder().start_cons(SEQUENCE) .start_explicit(0) .encode(X509_CERT_VERSION-1) .end_explicit() - .encode(random_integer(SERIAL_BITS)) + .encode(serial_no) + .encode(sig_algo) .encode(issuer_dn) |