Minor fixes

This commit is contained in:
Christian Hohnstaedt 2017-07-09 15:52:25 +02:00
parent 84f25048a7
commit fed2dd711a
3 changed files with 8 additions and 7 deletions

View File

@ -257,8 +257,7 @@ void db_x509::inToCont(pki_base *pki)
foreach(pki_base *b, items) {
pki_crl *crl = static_cast<pki_crl*>(b);
crl->verify(cert);
cert = crl->getIssuer();
if (!cert)
if (cert != crl->getIssuer())
continue;
q.bindValue(0, cert->getSqlItemId());
q.bindValue(1, crl->getSqlItemId());
@ -916,7 +915,7 @@ void db_x509::do_revoke(QModelIndexList indexes, const x509rev &r)
}
}
if (!parent) {
qWarning("%s(%d): Certs have different/no signer\n",
qWarning("%s(%d): Certs have different/no signer",
__func__, __LINE__);
}
foreach(QModelIndex idx, indexes) {

View File

@ -80,13 +80,15 @@ pki_key *pki_x509super::getRefKey() const
unsigned pki_x509super::pubHash()
{
unsigned hash;
unsigned hash = 0;
if (privkey) {
hash = privkey->hash();
} else {
pki_key *x = getPubKey();
hash = x->hash();
delete x;
if (x) {
hash = x->hash();
delete x;
}
}
return hash;
}

View File

@ -479,9 +479,9 @@ void MainWindow::importOldDatabase(QString dbname)
delete pki;
pki = NULL;
}
qDebug() << "load old:" << pki->getIntName();
free(p);
if (pki) {
qDebug() << "load old:" << pki->getIntName();
cont->insertPKI(pki);
}
next: