summaryrefslogtreecommitdiff
path: root/src/certificate_chain.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-01-11 00:16:40 +0100
committerCarl Hetherington <cth@carlh.net>2021-01-17 20:13:23 +0100
commitd95eacd3851a20e52202465ec22b4f72a4983dc8 (patch)
tree1dfc1092ae7d2e6b6b7c313ad808415f578d9712 /src/certificate_chain.cc
parentcbee0d077e698541afcea82a95bafcea5245ab89 (diff)
Replace std::list with std::vector in the API.
Diffstat (limited to 'src/certificate_chain.cc')
-rw-r--r--src/certificate_chain.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/certificate_chain.cc b/src/certificate_chain.cc
index 2fb0f651..a4da0931 100644
--- a/src/certificate_chain.cc
+++ b/src/certificate_chain.cc
@@ -362,7 +362,7 @@ CertificateChain::List
CertificateChain::leaf_to_root () const
{
List l = root_to_leaf ();
- l.reverse ();
+ std::reverse (l.begin(), l.end());
return l;
}
@@ -387,7 +387,10 @@ CertificateChain::add (Certificate c)
void
CertificateChain::remove (Certificate c)
{
- _certificates.remove (c);
+ auto i = std::find(_certificates.begin(), _certificates.end(), c);
+ if (i != _certificates.end()) {
+ _certificates.erase (i);
+ }
}
/** Remove the i'th certificate in the list, as listed
@@ -557,7 +560,7 @@ CertificateChain::List
CertificateChain::root_to_leaf () const
{
List rtl = _certificates;
- rtl.sort ();
+ std::sort (rtl.begin(), rtl.end());
do {
if (chain_valid (rtl)) {
return rtl;