Dolby is apparently recreating all their certificates (as they will soon expire)...
[dcpomatic.git] / src / wx / dolby_doremi_certificate_panel.cc
index 5a578a7eccedad9fcae64e9ab867008895b7302d..66dce8612a80e6d0b9bccc2aa8ad7d9d415432f6 100644 (file)
 #include <dcp/raw_convert.h>
 #include <curl/curl.h>
 #include <zip.h>
+#include <boost/algorithm/string.hpp>
 
 
 using std::function;
 using std::list;
 using std::string;
+using namespace boost::algorithm;
 using boost::optional;
 #if BOOST_VERSION >= 106100
 using namespace boost::placeholders;
@@ -51,6 +53,15 @@ DolbyDoremiCertificatePanel::DolbyDoremiCertificatePanel (DownloadCertificateDia
 static void
 try_dcp2000 (list<string>& urls, list<string>& files, string prefix, string serial)
 {
+       urls.push_back(String::compose("%1%2xxx/Dolby-DCP2000-%3.dcicerts.zip", prefix, serial.substr(0, 3), serial));
+       files.push_back(String::compose("Dolby-DCP2000-%1.cert.sha256.pem", serial));
+
+       urls.push_back(String::compose("%1%2xxx/Dolby-DCP2000-%3.dcicerts.zip", prefix, serial.substr(0, 3), serial));
+       files.push_back(String::compose("Dolby-DCP2000-%1.cert.sha256.pem", serial));
+
+       urls.push_back(String::compose("%1%2xxx/Dolby-DCP2000-%3.certs.zip", prefix, serial.substr(0, 3), serial));
+       files.push_back(String::compose("Dolby-DCP2000-%1.cert.sha256.pem", serial));
+
        urls.push_back (String::compose("%1%2xxx/dcp2000-%3.dcicerts.zip", prefix, serial.substr(0, 3), serial));
        files.push_back (String::compose("dcp2000-%1.cert.sha256.pem", serial));
 
@@ -160,7 +171,8 @@ try_ims3000 (list<string>& urls, list<string>& files, string prefix, string seri
 void
 DolbyDoremiCertificatePanel::do_download ()
 {
-       string const serial = wx_to_std (_serial->GetValue());
+       string serial = wx_to_std(_serial->GetValue());
+       trim(serial);
 
        /* Try dcp2000, imb and ims prefixes (see mantis #375) */