aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/x509/x509self.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2021-04-03 10:30:37 -0400
committerJack Lloyd <[email protected]>2021-04-03 10:30:37 -0400
commit0c22872dcaeedeb6786f23d7c29bd5a9f4904aad (patch)
tree898046930203b27f4db2ae27db52419ac3cf5d16 /src/lib/x509/x509self.cpp
parentfcaa1de521fc9b45a580920adf0bf17869aeaa4a (diff)
Change arg type of Extensions::{add, add_new, replace}
Diffstat (limited to 'src/lib/x509/x509self.cpp')
-rw-r--r--src/lib/x509/x509self.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/lib/x509/x509self.cpp b/src/lib/x509/x509self.cpp
index a4f2012fd..ad43055c4 100644
--- a/src/lib/x509/x509self.cpp
+++ b/src/lib/x509/x509self.cpp
@@ -79,24 +79,24 @@ X509_Certificate create_self_signed_cert(const X509_Cert_Options& opts,
}
extensions.add_new(
- new Cert_Extension::Basic_Constraints(opts.is_CA, opts.path_limit),
+ std::make_unique<Cert_Extension::Basic_Constraints>(opts.is_CA, opts.path_limit),
true);
if(constraints != NO_CONSTRAINTS)
{
- extensions.add_new(new Cert_Extension::Key_Usage(constraints), true);
+ extensions.add_new(std::make_unique<Cert_Extension::Key_Usage>(constraints), true);
}
- std::unique_ptr<Cert_Extension::Subject_Key_ID> skid(new Cert_Extension::Subject_Key_ID(pub_key, hash_fn));
+ std::unique_ptr<Cert_Extension::Subject_Key_ID> skid(std::make_unique<Cert_Extension::Subject_Key_ID>(pub_key, hash_fn));
- extensions.add_new(new Cert_Extension::Authority_Key_ID(skid->get_key_id()));
- extensions.add_new(skid.release());
+ extensions.add_new(std::make_unique<Cert_Extension::Authority_Key_ID>(skid->get_key_id()));
+ extensions.add_new(std::move(skid));
extensions.add_new(
- new Cert_Extension::Subject_Alternative_Name(subject_alt));
+ std::make_unique<Cert_Extension::Subject_Alternative_Name>(subject_alt));
extensions.add_new(
- new Cert_Extension::Extended_Key_Usage(opts.ex_constraints));
+ std::make_unique<Cert_Extension::Extended_Key_Usage>(opts.ex_constraints));
return X509_CA::make_cert(signer.get(), rng, sig_algo, pub_key,
opts.start, opts.end,
@@ -129,14 +129,14 @@ PKCS10_Request create_cert_req(const X509_Cert_Options& opts,
Extensions extensions = opts.extensions;
- extensions.add_new(new Cert_Extension::Basic_Constraints(opts.is_CA, opts.path_limit));
+ extensions.add_new(std::make_unique<Cert_Extension::Basic_Constraints>(opts.is_CA, opts.path_limit));
if(constraints != NO_CONSTRAINTS)
{
- extensions.add_new(new Cert_Extension::Key_Usage(constraints));
+ extensions.add_new(std::make_unique<Cert_Extension::Key_Usage>(constraints));
}
- extensions.add_new(new Cert_Extension::Extended_Key_Usage(opts.ex_constraints));
- extensions.add_new(new Cert_Extension::Subject_Alternative_Name(subject_alt));
+ extensions.add_new(std::make_unique<Cert_Extension::Extended_Key_Usage>(opts.ex_constraints));
+ extensions.add_new(std::make_unique<Cert_Extension::Subject_Alternative_Name>(subject_alt));
return PKCS10_Request::create(key,
subject_dn,