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.
This commit is contained in:
Mikkel Krautz 2017-05-08 21:45:14 +02:00
parent d3470c30bb
commit 3160fc95e9

View File

@ -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;