diff options
Diffstat (limited to 'src/x509_ca.cpp')
-rw-r--r-- | src/x509_ca.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/x509_ca.cpp b/src/x509_ca.cpp index d3737108b..e7557cea5 100644 --- a/src/x509_ca.cpp +++ b/src/x509_ca.cpp @@ -88,12 +88,14 @@ X509_Certificate X509_CA::make_cert(PK_Signer* signer, const X509_DN& subject_dn, const Extensions& extensions) { + RandomNumberGenerator& rng = global_state().prng_reference(); + const u32bit X509_CERT_VERSION = 3; const u32bit SERIAL_BITS = 128; - BigInt serial_no(global_state().prng_reference(), SERIAL_BITS); + BigInt serial_no(rng, SERIAL_BITS); - DataSource_Memory source(X509_Object::make_signed(signer, sig_algo, + DataSource_Memory source(X509_Object::make_signed(signer, rng, sig_algo, DER_Encoder().start_cons(SEQUENCE) .start_explicit(0) .encode(X509_CERT_VERSION-1) @@ -194,7 +196,9 @@ X509_CRL X509_CA::make_crl(const std::vector<CRL_Entry>& revoked, new Cert_Extension::Authority_Key_ID(cert.subject_key_id())); extensions.add(new Cert_Extension::CRL_Number(crl_number)); - DataSource_Memory source(X509_Object::make_signed(signer, ca_sig_algo, + RandomNumberGenerator& rng = global_state().prng_reference(); + + DataSource_Memory source(X509_Object::make_signed(signer, rng, ca_sig_algo, DER_Encoder().start_cons(SEQUENCE) .encode(X509_CRL_VERSION-1) .encode(ca_sig_algo) |