diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-03-14 23:26:17 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-03-14 23:26:17 +0000 |
| commit | 813732537680680737c2b8f9a5796ac58ebbe980 (patch) | |
| tree | dcb8b76f780027b9f8461fcd3fff77e376ef6e09 /src | |
| parent | ccde188f3b560730d14933af5caa11b413c2e623 (diff) | |
Better error when loading a non-certificate as a certificate; the chain is OK but empty.
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/screen_dialog.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/wx/screen_dialog.cc b/src/wx/screen_dialog.cc index c7684d77f..8f0086185 100644 --- a/src/wx/screen_dialog.cc +++ b/src/wx/screen_dialog.cc @@ -153,9 +153,13 @@ ScreenDialog::load_recipient (boost::filesystem::path file) try { /* Load this as a chain, in case it is one, and then pick the leaf certificate */ dcp::CertificateChain c (dcp::file_to_string (file)); + if (c.unordered().empty()) { + error_dialog (this, _("Could not read certificate file.")); + return; + } set_recipient (c.leaf ()); } catch (dcp::MiscError& e) { - error_dialog (this, wxString::Format (_("Could not read certificate file.")), std_to_wx(e.what())); + error_dialog (this, _("Could not read certificate file."), std_to_wx(e.what())); } } |
