diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-07-12 20:19:30 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-07-12 20:19:30 +0100 |
| commit | 970f39ca6207666985f53d2bba6f8e60aeaad5a9 (patch) | |
| tree | 658d5d53d2816310fa0e5618b259d355abcc35b8 /src | |
| parent | 10e3bfad8164fc1bce19101253cd3bc9a1f973a3 (diff) | |
Enforce some restrictions on SSL certificate properties.
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/make_signer_chain_dialog.cc | 40 | ||||
| -rw-r--r-- | src/wx/make_signer_chain_dialog.h | 7 |
2 files changed, 38 insertions, 9 deletions
diff --git a/src/wx/make_signer_chain_dialog.cc b/src/wx/make_signer_chain_dialog.cc index 5211fa547..8df208934 100644 --- a/src/wx/make_signer_chain_dialog.cc +++ b/src/wx/make_signer_chain_dialog.cc @@ -22,16 +22,46 @@ MakeSignerChainDialog::MakeSignerChainDialog (wxWindow* parent) : TableDialog (parent, _("Make certificate chain"), 2, true) { + wxTextValidator validator (wxFILTER_EXCLUDE_CHAR_LIST); + validator.SetCharExcludes (wxT ("/")); + add (_("Organisation"), true); - add (_organisation = new wxTextCtrl (this, wxID_ANY)); + add (_organisation = new wxTextCtrl (this, wxID_ANY, wxT (""), wxDefaultPosition, wxDefaultSize, 0, validator)); add (_("Organisational unit"), true); - add (_organisational_unit = new wxTextCtrl (this, wxID_ANY)); + add (_organisational_unit = new wxTextCtrl (this, wxID_ANY, wxT (""), wxDefaultPosition, wxDefaultSize, 0, validator)); + add (_("Root common name"), true); - add (_root_common_name = new wxTextCtrl (this, wxID_ANY)); + + { + wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); + s->Add (new wxStaticText (this, wxID_ANY, wxT (".")), 0, wxALIGN_CENTER_VERTICAL); + s->Add (_root_common_name = new wxTextCtrl ( + this, wxID_ANY, wxT (""), wxDefaultPosition, wxDefaultSize, 0, validator), 1, wxALIGN_CENTER_VERTICAL + ); + add (s); + } + add (_("Intermediate common name"), true); - add (_intermediate_common_name = new wxTextCtrl (this, wxID_ANY)); + + { + wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); + s->Add (new wxStaticText (this, wxID_ANY, wxT (".")), 0, wxALIGN_CENTER_VERTICAL); + s->Add (_intermediate_common_name = new wxTextCtrl ( + this, wxID_ANY, wxT (""), wxDefaultPosition, wxDefaultSize, 0, validator), 1, wxALIGN_CENTER_VERTICAL + ); + add (s); + } + add (_("Leaf common name"), true); - add (_leaf_common_name = new wxTextCtrl (this, wxID_ANY)); + + { + wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); + s->Add (new wxStaticText (this, wxID_ANY, wxT ("CS.")), 0, wxALIGN_CENTER_VERTICAL); + s->Add (_leaf_common_name = new wxTextCtrl ( + this, wxID_ANY, wxT (""), wxDefaultPosition, wxDefaultSize, 0, validator), 1, wxALIGN_CENTER_VERTICAL + ); + add (s); + } layout (); diff --git a/src/wx/make_signer_chain_dialog.h b/src/wx/make_signer_chain_dialog.h index 6d018c0dc..d05b4381f 100644 --- a/src/wx/make_signer_chain_dialog.h +++ b/src/wx/make_signer_chain_dialog.h @@ -34,15 +34,15 @@ public: } std::string root_common_name () const { - return wx_to_std (_root_common_name->GetValue ()); + return "." + wx_to_std (_root_common_name->GetValue ()); } std::string intermediate_common_name () const { - return wx_to_std (_intermediate_common_name->GetValue ()); + return "." + wx_to_std (_intermediate_common_name->GetValue ()); } std::string leaf_common_name () const { - return wx_to_std (_leaf_common_name->GetValue ()); + return "CS." + wx_to_std (_leaf_common_name->GetValue ()); } @@ -53,4 +53,3 @@ private: wxTextCtrl* _intermediate_common_name; wxTextCtrl* _leaf_common_name; }; - |
