Fix PEM reading issues and assert to catch generating corrupt keypairs

This commit is contained in:
Cameron Gutman
2018-04-30 21:33:36 -07:00
parent 9bd804c4c3
commit d4689b466a
2 changed files with 6 additions and 2 deletions
+4
View File
@@ -110,6 +110,10 @@ IdentityManager::IdentityManager(QDir directory)
BIO_free(biokey);
BIO_free(biocert);
// Ensure we can actually consume the keys we just wrote
assert(!QSslCertificate(m_CachedPemCert).isNull());
assert(!QSslKey(m_CachedPrivateKey, QSsl::Rsa).isNull());
qDebug() << "Wrote new identity credentials to disk";
}