bool KSSLD::cacheAddHost(KSSLCertificate cert, TQString host) { KSSLCNode *node; if (host.isEmpty()) return true; for (node = certList.first(); node; node = certList.next()) { if (cert == *(node->cert)) { if (!node->permanent && node->expires < TQDateTime::currentDateTime()) { certList.remove(node); cfg->deleteGroup(node->cert->getMD5Digest()); searchRemoveCert(node->cert); delete node; cacheSaveToDisk(); return false; } if (!node->hosts.contains(host)) { node->hosts << host; } certList.remove(node); certList.prepend(node); cacheSaveToDisk(); return true; } } return false; }
QStringList KSSLD::cacheGetHostList(KSSLCertificate cert) { KSSLCNode *node; for(node = certList.first(); node; node = certList.next()) { if(cert == *(node->cert)) { if(!node->permanent && node->expires < QDateTime::currentDateTime()) { certList.remove(node); cfg->deleteGroup(node->cert->getMD5Digest()); searchRemoveCert(node->cert); delete node; cacheSaveToDisk(); return QStringList(); } certList.remove(node); certList.prepend(node); return node->hosts; } } return QStringList(); }
bool KSSLD::cacheRemoveByCertificate(KSSLCertificate cert) { KSSLCNode *node; for (node = certList.first(); node; node = certList.next()) { if (cert == *(node->cert)) { certList.remove(node); cfg->deleteGroup(node->cert->getMD5Digest()); searchRemoveCert(node->cert); delete node; cacheSaveToDisk(); return true; } } return false; }
bool KSSLD::cacheRemoveByCN(TQString cn) { KSSLCNode *node; bool gotOne = false; for (node = certList.first(); node; node = certList.next()) { if (KSSLX509Map(node->cert->getSubject()).getValue("CN") == cn) { certList.remove(node); cfg->deleteGroup(node->cert->getMD5Digest()); searchRemoveCert(node->cert); delete node; gotOne = true; } } cacheSaveToDisk(); return gotOne; }
bool KSSLD::cacheRemoveBySubject(QString subject) { KSSLCNode *node; bool gotOne = false; for(node = certList.first(); node; node = certList.next()) { if(node->cert->getSubject() == subject) { certList.remove(node); cfg->deleteGroup(node->cert->getMD5Digest()); searchRemoveCert(node->cert); delete node; gotOne = true; } } cacheSaveToDisk(); return gotOne; }