From 813732537680680737c2b8f9a5796ac58ebbe980 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 14 Mar 2018 23:26:17 +0000 Subject: [PATCH] Better error when loading a non-certificate as a certificate; the chain is OK but empty. --- ChangeLog | 2 ++ src/wx/screen_dialog.cc | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 99a577390..16edf7d3a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2018-03-14 Carl Hetherington + * Better error when loading a non-certificate as a certificate. + * Very basic DCP verification option in the player. 2018-03-07 Carl Hetherington 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())); } } -- 2.30.2