aboutsummaryrefslogtreecommitdiffstats
path: root/src/cert/x509
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-11-16 17:07:38 +0000
committerlloyd <[email protected]>2009-11-16 17:07:38 +0000
commit22a47e97f459337ff8c2b9fdcf68cb1514b19b34 (patch)
tree3eacf8d877eb0f3c6bc19f0b1995bedea224591c /src/cert/x509
parentfc5fadb281c509855a0ae20ecc70bfe9d681a1af (diff)
Use auto for long iterator names, etc.
It will be nice to convert to the range-based for loop once that's available.
Diffstat (limited to 'src/cert/x509')
-rw-r--r--src/cert/x509/x509_ca.cpp6
-rw-r--r--src/cert/x509/x509cert.cpp16
-rw-r--r--src/cert/x509/x509stor.cpp3
3 files changed, 7 insertions, 18 deletions
diff --git a/src/cert/x509/x509_ca.cpp b/src/cert/x509/x509_ca.cpp
index 3ba18e50e..6aba7e5a0 100644
--- a/src/cert/x509/x509_ca.cpp
+++ b/src/cert/x509/x509_ca.cpp
@@ -15,9 +15,6 @@
#include <botan/look_pk.h>
#include <botan/oids.h>
#include <botan/time.h>
-#include <algorithm>
-#include <typeinfo>
-#include <iterator>
#include <memory>
#include <set>
@@ -175,8 +172,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]);
diff --git a/src/cert/x509/x509cert.cpp b/src/cert/x509/x509cert.cpp
index ac5839fb6..9be645dce 100644
--- a/src/cert/x509/x509cert.cpp
+++ b/src/cert/x509/x509cert.cpp
@@ -27,12 +27,8 @@ std::vector<std::string> lookup_oids(const std::vector<std::string>& in)
{
std::vector<std::string> out;
- std::vector<std::string>::const_iterator i = in.begin();
- while(i != in.end())
- {
+ for(auto i = in.begin(); i != in.end(); ++i)
out.push_back(OIDS::lookup(OID(*i)));
- ++i;
- }
return out;
}
@@ -320,9 +316,8 @@ X509_DN create_dn(const Data_Store& info)
X509_DN dn;
- std::multimap<std::string, std::string>::iterator j;
- for(j = names.begin(); j != names.end(); ++j)
- dn.add_attribute(j->first, j->second);
+ for(auto i = names.begin(); i != names.end(); ++i)
+ dn.add_attribute(i->first, i->second);
return dn;
}
@@ -356,9 +351,8 @@ AlternativeName create_alt_name(const Data_Store& info)
AlternativeName alt_name;
- std::multimap<std::string, std::string>::iterator j;
- for(j = names.begin(); j != names.end(); ++j)
- alt_name.add_attribute(j->first, j->second);
+ for(auto i = names.begin(); i != names.end(); ++i)
+ alt_name.add_attribute(i->first, i->second);
return alt_name;
}
diff --git a/src/cert/x509/x509stor.cpp b/src/cert/x509/x509stor.cpp
index 364bbac7b..323890f2d 100644
--- a/src/cert/x509/x509stor.cpp
+++ b/src/cert/x509/x509stor.cpp
@@ -603,8 +603,7 @@ X509_Code X509_Store::add_crl(const X509_CRL& crl)
revoked_info.serial = revoked_certs[j].serial_number();
revoked_info.auth_key_id = crl.authority_key_id();
- std::vector<CRL_Data>::iterator p =
- std::find(revoked.begin(), revoked.end(), revoked_info);
+ auto p = std::find(revoked.begin(), revoked.end(), revoked_info);
if(revoked_certs[j].reason_code() == REMOVE_FROM_CRL)
{