Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-9973

QSslCertificate: serial number is -1 instead of real serial number

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 4.7.0
    • 4.6.2
    • Network: SSL
    • None
    • XP, W7, Linux(Arch)
    • 0f16c7ce8dcd6f4905d14875088c55148e41366a

    Description

      i have written a small app which checks an ssl enabled servers certificate. When I ouput the serial number (lets say www.google.com) it prints out -1.

      QSslConfiguration conf = socket->sslConfiguration();
      this->peercert = conf.peerCertificate();
      qDebug() << this->peercert.serialNumber();

      If i debug the certificate there is a correct one (of course):
      peercert->d->x509->cert_info->serialNumber

      Maybe there is a bug in qsslcertificate.cpp, function serialNumber():

      QByteArray QSslCertificate::serialNumber() const
      {
          // maybe serialNumberString is NOT empty and gets never updated
          if (d->serialNumberString.isEmpty() && d->x509)
              d->serialNumberString =
                  QByteArray::number(qlonglong(q_ASN1_INTEGER_get(d->x509->cert_info->serialNumber)));
      
          return d->serialNumberString;
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            phartman Peter Hartmann (closed Nokia identity) (Inactive)
            tfl Torsten Flammiger
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes