find SuisseID certs; refs #32

master
Marc Wäckerlin 14 years ago
parent 64188cd657
commit 327b889eea
  1. 7
      swisssurfer/src/smartcardauth.hxx

@ -44,13 +44,16 @@ class CryptokiEngine: public openssl::Engine {
id)); id));
OPENSSL_LOG("**** with keys: "<<keys.size()); OPENSSL_LOG("**** with keys: "<<keys.size());
if (!keys.size()) { // add CA-certificate if (!keys.size()) { // add CA-certificate
OPENSSL_LOG("**** add to CA-certificates");
std::string data(cert->attribute(CKA_VALUE).value); std::string data(cert->attribute(CKA_VALUE).value);
cacerts.push_back(QSslCertificate cacerts.push_back(QSslCertificate
(QByteArray(data.data(), data.size()), (QByteArray(data.data(), data.size()),
QSsl::Der)); QSsl::Der));
} else { } else {
OPENSSL_LOG("**** user cert, check for authentictaion");
if (label.value.find("auth")==0 || if (label.value.find("auth")==0 ||
label.value.find("Authentication")<std::string::npos) { label.value.find("Authentication")!=std::string::npos) {
OPENSSL_LOG("**** it's our authentication cert");
std::string data(cert->attribute(CKA_VALUE).value); std::string data(cert->attribute(CKA_VALUE).value);
QSslCertificate c(QByteArray(data.data(), data.size()), QSslCertificate c(QByteArray(data.data(), data.size()),
QSsl::Der); QSsl::Der);
@ -80,6 +83,8 @@ class CryptokiEngine: public openssl::Engine {
QMessageBox::tr("Authentication failed," QMessageBox::tr("Authentication failed,"
" please try again.")); " please try again."));
} }
} else {
OPENSSL_LOG("**** it's not our authentication cert; ignore");
} }
//! @todo show certificate dialog //! @todo show certificate dialog
// std::string data(cert->attribute(CKA_VALUE).value); // std::string data(cert->attribute(CKA_VALUE).value);

Loading…
Cancel
Save