summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-02-15 16:52:58 +0100
committerCarl Hetherington <cth@carlh.net>2022-02-15 16:52:58 +0100
commit551d099baf7519988354bc3d6699cfa2f12daea1 (patch)
tree638e4b82f3399538f2829c332ca31858cad0e2bf
parentfa85cc6352a2f25bdd1d4421c9490f9fca266e04 (diff)
Allow configurable certificate validity periods.carsten-cert-validity
-rw-r--r--src/wx/make_chain_dialog.cc15
-rw-r--r--src/wx/make_chain_dialog.h9
2 files changed, 22 insertions, 2 deletions
diff --git a/src/wx/make_chain_dialog.cc b/src/wx/make_chain_dialog.cc
index 4255fb307..a58ef6fdb 100644
--- a/src/wx/make_chain_dialog.cc
+++ b/src/wx/make_chain_dialog.cc
@@ -19,6 +19,7 @@
*/
+#include "dcpomatic_spin_ctrl.h"
#include "make_chain_dialog.h"
#include "static_text.h"
#include "lib/cross.h"
@@ -118,9 +119,21 @@ MakeChainDialog::MakeChainDialog (
add (s);
}
+ add (_("Valid for"), true);
+
+ {
+ auto s = new wxBoxSizer (wxHORIZONTAL);
+ s->Add (_validity = new SpinCtrl(this, 156), 0, wxALIGN_CENTER_VERTICAL);
+ s->Add (new StaticText(this, _("days")), 0, wxLEFT | wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_X_GAP);
+ add (s);
+ }
+
layout ();
_organisation->SetFocus ();
+
+ _validity->SetRange (7, 50 * 365);
+ _validity->SetValue (3650);
}
@@ -129,7 +142,7 @@ MakeChainDialog::get () const
{
return make_shared<dcp::CertificateChain>(
openssl_path(),
- CERTIFICATE_VALIDITY_PERIOD,
+ _validity->GetValue(),
wx_to_std(_organisation->GetValue()),
wx_to_std(_organisational_unit->GetValue()),
"." + wx_to_std(_root_common_name->GetValue()),
diff --git a/src/wx/make_chain_dialog.h b/src/wx/make_chain_dialog.h
index 018db99a2..00be22c97 100644
--- a/src/wx/make_chain_dialog.h
+++ b/src/wx/make_chain_dialog.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2014-2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2014-2021 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
@@ -18,12 +18,17 @@
*/
+
#ifndef DCPOMATIC_MAKE_CHAIN_DIALOG_H
#define DCPOMATIC_MAKE_CHAIN_DIALOG_H
+
#include "table_dialog.h"
#include "wx_util.h"
+
+class SpinCtrl;
+
class MakeChainDialog : public TableDialog
{
public:
@@ -37,6 +42,8 @@ private:
wxTextCtrl* _root_common_name;
wxTextCtrl* _intermediate_common_name;
wxTextCtrl* _leaf_common_name;
+ SpinCtrl* _validity;
};
+
#endif