Take the leaf of a certificate chain if one is provided
authorCarl Hetherington <cth@carlh.net>
Thu, 25 Aug 2016 13:42:37 +0000 (14:42 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 25 Aug 2016 13:42:37 +0000 (14:42 +0100)
for a screen certificate (#937).

ChangeLog
cscript
src/wx/config_dialog.cc
src/wx/screen_dialog.cc

index 42ac1ea081d08d7012ec2946f5ca4675bfebc776..b0a6819551594752d9a89e99042781f7572cf39d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-08-25  c.hetherington  <cth@carlh.net>
+
+       * Fix silent acceptance of certificate chains where
+       single certificates are required (#937).
+
 2016-08-25  Carl Hetherington  <cth@carlh.net>
 
        * Updated nl_NL translation from Rob van Nieuwkerk.
diff --git a/cscript b/cscript
index 1377813986330e2511d82af0e94c3a4d54d5d735..43a9b0832b728c3a0d2475d6b9f0d070a2ec3c24 100644 (file)
--- a/cscript
+++ b/cscript
@@ -237,7 +237,7 @@ def dependencies(target):
         ffmpeg_options = {}
 
     return (('ffmpeg-cdist', '1d4a1a4', ffmpeg_options),
-            ('libdcp', '04def4c'),
+            ('libdcp', 'ac6df08'),
             ('libsub', '067c21c'))
 
 def configure_options(target):
index ac5d90296b0982a26f6fedc26c498ca63927f684..0369070a7c32edd900588ec56a6b5568e775a33b 100644 (file)
@@ -773,8 +773,9 @@ private:
 
                if (d->ShowModal() == wxID_OK) {
                        try {
-                               dcp::Certificate c (dcp::file_to_string (wx_to_std (d->GetPath ())));
-                               if (c.extra_data ()) {
+                               dcp::Certificate c;
+                               string const extra = c.read_string (dcp::file_to_string (wx_to_std (d->GetPath ())));
+                               if (!extra.empty ()) {
                                        message_dialog (
                                                this,
                                                _("This file contains other certificates (or other data) after its first certificate. "
index e01b9896259ab2121da9a9a4e768ec94eab058d9..0ecf223e69e1c99a500f55d2fc35df47684db6fe 100644 (file)
@@ -25,6 +25,7 @@
 #include "lib/compose.hpp"
 #include "lib/util.h"
 #include <dcp/exceptions.h>
+#include <dcp/certificate_chain.h>
 #include <wx/filepicker.h>
 #include <wx/validate.h>
 #include <iostream>
@@ -151,7 +152,9 @@ void
 ScreenDialog::load_recipient (boost::filesystem::path file)
 {
        try {
-               set_recipient (dcp::Certificate (dcp::file_to_string (file)));
+               /* Load this as a chain, in case it is one, and then pick the leaf certificate */
+               dcp::CertificateChain c (dcp::file_to_string (file));
+               set_recipient (c.leaf ());
        } catch (dcp::MiscError& e) {
                error_dialog (this, wxString::Format (_("Could not read certificate file (%s)"), std_to_wx(e.what()).data()));
        }