diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-09-01 08:40:40 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-09-01 08:40:40 (GMT) |
commit | aa71e8492b02be079312d39033a54209fb80f9aa (patch) | |
tree | 5970c069625617d21b262b214fdb1ccabe296d2b | |
parent | 1051e9d0dc5cbad27b89756839f3619cae2d44fe (diff) | |
parent | 67d5b1b800df55c61241c7fa33feeeea41a31513 (diff) | |
download | Qt-aa71e8492b02be079312d39033a54209fb80f9aa.zip Qt-aa71e8492b02be079312d39033a54209fb80f9aa.tar.gz Qt-aa71e8492b02be079312d39033a54209fb80f9aa.tar.bz2 |
Merge branch '4.6' of git:qt/qt into 4.6
-rw-r--r-- | src/network/ssl/qsslcertificate.cpp | 6 | ||||
-rw-r--r-- | tests/auto/qsslcertificate/tst_qsslcertificate.cpp | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp index c128da9..3793b1e 100644 --- a/src/network/ssl/qsslcertificate.cpp +++ b/src/network/ssl/qsslcertificate.cpp @@ -252,19 +252,19 @@ QByteArray QSslCertificate::version() const { if (d->versionString.isEmpty() && d->x509) d->versionString = - QByteArray::number(qlonglong(q_ASN1_INTEGER_get(d->x509->cert_info->version))); + QByteArray::number(qlonglong(q_ASN1_INTEGER_get(d->x509->cert_info->version)) + 1); return d->versionString; } /*! - Returns the certificate's serial number string. + Returns the certificate's serial number string in decimal format. */ QByteArray QSslCertificate::serialNumber() const { if (d->serialNumberString.isEmpty() && d->x509) d->serialNumberString = - QByteArray::number(qlonglong(q_ASN1_INTEGER_get(d->x509->cert_info->serialNumber)) + 1); + QByteArray::number(qlonglong(q_ASN1_INTEGER_get(d->x509->cert_info->serialNumber))); return d->serialNumberString; } diff --git a/tests/auto/qsslcertificate/tst_qsslcertificate.cpp b/tests/auto/qsslcertificate/tst_qsslcertificate.cpp index add48c4..4dfb6b9 100644 --- a/tests/auto/qsslcertificate/tst_qsslcertificate.cpp +++ b/tests/auto/qsslcertificate/tst_qsslcertificate.cpp @@ -267,6 +267,8 @@ void tst_QSslCertificate::compareCertificates( QCOMPARE(cert1.alternateSubjectNames(), cert2.alternateSubjectNames()); QCOMPARE(cert1.effectiveDate(), cert2.effectiveDate()); QCOMPARE(cert1.expiryDate(), cert2.expiryDate()); + QCOMPARE(cert1.version(), cert2.version()); + QCOMPARE(cert1.serialNumber(), cert2.serialNumber()); // ### add more functions here ... } @@ -677,7 +679,9 @@ void tst_QSslCertificate::certInfo() QCOMPARE(cert.subjectInfo("C"), QString("NO")); QCOMPARE(cert.subjectInfo("ST"), QString()); - QCOMPARE(cert.version(), QByteArray()); + QCOMPARE(cert.version(), QByteArray::number(1)); + QCOMPARE(cert.serialNumber(), QByteArray::number(17)); + QCOMPARE(cert.toPem().constData(), (const char*)pem); QCOMPARE(cert.toDer(), QByteArray::fromHex(der)); |