aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/cert/x509/x509_ext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/cert/x509/x509_ext.cpp')
-rw-r--r--src/lib/cert/x509/x509_ext.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/lib/cert/x509/x509_ext.cpp b/src/lib/cert/x509/x509_ext.cpp
index b4b918529..7dd4a3190 100644
--- a/src/lib/cert/x509/x509_ext.cpp
+++ b/src/lib/cert/x509/x509_ext.cpp
@@ -309,11 +309,8 @@ void Subject_Key_ID::contents_to(Data_Store& subject, Data_Store&) const
/*
* Subject_Key_ID Constructor
*/
-Subject_Key_ID::Subject_Key_ID(const std::vector<byte>& pub_key)
- {
- SHA_160 hash;
- m_key_id = unlock(hash.process(pub_key));
- }
+Subject_Key_ID::Subject_Key_ID(const std::vector<byte>& pub_key) : m_key_id(unlock(SHA_160().process(pub_key)))
+ {}
/*
* Encode the extension
@@ -384,11 +381,8 @@ void Alternative_Name::contents_to(Data_Store& subject_info,
* Alternative_Name Constructor
*/
Alternative_Name::Alternative_Name(const AlternativeName& alt_name,
- const std::string& oid_name_str)
- {
- this->m_alt_name = alt_name;
- this->m_oid_name_str = oid_name_str;
- }
+ const std::string& oid_name_str) : m_alt_name(alt_name), m_oid_name_str(oid_name_str)
+ {}
/*
* Subject_Alternative_Name Constructor
@@ -448,7 +442,7 @@ class Policy_Information : public ASN1_Object
OID oid;
Policy_Information() {}
- Policy_Information(const OID& oid_) : oid(oid_) {}
+ explicit Policy_Information(const OID& oid) : oid(oid) {}
void encode_into(DER_Encoder& codec) const override
{
@@ -476,7 +470,7 @@ std::vector<byte> Certificate_Policies::encode_inner() const
std::vector<Policy_Information> policies;
for(size_t i = 0; i != m_oids.size(); ++i)
- policies.push_back(m_oids[i]);
+ policies.push_back(Policy_Information(m_oids[i]));
return DER_Encoder()
.start_cons(SEQUENCE)