Commit 1eacbb2d authored by Volker Krause's avatar Volker Krause
Browse files

Skip invalid VDV certificates rather than terminating the download

parent 384e611c
...@@ -114,7 +114,7 @@ static void decodeCert(const QString &certName) ...@@ -114,7 +114,7 @@ static void decodeCert(const QString &certName)
} }
cert.writeKey(&f); cert.writeKey(&f);
} else { } else {
qFatal("%s is invalid", qPrintable(certName)); qWarning("%s is invalid", qPrintable(certName));
} }
} }
...@@ -148,15 +148,17 @@ int main(int argc, char **argv) ...@@ -148,15 +148,17 @@ int main(int argc, char **argv)
for (auto it = certNames.begin(); it != certNames.end();) { for (auto it = certNames.begin(); it != certNames.end();) {
const auto cert = loadCert(*it); const auto cert = loadCert(*it);
if (!cert.isValid()) { if (!cert.isValid()) {
qFatal("Invalid certificate: %s", qPrintable(*it)); qWarning("Invalid certificate: %s", qPrintable(*it));
it = certNames.erase(it);
continue;
} }
if (!cert.isSelfSigned() && cert.endOfValidity().year() < 2019) { if (!cert.isSelfSigned() && cert.endOfValidity().year() < 2019) {
qDebug() << "discarding" << (*it) << "due to being expired" << cert.endOfValidity(); qDebug() << "discarding" << (*it) << "due to being expired" << cert.endOfValidity();
QFile::rename((*it) + QLatin1String(".vdv-cert"), QLatin1Char('.') + (*it) + QLatin1String(".vdv-cert")); QFile::rename((*it) + QLatin1String(".vdv-cert"), QLatin1Char('.') + (*it) + QLatin1String(".vdv-cert"));
it = certNames.erase(it); it = certNames.erase(it);
} else { continue;
++it;
} }
++it;
} }
// (5) write qrc file // (5) write qrc file
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment