aboutsummaryrefslogtreecommitdiffstats
path: root/src/cert/x509/x509_ca.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-09-03 13:55:19 +0000
committerlloyd <[email protected]>2010-09-03 13:55:19 +0000
commit7e54763ea43c8b34729387c7429922dd981c4f5b (patch)
tree33a1bd0f32e4ab7958a484e468316291c527dd24 /src/cert/x509/x509_ca.cpp
parentfb68795162b8d107cbd284c4a75d8e13ce589829 (diff)
parentec8c59af3db02ff159908f9a446e53c4ea20d474 (diff)
propagate from branch 'net.randombit.botan' (head a29c41b4a949207b1544096c3afab668f8b5179e)
to branch 'net.randombit.botan.c++0x' (head a9d0c2f805b3c20a4c648575d7256959db8329fe)
Diffstat (limited to 'src/cert/x509/x509_ca.cpp')
-rw-r--r--src/cert/x509/x509_ca.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/cert/x509/x509_ca.cpp b/src/cert/x509/x509_ca.cpp
index ea7f3a405..5af824946 100644
--- a/src/cert/x509/x509_ca.cpp
+++ b/src/cert/x509/x509_ca.cpp
@@ -14,10 +14,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>
@@ -57,7 +53,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());
}
@@ -171,8 +167,7 @@ X509_CRL X509_CA::update_crl(const X509_CRL& crl,
for(u32bit j = 0; j != already_revoked.size(); ++j)
{
- std::set<SecureVector<byte> >::const_iterator i;
- i = removed_from_crl.find(already_revoked[j].serial_number());
+ auto i = removed_from_crl.find(already_revoked[j].serial_number());
if(i == removed_from_crl.end())
all_revoked.push_back(already_revoked[j]);
@@ -199,7 +194,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(
@@ -212,7 +208,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)