Accept serial numbers with A prefix entered by user.
authorCarl Hetherington <cth@carlh.net>
Tue, 22 Dec 2020 19:15:08 +0000 (20:15 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 22 Dec 2020 19:15:08 +0000 (20:15 +0100)
src/wx/gdc_certificate_panel.cc

index bc1087fd164a46b21d832f2830c82e2f9d9008c0..f7f86895df931eaaf307d0277a2b1c2914d74465 100644 (file)
@@ -49,11 +49,16 @@ GDCCertificatePanel::GDCCertificatePanel (DownloadCertificateDialog* dialog)
 void
 GDCCertificatePanel::do_download ()
 {
+       string serial = wx_to_std (_serial->GetValue());
+       if (!serial.empty() && serial[0] == 'A') {
+               /* We're adding the A ourselves */
+               serial = serial.substr(1);
+       }
        string const url = String::compose(
                "ftp://%1:%2@ftp.gdc-tech.com/SHA256/A%3.crt.pem",
                Config::instance()->gdc_username().get(),
                Config::instance()->gdc_password().get(),
-               wx_to_std(_serial->GetValue())
+               serial
                );
 
        optional<string> error = get_from_url (url, true, false, boost::bind(&DownloadCertificatePanel::load_certificate, this, _1));