aboutsummaryrefslogtreecommitdiffstats
path: root/src/cert/x509ca/x509_ca.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-10-13 03:25:16 +0000
committerlloyd <[email protected]>2010-10-13 03:25:16 +0000
commitba142ed2eaa21445d49cbbc8ae3b3d4dc625b9d7 (patch)
treebe1a9fa07d0ea26fd7713bb52205f7a3bcc3e907 /src/cert/x509ca/x509_ca.cpp
parent406d4f8556d41083bfa551e7a777b0cb02925b6c (diff)
parent5913bf42b4c32e43d0db11bf9299130f3b0b62a4 (diff)
propagate from branch 'net.randombit.botan' (head 2898d79f992f27a328a3e41d34b46eb1052da0de)
to branch 'net.randombit.botan.c++0x' (head 6cba76268fd69a73195760c021b7f881b8a6552c)
Diffstat (limited to 'src/cert/x509ca/x509_ca.cpp')
-rw-r--r--src/cert/x509ca/x509_ca.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/cert/x509ca/x509_ca.cpp b/src/cert/x509ca/x509_ca.cpp
index c9523c6c8..be49ec46a 100644
--- a/src/cert/x509ca/x509_ca.cpp
+++ b/src/cert/x509ca/x509_ca.cpp
@@ -13,10 +13,6 @@
#include <botan/parsing.h>
#include <botan/lookup.h>
#include <botan/oids.h>
-#include <botan/time.h>
-#include <algorithm>
-#include <typeinfo>
-#include <iterator>
#include <memory>
#include <set>
@@ -56,7 +52,7 @@ X509_Certificate X509_CA::sign_request(const PKCS10_Request& req,
constraints = Key_Constraints(KEY_CERT_SIGN | CRL_SIGN);
else
{
- std::auto_ptr<Public_Key> key(req.subject_public_key());
+ std::unique_ptr<Public_Key> key(req.subject_public_key());
constraints = X509::find_constraints(*key, req.constraints());
}
@@ -172,7 +168,8 @@ X509_CRL X509_CA::make_crl(const std::vector<CRL_Entry>& revoked,
next_update = timespec_to_u32bit("7d");
// Totally stupid: ties encoding logic to the return of std::time!!
- const u64bit current_time = system_time();
+ auto current_time = std::chrono::system_clock::now();
+ auto expire_time = current_time + std::chrono::seconds(next_update);
Extensions extensions;
extensions.add(
@@ -185,7 +182,7 @@ X509_CRL X509_CA::make_crl(const std::vector<CRL_Entry>& revoked,
.encode(ca_sig_algo)
.encode(cert.issuer_dn())
.encode(X509_Time(current_time))
- .encode(X509_Time(current_time + next_update))
+ .encode(X509_Time(expire_time))
.encode_if(revoked.size() > 0,
DER_Encoder()
.start_cons(SEQUENCE)