recognize certificates with circular references [ xca-Bugs-1693027 ]

This commit is contained in:
Christian 2007-04-04 13:24:37 +02:00
parent a799e9212d
commit bfa706de44
3 changed files with 17 additions and 3 deletions

View File

@ -1,3 +1,5 @@
* recognize certificates with circular references
[ xca-Bugs-1693027 ]
* be compatibile to QT-4.1 (thanks Tamas TEVESZ)
* remove all usages of QT3 backward lib
[ xca-Feature Requests-1692800 ]

View File

@ -184,6 +184,8 @@ void db_x509::calcEffTrust()
void db_x509::inToCont(pki_base *pki)
{
pki_x509 *cert = (pki_x509*)pki;
cert->setParent(NULL);
cert->delSigner(cert->getSigner());
findSigner(cert);
pki_base *root = cert->getSigner();
if (!treeview || root == cert)
@ -199,6 +201,18 @@ void db_x509::inToCont(pki_base *pki)
//printf("examining client %s\n", CCHAR(client->getIntName()));
if (client->verify(cert)) {
int row = client->row();
pki_x509 *s;
/* recursive signing check */
for (s = cert; s; s = s->getSigner()) {
if (s == client) {
printf("Recursive signing: '%s' <-> '%s'\n",
CCHAR(client->getIntName()),
CCHAR(cert->getIntName()));
break;
}
}
if (s)
continue;
// printf("Client cert found: %s(%d)%p -> %s(%d)%p\n", CCHAR(pki->getIntName()), pki->childCount(), pki, CCHAR(client->getIntName()), client->childCount(), client);
beginRemoveRows(QModelIndex(), row, row);
rootItem->takeChild(client);

View File

@ -581,10 +581,8 @@ int pki_x509::calcEffTrust()
}
//we must look at the parent certs
pki_x509 *signer = getSigner();
pki_x509 *prevsigner = this;
while (mytrust==1 && signer != NULL && signer != prevsigner) {
while (mytrust == 1 && signer && signer != this) {
mytrust = signer->getTrust();
prevsigner = signer;
signer = signer->getSigner();
}