Ignore:
Timestamp:
Mar 8, 2010, 12:52:58 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.2 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/network/ssl/qsslcertificate.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    305305QString QSslCertificate::issuerInfo(SubjectInfo info) const
    306306{
     307    // lazy init
    307308    if (d->issuerInfo.isEmpty() && d->x509)
    308309        d->issuerInfo =
     
    321322QString QSslCertificate::issuerInfo(const QByteArray &tag) const
    322323{
    323     // ### Use a QByteArray for the keys in the map
     324    // lazy init
     325    if (d->issuerInfo.isEmpty() && d->x509)
     326        d->issuerInfo =
     327                _q_mapFromOnelineName(q_X509_NAME_oneline(q_X509_get_issuer_name(d->x509), 0, 0));
     328
    324329    return d->issuerInfo.value(QString::fromLatin1(tag));
    325330}
     
    336341QString QSslCertificate::subjectInfo(SubjectInfo info) const
    337342{
     343    // lazy init
    338344    if (d->subjectInfo.isEmpty() && d->x509)
    339345        d->subjectInfo =
     
    351357QString QSslCertificate::subjectInfo(const QByteArray &tag) const
    352358{
    353     // ### Use a QByteArray for the keys in the map
     359    // lazy init
     360    if (d->subjectInfo.isEmpty() && d->x509)
     361        d->subjectInfo =
     362                _q_mapFromOnelineName(q_X509_NAME_oneline(q_X509_get_subject_name(d->x509), 0, 0));
     363
    354364    return d->subjectInfo.value(QString::fromLatin1(tag));
    355365}
     
    687697static bool matchLineFeed(const QByteArray &pem, int *offset)
    688698{
    689     char ch = pem.at(*offset);
     699    char ch;
    690700
    691701    // ignore extra whitespace at the end of the line
    692     while (ch == ' ' && *offset < pem.size())
    693         ch = pem.at(++*offset);
     702    while (*offset < pem.size() && (ch = pem.at(*offset)) == ' ')
     703        ++*offset;
    694704
    695705    if (ch == '\n') {
     
    723733
    724734        offset = endPos + sizeof(ENDCERTSTRING) - 1;
    725         if (!matchLineFeed(pem, &offset))
     735        if (offset < pem.size() && !matchLineFeed(pem, &offset))
    726736            break;
    727737
Note: See TracChangeset for help on using the changeset viewer.