Changeset 846 for trunk/src/network/ssl/qsslcertificate.cpp
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/network/ssl/qsslcertificate.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 260 260 /*! 261 261 Returns the certificate's serial number string in decimal format. 262 In case the serial number cannot be converted to decimal format 263 (i.e. if it is bigger than 4294967295, which means it does not fit into 4 bytes), 264 its hexadecimal version is returned. 262 265 */ 263 266 QByteArray QSslCertificate::serialNumber() const 264 267 { 265 if (d->serialNumberString.isEmpty() && d->x509) 266 d->serialNumberString = 267 QByteArray::number(qlonglong(q_ASN1_INTEGER_get(d->x509->cert_info->serialNumber))); 268 268 if (d->serialNumberString.isEmpty() && d->x509) { 269 ASN1_INTEGER *serialNumber = d->x509->cert_info->serialNumber; 270 // if we cannot convert to a long, just output the hexadecimal number 271 if (serialNumber->length > 4) { 272 QByteArray hexString; 273 hexString.reserve(serialNumber->length * 3); 274 for (int a = 0; a < serialNumber->length; ++a) { 275 hexString += QByteArray::number(serialNumber->data[a], 16).rightJustified(2, '0'); 276 hexString += ':'; 277 } 278 hexString.chop(1); 279 d->serialNumberString = hexString; 280 } else { 281 d->serialNumberString = QByteArray::number(qlonglong(q_ASN1_INTEGER_get(serialNumber))); 282 } 283 } 269 284 return d->serialNumberString; 270 285 } … … 534 549 int startIndex = 0; 535 550 if (pathPrefix.trimmed().isEmpty()) { 536 startIndex = 2; 537 pathPrefix = QLatin1String("."); 551 if(path.startsWith(QLatin1Char('/'))) { 552 pathPrefix = path.left(path.indexOf(QRegExp(QLatin1String("[\\*\\?\\[]")))); 553 pathPrefix = path.left(path.lastIndexOf(QLatin1Char('/'))); 554 } else { 555 startIndex = 2; 556 pathPrefix = QLatin1String("."); 557 } 538 558 } 539 559 … … 697 717 static bool matchLineFeed(const QByteArray &pem, int *offset) 698 718 { 699 char ch ;719 char ch = 0; 700 720 701 721 // ignore extra whitespace at the end of the line
Note:
See TracChangeset
for help on using the changeset viewer.