From 3160fc95e947b2a8a5d1b8f2f7189ced211bc7a4 Mon Sep 17 00:00:00 2001 From: Mikkel Krautz Date: Mon, 8 May 2017 21:45:14 +0200 Subject: [PATCH] murmur/Cert: check for 'Murmur Autogenerated Certificate' prefix instead of explicit version in self-signed cert check. This commit changes our check for whether a server is using a self-signed certificate to check for the prefix 'Murmur Autogenerated Certificate'. Previously, we would only check for 'Murmur Autogenerated Certificate v2'. (The previous version, 'Murmur Autogenerated Certificate' is no longer valid, so is not considered in this context.) This will allow us to bump the version in the certificate, without needing to update our code to know about these bumps. --- src/murmur/Cert.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/murmur/Cert.cpp b/src/murmur/Cert.cpp index 180b1cc63..d7a69b2d6 100644 --- a/src/murmur/Cert.cpp +++ b/src/murmur/Cert.cpp @@ -387,7 +387,7 @@ void Server::initializeCert() { // all the same addresses as the Meta server is, use it's cert instead. // This allows a self-signed certificate generated by Murmur to be // replaced by a CA-signed certificate in the .ini file. - if (!qscCert.isNull() && issuer == QString::fromUtf8("Murmur Autogenerated Certificate v2") && ! Meta::mp.qscCert.isNull() && ! Meta::mp.qskKey.isNull() && (Meta::mp.qlBind == qlBind)) { + if (!qscCert.isNull() && issuer.startsWith(QString::fromUtf8("Murmur Autogenerated Certificate")) && ! Meta::mp.qscCert.isNull() && ! Meta::mp.qskKey.isNull() && (Meta::mp.qlBind == qlBind)) { qscCert = Meta::mp.qscCert; qskKey = Meta::mp.qskKey; qlIntermediates = Meta::mp.qlIntermediates;