qsslcertificate_openssl.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/network/ssl/qsslcertificate_openssl.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6static QMap<QByteArray, QString> _q_mapFromX509Name(X509_NAME *name);-
7-
8bool QSslCertificate::operator==(const QSslCertificate &other) const-
9{-
10 if (d == other.d
d == other.dDescription
TRUEevaluated 51 times by 4 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
FALSEevaluated 7118 times by 3 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
)
51-7118
11 return
executed 51 times by 4 tests: return true;
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
true;
executed 51 times by 4 tests: return true;
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
51
12 if (d->null
d->nullDescription
TRUEevaluated 74 times by 3 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
FALSEevaluated 7044 times by 3 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
&& other.d->null
other.d->nullDescription
TRUEevaluated 47 times by 3 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
FALSEevaluated 27 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslsocket - unknown status
)
27-7044
13 return
executed 47 times by 3 tests: return true;
Executed by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
true;
executed 47 times by 3 tests: return true;
Executed by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
47
14 if (d->x509
d->x509Description
TRUEevaluated 7044 times by 3 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
FALSEevaluated 27 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslsocket - unknown status
&& other.d->x509
other.d->x509Description
TRUEevaluated 7040 times by 3 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslsocket - unknown status
)
4-7044
15 return
executed 7040 times by 3 tests: return q_X509_cmp(d->x509, other.d->x509) == 0;
Executed by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
q_X509_cmp(d->x509, other.d->x509) == 0;
executed 7040 times by 3 tests: return q_X509_cmp(d->x509, other.d->x509) == 0;
Executed by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
7040
16 return
executed 31 times by 2 tests: return false;
Executed by:
  • tst_QNetworkReply
  • tst_qsslsocket - unknown status
false;
executed 31 times by 2 tests: return false;
Executed by:
  • tst_QNetworkReply
  • tst_qsslsocket - unknown status
31
17}-
18-
19uint qHash(const QSslCertificate &key, uint seed) noexcept-
20{-
21 if (X509 * const x509 = key.d->x509
X509 * const x... = key.d->x509Description
TRUEnever evaluated
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_qsslcertificate - unknown status
  • tst_qsslerror - unknown status
) {
0-4
22 (void)q_X509_cmp(x509, x509);-
23-
24 return
never executed: return qHashBits(x509->sha1_hash, 20, seed);
qHashBits(x509->sha1_hash, 20, seed);
never executed: return qHashBits(x509->sha1_hash, 20, seed);
0
25 } else {-
26 return
executed 4 times by 2 tests: return seed;
Executed by:
  • tst_qsslcertificate - unknown status
  • tst_qsslerror - unknown status
seed;
executed 4 times by 2 tests: return seed;
Executed by:
  • tst_qsslcertificate - unknown status
  • tst_qsslerror - unknown status
4
27 }-
28}-
29-
30bool QSslCertificate::isNull() const-
31{-
32 return
executed 3707 times by 9 tests: return d->null;
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
d->null;
executed 3707 times by 9 tests: return d->null;
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
3707
33}-
34-
35bool QSslCertificate::isSelfSigned() const-
36{-
37 if (!d->x509
!d->x509Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
)
1-2
38 return
executed 1 time by 1 test: return false;
Executed by:
  • tst_qsslcertificate - unknown status
false;
executed 1 time by 1 test: return false;
Executed by:
  • tst_qsslcertificate - unknown status
1
39-
40 return
executed 2 times by 1 test: return (q_X509_check_issued(d->x509, d->x509) == 0);
Executed by:
  • tst_qsslcertificate - unknown status
(q_X509_check_issued(d->x509, d->x509) == 0);
executed 2 times by 1 test: return (q_X509_check_issued(d->x509, d->x509) == 0);
Executed by:
  • tst_qsslcertificate - unknown status
2
41}-
42-
43QByteArray QSslCertificate::version() const-
44{-
45 QMutexLocker lock(QMutexPool::globalInstanceGet(d.data()));-
46 if (d->versionString.isEmpty()
d->versionString.isEmpty()Description
TRUEevaluated 15 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 64 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
&& d->x509
d->x509Description
TRUEevaluated 13 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
)
2-64
47 d->versionString =
executed 13 times by 1 test: d->versionString = QByteArray::number(qlonglong(q_ASN1_INTEGER_get(d->x509->cert_info->version)) + 1);
Executed by:
  • tst_qsslcertificate - unknown status
13
48 QByteArray::number(qlonglong(q_ASN1_INTEGER_get(d->x509->cert_info->version)) + 1);
executed 13 times by 1 test: d->versionString = QByteArray::number(qlonglong(q_ASN1_INTEGER_get(d->x509->cert_info->version)) + 1);
Executed by:
  • tst_qsslcertificate - unknown status
13
49-
50 return
executed 79 times by 1 test: return d->versionString;
Executed by:
  • tst_qsslcertificate - unknown status
d->versionString;
executed 79 times by 1 test: return d->versionString;
Executed by:
  • tst_qsslcertificate - unknown status
79
51}-
52-
53QByteArray QSslCertificate::serialNumber() const-
54{-
55 QMutexLocker lock(QMutexPool::globalInstanceGet(d.data()));-
56 if (d->serialNumberString.isEmpty()
d->serialNumbe...ring.isEmpty()Description
TRUEevaluated 490 times by 8 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
FALSEevaluated 16564 times by 8 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
&& d->x509
d->x509Description
TRUEevaluated 453 times by 8 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
FALSEevaluated 37 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
) {
37-16564
57 ASN1_INTEGER *serialNumber = d->x509->cert_info->serialNumber;-
58 QByteArray hexString;-
59 hexString.reserve(serialNumber->length * 3);-
60 for (int a = 0; a < serialNumber->length
a < serialNumber->lengthDescription
TRUEevaluated 3564 times by 8 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
FALSEevaluated 453 times by 8 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
; ++a) {
453-3564
61 hexString += QByteArray::number(serialNumber->data[a], 16).rightJustified(2, '0');-
62 hexString += ':';-
63 }
executed 3564 times by 8 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
3564
64 hexString.chop(1);-
65 d->serialNumberString = hexString;-
66 }
executed 453 times by 8 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
453
67 return
executed 17054 times by 8 tests: return d->serialNumberString;
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
d->serialNumberString;
executed 17054 times by 8 tests: return d->serialNumberString;
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
17054
68}-
69-
70QStringList QSslCertificate::issuerInfo(SubjectInfo info) const-
71{-
72 QMutexLocker lock(QMutexPool::globalInstanceGet(d.data()));-
73-
74 if (d->issuerInfo.isEmpty()
d->issuerInfo.isEmpty()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 213 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
&& d->x509
d->x509Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
)
1-213
75 d->issuerInfo =
executed 11 times by 1 test: d->issuerInfo = _q_mapFromX509Name(q_X509_get_issuer_name(d->x509));
Executed by:
  • tst_qsslcertificate - unknown status
11
76 _q_mapFromX509Name(q_X509_get_issuer_name(d->x509));
executed 11 times by 1 test: d->issuerInfo = _q_mapFromX509Name(q_X509_get_issuer_name(d->x509));
Executed by:
  • tst_qsslcertificate - unknown status
11
77-
78 return
executed 225 times by 1 test: return d->issuerInfo.values(d->subjectInfoToString(info));
Executed by:
  • tst_qsslcertificate - unknown status
d->issuerInfo.values(d->subjectInfoToString(info));
executed 225 times by 1 test: return d->issuerInfo.values(d->subjectInfoToString(info));
Executed by:
  • tst_qsslcertificate - unknown status
225
79}-
80-
81QStringList QSslCertificate::issuerInfo(const QByteArray &attribute) const-
82{-
83 QMutexLocker lock(QMutexPool::globalInstanceGet(d.data()));-
84-
85 if (d->issuerInfo.isEmpty()
d->issuerInfo.isEmpty()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
&& d->x509
d->x509Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEnever evaluated
)
0-6
86 d->issuerInfo =
executed 1 time by 1 test: d->issuerInfo = _q_mapFromX509Name(q_X509_get_issuer_name(d->x509));
Executed by:
  • tst_qsslcertificate - unknown status
1
87 _q_mapFromX509Name(q_X509_get_issuer_name(d->x509));
executed 1 time by 1 test: d->issuerInfo = _q_mapFromX509Name(q_X509_get_issuer_name(d->x509));
Executed by:
  • tst_qsslcertificate - unknown status
1
88-
89 return
executed 7 times by 1 test: return d->issuerInfo.values(attribute);
Executed by:
  • tst_qsslcertificate - unknown status
d->issuerInfo.values(attribute);
executed 7 times by 1 test: return d->issuerInfo.values(attribute);
Executed by:
  • tst_qsslcertificate - unknown status
7
90}-
91-
92QStringList QSslCertificate::subjectInfo(SubjectInfo info) const-
93{-
94 QMutexLocker lock(QMutexPool::globalInstanceGet(d.data()));-
95-
96 if (d->subjectInfo.isEmpty()
d->subjectInfo.isEmpty()Description
TRUEevaluated 417 times by 8 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
FALSEevaluated 214 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
&& d->x509
d->x509Description
TRUEevaluated 416 times by 8 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
)
1-417
97 d->subjectInfo =
executed 416 times by 8 tests: d->subjectInfo = _q_mapFromX509Name(q_X509_get_subject_name(d->x509));
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
416
98 _q_mapFromX509Name(q_X509_get_subject_name(d->x509));
executed 416 times by 8 tests: d->subjectInfo = _q_mapFromX509Name(q_X509_get_subject_name(d->x509));
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
416
99-
100 return
executed 631 times by 8 tests: return d->subjectInfo.values(d->subjectInfoToString(info));
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
d->subjectInfo.values(d->subjectInfoToString(info));
executed 631 times by 8 tests: return d->subjectInfo.values(d->subjectInfoToString(info));
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
631
101}-
102-
103QStringList QSslCertificate::subjectInfo(const QByteArray &attribute) const-
104{-
105 QMutexLocker lock(QMutexPool::globalInstanceGet(d.data()));-
106-
107 if (d->subjectInfo.isEmpty()
d->subjectInfo.isEmpty()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 9 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
&& d->x509
d->x509Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEnever evaluated
)
0-9
108 d->subjectInfo =
executed 2 times by 1 test: d->subjectInfo = _q_mapFromX509Name(q_X509_get_subject_name(d->x509));
Executed by:
  • tst_qsslcertificate - unknown status
2
109 _q_mapFromX509Name(q_X509_get_subject_name(d->x509));
executed 2 times by 1 test: d->subjectInfo = _q_mapFromX509Name(q_X509_get_subject_name(d->x509));
Executed by:
  • tst_qsslcertificate - unknown status
2
110-
111 return
executed 11 times by 1 test: return d->subjectInfo.values(attribute);
Executed by:
  • tst_qsslcertificate - unknown status
d->subjectInfo.values(attribute);
executed 11 times by 1 test: return d->subjectInfo.values(attribute);
Executed by:
  • tst_qsslcertificate - unknown status
11
112}-
113-
114QList<QByteArray> QSslCertificate::subjectInfoAttributes() const-
115{-
116 QMutexLocker lock(QMutexPool::globalInstanceGet(d.data()));-
117-
118 if (d->subjectInfo.isEmpty()
d->subjectInfo.isEmpty()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
&& d->x509
d->x509Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEnever evaluated
)
0-2
119 d->subjectInfo =
executed 2 times by 1 test: d->subjectInfo = _q_mapFromX509Name(q_X509_get_subject_name(d->x509));
Executed by:
  • tst_qsslcertificate - unknown status
2
120 _q_mapFromX509Name(q_X509_get_subject_name(d->x509));
executed 2 times by 1 test: d->subjectInfo = _q_mapFromX509Name(q_X509_get_subject_name(d->x509));
Executed by:
  • tst_qsslcertificate - unknown status
2
121-
122 return
executed 4 times by 1 test: return d->subjectInfo.uniqueKeys();
Executed by:
  • tst_qsslcertificate - unknown status
d->subjectInfo.uniqueKeys();
executed 4 times by 1 test: return d->subjectInfo.uniqueKeys();
Executed by:
  • tst_qsslcertificate - unknown status
4
123}-
124-
125QList<QByteArray> QSslCertificate::issuerInfoAttributes() const-
126{-
127 QMutexLocker lock(QMutexPool::globalInstanceGet(d.data()));-
128-
129 if (d->issuerInfo.isEmpty()
d->issuerInfo.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
&& d->x509
d->x509Description
TRUEnever evaluated
FALSEnever evaluated
)
0-2
130 d->issuerInfo =
never executed: d->issuerInfo = _q_mapFromX509Name(q_X509_get_issuer_name(d->x509));
0
131 _q_mapFromX509Name(q_X509_get_issuer_name(d->x509));
never executed: d->issuerInfo = _q_mapFromX509Name(q_X509_get_issuer_name(d->x509));
0
132-
133 return
executed 2 times by 1 test: return d->issuerInfo.uniqueKeys();
Executed by:
  • tst_qsslcertificate - unknown status
d->issuerInfo.uniqueKeys();
executed 2 times by 1 test: return d->issuerInfo.uniqueKeys();
Executed by:
  • tst_qsslcertificate - unknown status
2
134}-
135-
136QMultiMap<QSsl::AlternativeNameEntryType, QString> QSslCertificate::subjectAlternativeNames() const-
137{-
138 QMultiMap<QSsl::AlternativeNameEntryType, QString> result;-
139-
140 if (!d->x509
!d->x509Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 102 times by 3 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
)
1-102
141 return
executed 1 time by 1 test: return result;
Executed by:
  • tst_qsslcertificate - unknown status
result;
executed 1 time by 1 test: return result;
Executed by:
  • tst_qsslcertificate - unknown status
1
142-
143 struct stack_st_GENERAL_NAME *altNames = (struct stack_st_GENERAL_NAME*)q_X509_get_ext_d2i(d->x509, 85, 0, 0);-
144-
145 if (altNames
altNamesDescription
TRUEevaluated 11 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 91 times by 3 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
) {
11-91
146 for (int i = 0; i < ((int (*)(const struct stack_st_GENERAL_NAME *))q_sk_num)((altNames))
i < ((int (*)(...m)((altNames))Description
TRUEevaluated 31 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 11 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
; ++i) {
11-31
147 const GENERAL_NAME *genName = ((GENERAL_NAME * (*)(const struct stack_st_GENERAL_NAME *, int))q_sk_value)((altNames), (i));-
148 if (genName->type != 2
genName->type != 2Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 11 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
&& genName->type != 1
genName->type != 1Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
)
0-20
149 continue;
never executed: continue;
0
150-
151 int len = q_ASN1_STRING_length(genName->d.ia5);-
152 if (len < 0
len < 0Description
TRUEnever evaluated
FALSEevaluated 31 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
|| len >= 8192
len >= 8192Description
TRUEnever evaluated
FALSEevaluated 31 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
) {
0-31
153-
154 continue;
never executed: continue;
0
155 }-
156-
157 const char *altNameStr = reinterpret_cast<const char *>(q_ASN1_STRING_data(genName->d.ia5));-
158 const QString altName = QString::fromLatin1(altNameStr, len);-
159 if (genName->type == 2
genName->type == 2Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
)
11-20
160 result.insert(QSsl::DnsEntry, altName);
executed 11 times by 1 test: result.insert(QSsl::DnsEntry, altName);
Executed by:
  • tst_qsslcertificate - unknown status
11
161 else if (genName->type == 1
genName->type == 1Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEnever evaluated
)
0-20
162 result.insert(QSsl::EmailEntry, altName);
executed 20 times by 1 test: result.insert(QSsl::EmailEntry, altName);
Executed by:
  • tst_qsslcertificate - unknown status
20
163 }
executed 31 times by 1 test: end of block
Executed by:
  • tst_qsslcertificate - unknown status
31
164 q_sk_pop_free((STACK*)altNames, reinterpret_cast<void(*)(void*)>(q_sk_free));-
165 }
executed 11 times by 1 test: end of block
Executed by:
  • tst_qsslcertificate - unknown status
11
166-
167 return
executed 102 times by 3 tests: return result;
Executed by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
result;
executed 102 times by 3 tests: return result;
Executed by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
102
168}-
169-
170QDateTime QSslCertificate::effectiveDate() const-
171{-
172 return
executed 41 times by 1 test: return d->notValidBefore;
Executed by:
  • tst_qsslcertificate - unknown status
d->notValidBefore;
executed 41 times by 1 test: return d->notValidBefore;
Executed by:
  • tst_qsslcertificate - unknown status
41
173}-
174-
175QDateTime QSslCertificate::expiryDate() const-
176{-
177 return
executed 57430 times by 4 tests: return d->notValidAfter;
Executed by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
d->notValidAfter;
executed 57430 times by 4 tests: return d->notValidAfter;
Executed by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
57430
178}-
179-
180Qt::HANDLE QSslCertificate::handle() const-
181{-
182 return
executed 53884 times by 4 tests: return Qt::HANDLE(d->x509);
Executed by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
Qt::HANDLE(d->x509);
executed 53884 times by 4 tests: return Qt::HANDLE(d->x509);
Executed by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
53884
183}-
184-
185QSslKey QSslCertificate::publicKey() const-
186{-
187 if (!d->x509
!d->x509Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
)
0-8
188 return
never executed: return QSslKey();
QSslKey();
never executed: return QSslKey();
0
189-
190 QSslKey key;-
191-
192 key.d->type = QSsl::PublicKey;-
193 X509_PUBKEY *xkey = d->x509->cert_info->key;-
194 EVP_PKEY *pkey = q_X509_PUBKEY_get(xkey);-
195 ((!(pkey)) ? qt_assert("pkey",__FILE__,240) : qt_noop());-
196-
197 if (q_EVP_PKEY_type(pkey->type) == 6
q_EVP_PKEY_typ...ey->type) == 6Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
) {
2-6
198 key.d->rsa = q_EVP_PKEY_get1_RSA(pkey);-
199 key.d->algorithm = QSsl::Rsa;-
200 key.d->isNull = false;-
201 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qsslcertificate - unknown status
else if (q_EVP_PKEY_type(pkey->type) == 116
q_EVP_PKEY_typ...->type) == 116Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
) {
1-6
202 key.d->dsa = q_EVP_PKEY_get1_DSA(pkey);-
203 key.d->algorithm = QSsl::Dsa;-
204 key.d->isNull = false;-
205-
206 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_qsslcertificate - unknown status
else if (q_EVP_PKEY_type(pkey->type) == 408
q_EVP_PKEY_typ...->type) == 408Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEnever evaluated
) {
0-1
207 key.d->ec = q_EVP_PKEY_get1_EC_KEY(pkey);-
208 key.d->algorithm = QSsl::Ec;-
209 key.d->isNull = false;-
210-
211 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_qsslcertificate - unknown status
else if (q_EVP_PKEY_type(pkey->type) == 28
q_EVP_PKEY_typ...y->type) == 28Description
TRUEnever evaluated
FALSEnever evaluated
) {
0-1
212-
213 }
never executed: end of block
else {
0
214-
215 }
never executed: end of block
0
216-
217 q_EVP_PKEY_free(pkey);-
218 return
executed 8 times by 1 test: return key;
Executed by:
  • tst_qsslcertificate - unknown status
key;
executed 8 times by 1 test: return key;
Executed by:
  • tst_qsslcertificate - unknown status
8
219}-
220-
221-
222-
223-
224static QVariant x509UnknownExtensionToValue(X509_EXTENSION *ext)-
225{-
226-
227-
228-
229-
230 X509V3_EXT_METHOD *meth = const_cast<X509V3_EXT_METHOD *>(q_X509V3_EXT_get(ext));-
231 if (!meth
!methDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 9 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
) {
1-9
232 ASN1_OCTET_STRING *value = q_X509_EXTENSION_get_data(ext);-
233 QByteArray result( reinterpret_cast<const char *>(q_ASN1_STRING_data(value)),-
234 q_ASN1_STRING_length(value));-
235 return
executed 1 time by 1 test: return result;
Executed by:
  • tst_qsslcertificate - unknown status
result;
executed 1 time by 1 test: return result;
Executed by:
  • tst_qsslcertificate - unknown status
1
236 }-
237-
238-
239 void *ext_internal = q_X509V3_EXT_d2i(ext);-
240-
241-
242 if (meth->i2v
meth->i2vDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
&& ext_internal
ext_internalDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEnever evaluated
) {
0-5
243 struct stack_st_CONF_VALUE *val = meth->i2v(meth, ext_internal, 0);-
244-
245 QVariantMap map;-
246 QVariantList list;-
247 bool isMap = false;-
248-
249 for (int j = 0; j < ((int (*)(const struct stack_st_CONF_VALUE *))q_sk_num)(val)
j < ((int (*)(...q_sk_num)(val)Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
; j++) {
5-12
250 CONF_VALUE *nval = ((CONF_VALUE * (*)(const struct stack_st_CONF_VALUE *, int))q_sk_value)(val, j);-
251 if (nval->name
nval->nameDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
&& nval->value
nval->valueDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
) {
2-6
252 isMap = true;-
253 map[QString::fromUtf8(nval->name)] = QString::fromUtf8(nval->value);-
254 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qsslcertificate - unknown status
else if (nval->name
nval->nameDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
) {
2-6
255 list << QString::fromUtf8(nval->name);-
256 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qsslcertificate - unknown status
else if (nval->value
nval->valueDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEnever evaluated
) {
0-6
257 list << QString::fromUtf8(nval->value);-
258 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qsslcertificate - unknown status
6
259 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_qsslcertificate - unknown status
12
260-
261 if (isMap
isMapDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
)
1-4
262 return
executed 1 time by 1 test: return map;
Executed by:
  • tst_qsslcertificate - unknown status
map;
executed 1 time by 1 test: return map;
Executed by:
  • tst_qsslcertificate - unknown status
1
263 else-
264 return
executed 4 times by 1 test: return list;
Executed by:
  • tst_qsslcertificate - unknown status
list;
executed 4 times by 1 test: return list;
Executed by:
  • tst_qsslcertificate - unknown status
4
265 } else if (meth->i2s
meth->i2sDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
&& ext_internal
ext_internalDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0-4
266-
267 QVariant result(QString::fromUtf8(meth->i2s(meth, ext_internal)));-
268 return
never executed: return result;
result;
never executed: return result;
0
269 } else if (meth->i2r
meth->i2rDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEnever evaluated
&& ext_internal
ext_internalDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEnever evaluated
) {
0-4
270 QByteArray result;-
271-
272 BIO *bio = q_BIO_new(q_BIO_s_mem());-
273 if (!bio
!bioDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
)
0-4
274 return
never executed: return result;
result;
never executed: return result;
0
275-
276 meth->i2r(meth, ext_internal, bio, 0);-
277-
278 char *bio_buffer;-
279 long bio_size = (int)q_BIO_ctrl(bio,3,0,(char *)&bio_buffer);-
280 result = QByteArray(bio_buffer, bio_size);-
281-
282 q_BIO_free(bio);-
283 return
executed 4 times by 1 test: return result;
Executed by:
  • tst_qsslcertificate - unknown status
result;
executed 4 times by 1 test: return result;
Executed by:
  • tst_qsslcertificate - unknown status
4
284 }-
285-
286 return
never executed: return QVariant();
QVariant();
never executed: return QVariant();
0
287}-
288-
289-
290-
291-
292-
293-
294static QVariant x509ExtensionToValue(X509_EXTENSION *ext)-
295{-
296 ASN1_OBJECT *obj = q_X509_EXTENSION_get_object(ext);-
297 int nid = q_OBJ_obj2nid(obj);-
298-
299 switch (nid) {-
300 case
executed 2 times by 1 test: case 87:
Executed by:
  • tst_qsslcertificate - unknown status
87:
executed 2 times by 1 test: case 87:
Executed by:
  • tst_qsslcertificate - unknown status
2
301 {-
302 BASIC_CONSTRAINTS *basic = reinterpret_cast<BASIC_CONSTRAINTS *>(q_X509V3_EXT_d2i(ext));-
303-
304 QVariantMap result;-
305 result[QLatin1String("ca")] = basic->ca
basic->caDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
? true : false;
0-2
306 if (basic->pathlen
basic->pathlenDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
)
0-2
307 result[QLatin1String("pathLenConstraint")] = (qlonglong)q_ASN1_INTEGER_get(basic->pathlen);
never executed: result[QLatin1String("pathLenConstraint")] = (qlonglong)q_ASN1_INTEGER_get(basic->pathlen);
0
308-
309 q_BASIC_CONSTRAINTS_free(basic);-
310 return
executed 2 times by 1 test: return result;
Executed by:
  • tst_qsslcertificate - unknown status
result;
executed 2 times by 1 test: return result;
Executed by:
  • tst_qsslcertificate - unknown status
2
311 }-
312 break;
dead code: break;
-
313 case
executed 2 times by 1 test: case 177:
Executed by:
  • tst_qsslcertificate - unknown status
177:
executed 2 times by 1 test: case 177:
Executed by:
  • tst_qsslcertificate - unknown status
2
314 {-
315 AUTHORITY_INFO_ACCESS *info = reinterpret_cast<AUTHORITY_INFO_ACCESS *>(q_X509V3_EXT_d2i(ext));-
316-
317 QVariantMap result;-
318 for (int i=0; i < ((int (*)(const struct stack_st_ACCESS_DESCRIPTION *))q_sk_num)(info)
i < ((int (*)(..._sk_num)(info)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
; i++) {
2-4
319 ACCESS_DESCRIPTION *ad = ((ACCESS_DESCRIPTION * (*)(const struct stack_st_ACCESS_DESCRIPTION *, int))q_sk_value)(info, i);-
320-
321 GENERAL_NAME *name = ad->location;-
322 if (name->type == 6
name->type == 6Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEnever evaluated
) {
0-4
323 int len = q_ASN1_STRING_length(name->d.uniformResourceIdentifier);-
324 if (len < 0
len < 0Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
|| len >= 8192
len >= 8192Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
) {
0-4
325-
326 continue;
never executed: continue;
0
327 }-
328-
329 const char *uriStr = reinterpret_cast<const char *>(q_ASN1_STRING_data(name->d.uniformResourceIdentifier));-
330 const QString uri = QString::fromUtf8(uriStr, len);-
331-
332 result[QString::fromUtf8(QSslCertificatePrivate::asn1ObjectName(ad->method))] = uri;-
333 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qsslcertificate - unknown status
else {
4
334 for (bool qt_category_enabled = lcSsl().isWarningEnabled(); qt_category_enabled
qt_category_enabledDescription
TRUEnever evaluated
FALSEnever evaluated
; qt_category_enabled = false) QMessageLogger(__FILE__, 379, __PRETTY_FUNCTION__, lcSsl().categoryName()).warning() << "Strange location type" << name->type;
never executed: QMessageLogger(__FILE__, 379, __PRETTY_FUNCTION__, lcSsl().categoryName()).warning() << "Strange location type" << name->type;
0
335 }
never executed: end of block
0
336 }-
337-
338-
339 q_sk_pop_free((_STACK*)info, reinterpret_cast<void(*)(void*)>(q_sk_free));-
340-
341-
342-
343 return
executed 2 times by 1 test: return result;
Executed by:
  • tst_qsslcertificate - unknown status
result;
executed 2 times by 1 test: return result;
Executed by:
  • tst_qsslcertificate - unknown status
2
344 }-
345 break;
dead code: break;
-
346 case
executed 2 times by 1 test: case 82:
Executed by:
  • tst_qsslcertificate - unknown status
82:
executed 2 times by 1 test: case 82:
Executed by:
  • tst_qsslcertificate - unknown status
2
347 {-
348 void *ext_internal = q_X509V3_EXT_d2i(ext);-
349-
350-
351-
352-
353 X509V3_EXT_METHOD *meth = const_cast<X509V3_EXT_METHOD *>(q_X509V3_EXT_get(ext));-
354-
355 return
executed 2 times by 1 test: return QVariant(QString::fromUtf8(meth->i2s(meth, ext_internal)));
Executed by:
  • tst_qsslcertificate - unknown status
QVariant(QString::fromUtf8(meth->i2s(meth, ext_internal)));
executed 2 times by 1 test: return QVariant(QString::fromUtf8(meth->i2s(meth, ext_internal)));
Executed by:
  • tst_qsslcertificate - unknown status
2
356 }-
357 break;
dead code: break;
-
358 case
executed 2 times by 1 test: case 90:
Executed by:
  • tst_qsslcertificate - unknown status
90:
executed 2 times by 1 test: case 90:
Executed by:
  • tst_qsslcertificate - unknown status
2
359 {-
360 AUTHORITY_KEYID *auth_key = reinterpret_cast<AUTHORITY_KEYID *>(q_X509V3_EXT_d2i(ext));-
361-
362 QVariantMap result;-
363-
364-
365 if (auth_key->keyid
auth_key->keyidDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEnever evaluated
) {
0-2
366 QByteArray keyid(reinterpret_cast<const char *>(auth_key->keyid->data),-
367 auth_key->keyid->length);-
368 result[QLatin1String("keyid")] = keyid.toHex();-
369 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qsslcertificate - unknown status
2
370-
371-
372-
373-
374-
375 if (auth_key->serial
auth_key->serialDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
)
0-2
376 result[QLatin1String("serial")] = (qlonglong)q_ASN1_INTEGER_get(auth_key->serial);
never executed: result[QLatin1String("serial")] = (qlonglong)q_ASN1_INTEGER_get(auth_key->serial);
0
377-
378 q_AUTHORITY_KEYID_free(auth_key);-
379 return
executed 2 times by 1 test: return result;
Executed by:
  • tst_qsslcertificate - unknown status
result;
executed 2 times by 1 test: return result;
Executed by:
  • tst_qsslcertificate - unknown status
2
380 }-
381 break;
dead code: break;
-
382 }-
383-
384 return
executed 10 times by 1 test: return QVariant();
Executed by:
  • tst_qsslcertificate - unknown status
QVariant();
executed 10 times by 1 test: return QVariant();
Executed by:
  • tst_qsslcertificate - unknown status
10
385}-
386-
387QSslCertificateExtension QSslCertificatePrivate::convertExtension(X509_EXTENSION *ext)-
388{-
389 QSslCertificateExtension result;-
390-
391 ASN1_OBJECT *obj = q_X509_EXTENSION_get_object(ext);-
392 QByteArray oid = QSslCertificatePrivate::asn1ObjectId(obj);-
393 QByteArray name = QSslCertificatePrivate::asn1ObjectName(obj);-
394-
395 result.d->oid = QString::fromUtf8(oid);-
396 result.d->name = QString::fromUtf8(name);-
397-
398 bool critical = q_X509_EXTENSION_get_critical(ext);-
399 result.d->critical = critical;-
400-
401-
402 QVariant extensionValue = x509ExtensionToValue(ext);-
403 if (extensionValue.isValid()
extensionValue.isValid()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
) {
8-10
404 result.d->value = extensionValue;-
405 result.d->supported = true;-
406-
407 return
executed 8 times by 1 test: return result;
Executed by:
  • tst_qsslcertificate - unknown status
result;
executed 8 times by 1 test: return result;
Executed by:
  • tst_qsslcertificate - unknown status
8
408 }-
409-
410 extensionValue = x509UnknownExtensionToValue(ext);-
411 if (extensionValue.isValid()
extensionValue.isValid()Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEnever evaluated
) {
0-10
412 result.d->value = extensionValue;-
413 result.d->supported = false;-
414 return
executed 10 times by 1 test: return result;
Executed by:
  • tst_qsslcertificate - unknown status
result;
executed 10 times by 1 test: return result;
Executed by:
  • tst_qsslcertificate - unknown status
10
415 }-
416-
417 return
never executed: return result;
result;
never executed: return result;
0
418}-
419-
420QList<QSslCertificateExtension> QSslCertificate::extensions() const-
421{-
422 QList<QSslCertificateExtension> result;-
423-
424 if (!d->x509
!d->x509Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
)
0-4
425 return
never executed: return result;
result;
never executed: return result;
0
426-
427 int count = q_X509_get_ext_count(d->x509);-
428 result.reserve(count);-
429-
430 for (int i = 0; i < count
i < countDescription
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
; i++) {
4-18
431 X509_EXTENSION *ext = q_X509_get_ext(d->x509, i);-
432 result << QSslCertificatePrivate::convertExtension(ext);-
433 }
executed 18 times by 1 test: end of block
Executed by:
  • tst_qsslcertificate - unknown status
18
434-
435 return
executed 4 times by 1 test: return result;
Executed by:
  • tst_qsslcertificate - unknown status
result;
executed 4 times by 1 test: return result;
Executed by:
  • tst_qsslcertificate - unknown status
4
436}-
437-
438QByteArray QSslCertificate::toPem() const-
439{-
440 if (!d->x509
!d->x509Description
TRUEnever evaluated
FALSEevaluated 47 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
)
0-47
441 return
never executed: return QByteArray();
QByteArray();
never executed: return QByteArray();
0
442 return
executed 47 times by 1 test: return d->QByteArray_from_X509(d->x509, QSsl::Pem);
Executed by:
  • tst_qsslcertificate - unknown status
d->QByteArray_from_X509(d->x509, QSsl::Pem);
executed 47 times by 1 test: return d->QByteArray_from_X509(d->x509, QSsl::Pem);
Executed by:
  • tst_qsslcertificate - unknown status
47
443}-
444-
445QByteArray QSslCertificate::toDer() const-
446{-
447 if (!d->x509
!d->x509Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 89 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
)
1-89
448 return
executed 1 time by 1 test: return QByteArray();
Executed by:
  • tst_qsslcertificate - unknown status
QByteArray();
executed 1 time by 1 test: return QByteArray();
Executed by:
  • tst_qsslcertificate - unknown status
1
449 return
executed 89 times by 1 test: return d->QByteArray_from_X509(d->x509, QSsl::Der);
Executed by:
  • tst_qsslcertificate - unknown status
d->QByteArray_from_X509(d->x509, QSsl::Der);
executed 89 times by 1 test: return d->QByteArray_from_X509(d->x509, QSsl::Der);
Executed by:
  • tst_qsslcertificate - unknown status
89
450}-
451-
452QString QSslCertificate::toText() const-
453{-
454 if (!d->x509
!d->x509Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
)
0-3
455 return
never executed: return QString();
QString();
never executed: return QString();
0
456 return
executed 3 times by 1 test: return d->text_from_X509(d->x509);
Executed by:
  • tst_qsslcertificate - unknown status
d->text_from_X509(d->x509);
executed 3 times by 1 test: return d->text_from_X509(d->x509);
Executed by:
  • tst_qsslcertificate - unknown status
3
457}-
458-
459-
460-
461-
462void QSslCertificatePrivate::init(const QByteArray &data, QSsl::EncodingFormat format)-
463{-
464 if (!data.isEmpty()
!data.isEmpty()Description
TRUEevaluated 73 times by 3 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
FALSEevaluated 30192 times by 16 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslellipticcurve - unknown status
  • tst_qsslerror - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
) {
73-30192
465 const QList<QSslCertificate> certs = (
(format == QSsl::Pem)Description
TRUEevaluated 60 times by 3 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
FALSEevaluated 13 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
format == QSsl::Pem)
(format == QSsl::Pem)Description
TRUEevaluated 60 times by 3 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
FALSEevaluated 13 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
13-60
466 ? certificatesFromPem(data, 1)-
467 : certificatesFromDer(data, 1);-
468 if (!certs.isEmpty()
!certs.isEmpty()Description
TRUEevaluated 70 times by 3 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
) {
3-70
469 *this = *certs.first().d;-
470 if (x509
x509Description
TRUEevaluated 70 times by 3 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
FALSEnever evaluated
)
0-70
471 x509 = q_X509_dup(x509);
executed 70 times by 3 tests: x509 = q_X509_dup(x509);
Executed by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
70
472 }
executed 70 times by 3 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
70
473 }
executed 73 times by 3 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
73
474}
executed 30265 times by 16 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslellipticcurve - unknown status
  • tst_qsslerror - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
30265
475-
476-
477QByteArray QSslCertificatePrivate::QByteArray_from_X509(X509 *x509, QSsl::EncodingFormat format)-
478{-
479 if (!x509
!x509Description
TRUEnever evaluated
FALSEevaluated 136 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
) {
0-136
480 for (bool qt_category_enabled = lcSsl().isWarningEnabled(); qt_category_enabled
qt_category_enabledDescription
TRUEnever evaluated
FALSEnever evaluated
; qt_category_enabled = false) QMessageLogger(__FILE__, 525, __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslSocketBackendPrivate::X509_to_QByteArray: null X509");
never executed: QMessageLogger(__FILE__, 525, __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslSocketBackendPrivate::X509_to_QByteArray: null X509");
0
481 return
never executed: return QByteArray();
QByteArray();
never executed: return QByteArray();
0
482 }-
483-
484-
485 int length = q_i2d_X509(x509, 0);-
486 QByteArray array;-
487 array.resize(length);-
488 char *data = array.data();-
489 char **dataP = &data;-
490 unsigned char **dataPu = (unsigned char **)dataP;-
491 if (q_i2d_X509(x509, dataPu) < 0
q_i2d_X509(x509, dataPu) < 0Description
TRUEnever evaluated
FALSEevaluated 136 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
)
0-136
492 return
never executed: return QByteArray();
QByteArray();
never executed: return QByteArray();
0
493-
494 if (format == QSsl::Der
format == QSsl::DerDescription
TRUEevaluated 89 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 47 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
)
47-89
495 return
executed 89 times by 1 test: return array;
Executed by:
  • tst_qsslcertificate - unknown status
array;
executed 89 times by 1 test: return array;
Executed by:
  • tst_qsslcertificate - unknown status
89
496-
497-
498 array = array.toBase64();-
499 QByteArray tmp;-
500 for (int i = 0; i <= array.size() - 64
i <= array.size() - 64Description
TRUEevaluated 518 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 47 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
; i += 64) {
47-518
501 tmp += QByteArray::fromRawData(array.data() + i, 64);-
502 tmp += '\n';-
503 }
executed 518 times by 1 test: end of block
Executed by:
  • tst_qsslcertificate - unknown status
518
504 if (int remainder = array.size() % 64
int remainder ...ay.size() % 64Description
TRUEevaluated 46 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
) {
1-46
505 tmp += QByteArray::fromRawData(array.data() + array.size() - remainder, remainder);-
506 tmp += '\n';-
507 }
executed 46 times by 1 test: end of block
Executed by:
  • tst_qsslcertificate - unknown status
46
508-
509 return
executed 47 times by 1 test: return "-----BEGIN CERTIFICATE-----" "\n" + tmp + "-----END CERTIFICATE-----" "\n";
Executed by:
  • tst_qsslcertificate - unknown status
"-----BEGIN CERTIFICATE-----" "\n" + tmp + "-----END CERTIFICATE-----" "\n";
executed 47 times by 1 test: return "-----BEGIN CERTIFICATE-----" "\n" + tmp + "-----END CERTIFICATE-----" "\n";
Executed by:
  • tst_qsslcertificate - unknown status
47
510}-
511-
512QString QSslCertificatePrivate::text_from_X509(X509 *x509)-
513{-
514 if (!x509
!x509Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
) {
0-3
515 for (bool qt_category_enabled = lcSsl().isWarningEnabled(); qt_category_enabled
qt_category_enabledDescription
TRUEnever evaluated
FALSEnever evaluated
; qt_category_enabled = false) QMessageLogger(__FILE__, 560, __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslSocketBackendPrivate::text_from_X509: null X509");
never executed: QMessageLogger(__FILE__, 560, __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslSocketBackendPrivate::text_from_X509: null X509");
0
516 return
never executed: return QString();
QString();
never executed: return QString();
0
517 }-
518-
519 QByteArray result;-
520 BIO *bio = q_BIO_new(q_BIO_s_mem());-
521 if (!bio
!bioDescription
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
)
0-3
522 return
never executed: return QString();
QString();
never executed: return QString();
0
523-
524 q_X509_print(bio, x509);-
525-
526 QVarLengthArray<char, 16384> data;-
527 int count = q_BIO_read(bio, data.data(), 16384);-
528 if ( count > 0
count > 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEnever evaluated
) {
0-3
529 result = QByteArray( data.data(), count );-
530 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_qsslcertificate - unknown status
3
531-
532 q_BIO_free(bio);-
533-
534 return
executed 3 times by 1 test: return QString::fromLatin1(result);
Executed by:
  • tst_qsslcertificate - unknown status
QString::fromLatin1(result);
executed 3 times by 1 test: return QString::fromLatin1(result);
Executed by:
  • tst_qsslcertificate - unknown status
3
535}-
536-
537QByteArray QSslCertificatePrivate::asn1ObjectId(ASN1_OBJECT *object)-
538{-
539 char buf[80];-
540 q_OBJ_obj2txt(buf, sizeof(buf), object, 1);-
541-
542 return
executed 20 times by 1 test: return QByteArray(buf);
Executed by:
  • tst_qsslcertificate - unknown status
QByteArray(buf);
executed 20 times by 1 test: return QByteArray(buf);
Executed by:
  • tst_qsslcertificate - unknown status
20
543}-
544-
545-
546QByteArray QSslCertificatePrivate::asn1ObjectName(ASN1_OBJECT *object)-
547{-
548 int nid = q_OBJ_obj2nid(object);-
549 if (nid != 0
nid != 0Description
TRUEevaluated 2739 times by 8 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
)
2-2739
550 return
executed 2739 times by 8 tests: return QByteArray(q_OBJ_nid2sn(nid));
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
QByteArray(q_OBJ_nid2sn(nid));
executed 2739 times by 8 tests: return QByteArray(q_OBJ_nid2sn(nid));
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
2739
551-
552 return
executed 2 times by 1 test: return asn1ObjectId(object);
Executed by:
  • tst_qsslcertificate - unknown status
asn1ObjectId(object);
executed 2 times by 1 test: return asn1ObjectId(object);
Executed by:
  • tst_qsslcertificate - unknown status
2
553}-
554-
555static QMap<QByteArray, QString> _q_mapFromX509Name(X509_NAME *name)-
556{-
557 QMap<QByteArray, QString> info;-
558 for (int i = 0; i < q_X509_NAME_entry_count(name)
i < q_X509_NAM...ry_count(name)Description
TRUEevaluated 2719 times by 8 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
FALSEevaluated 432 times by 8 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
; ++i) {
432-2719
559 X509_NAME_ENTRY *e = q_X509_NAME_get_entry(name, i);-
560-
561 QByteArray name = QSslCertificatePrivate::asn1ObjectName(q_X509_NAME_ENTRY_get_object(e));-
562 unsigned char *data = 0;-
563 int size = q_ASN1_STRING_to_UTF8(&data, q_X509_NAME_ENTRY_get_data(e));-
564 info.insertMulti(name, QString::fromUtf8((char*)data, size));-
565 q_CRYPTO_free(data);-
566 }
executed 2719 times by 8 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
2719
567-
568 return
executed 432 times by 8 tests: return info;
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
info;
executed 432 times by 8 tests: return info;
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
432
569}-
570-
571QSslCertificate QSslCertificatePrivate::QSslCertificate_from_X509(X509 *x509)-
572{-
573 QSslCertificate certificate;-
574 if (!x509
!x509Description
TRUEevaluated 44 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslsocket - unknown status
FALSEevaluated 20227 times by 8 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
|| !QSslSocket::supportsSsl()
!QSslSocket::supportsSsl()Description
TRUEnever evaluated
FALSEevaluated 20227 times by 8 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
)
0-20227
575 return
executed 44 times by 2 tests: return certificate;
Executed by:
  • tst_QNetworkReply
  • tst_qsslsocket - unknown status
certificate;
executed 44 times by 2 tests: return certificate;
Executed by:
  • tst_QNetworkReply
  • tst_qsslsocket - unknown status
44
576-
577 ASN1_TIME *nbef = ((x509)->cert_info->validity->notBefore);-
578 ASN1_TIME *naft = ((x509)->cert_info->validity->notAfter);-
579 certificate.d->notValidBefore = q_getTimeFromASN1(nbef);-
580 certificate.d->notValidAfter = q_getTimeFromASN1(naft);-
581 certificate.d->null = false;-
582 certificate.d->x509 = q_X509_dup(x509);-
583-
584 return
executed 20227 times by 8 tests: return certificate;
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
certificate;
executed 20227 times by 8 tests: return certificate;
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
20227
585}-
586-
587static bool matchLineFeed(const QByteArray &pem, int *offset)-
588{-
589 char ch = 0;-
590-
591-
592 while (*
*offset < pem.size()Description
TRUEevaluated 38312 times by 4 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
offset < pem.size()
*offset < pem.size()Description
TRUEevaluated 38312 times by 4 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
&& (
(ch = pem.at(*offset)) == ' 'Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 38308 times by 4 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
ch = pem.at(*offset)) == ' '
(ch = pem.at(*offset)) == ' 'Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 38308 times by 4 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
)
1-38312
593 ++*
executed 4 times by 1 test: ++*offset;
Executed by:
  • tst_qsslcertificate - unknown status
offset;
executed 4 times by 1 test: ++*offset;
Executed by:
  • tst_qsslcertificate - unknown status
4
594-
595 if (ch == '\n'
ch == '\n'Description
TRUEevaluated 38308 times by 4 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
) {
1-38308
596 *offset += 1;-
597 return
executed 38308 times by 4 tests: return true;
Executed by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
true;
executed 38308 times by 4 tests: return true;
Executed by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
38308
598 }-
599 if (ch == '\r'
ch == '\r'Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
&& pem.size() > (*offset + 1)
pem.size() > (*offset + 1)Description
TRUEnever evaluated
FALSEnever evaluated
&& pem.at(*offset + 1) == '\n'
pem.at(*offset + 1) == '\n'Description
TRUEnever evaluated
FALSEnever evaluated
) {
0-1
600 *offset += 2;-
601 return
never executed: return true;
true;
never executed: return true;
0
602 }-
603 return
executed 1 time by 1 test: return false;
Executed by:
  • tst_qsslcertificate - unknown status
false;
executed 1 time by 1 test: return false;
Executed by:
  • tst_qsslcertificate - unknown status
1
604}-
605-
606QList<QSslCertificate> QSslCertificatePrivate::certificatesFromPem(const QByteArray &pem, int count)-
607{-
608 QList<QSslCertificate> certificates;-
609 QSslSocketPrivate::ensureInitialized();-
610-
611 int offset = 0;-
612 while (count == -1
count == -1Description
TRUEevaluated 28897 times by 4 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
FALSEevaluated 118 times by 3 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
|| certificates.size() < count
certificates.size() < countDescription
TRUEevaluated 60 times by 3 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
FALSEevaluated 58 times by 3 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
) {
58-28897
613 int startPos = pem.indexOf("-----BEGIN CERTIFICATE-----", offset);-
614 if (startPos == -1
startPos == -1Description
TRUEevaluated 9801 times by 4 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
FALSEevaluated 19156 times by 4 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
)
9801-19156
615 break;
executed 9801 times by 4 tests: break;
Executed by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
9801
616 startPos += sizeof("-----BEGIN CERTIFICATE-----") - 1;-
617 if (!matchLineFeed(pem, &startPos)
!matchLineFeed(pem, &startPos)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 19155 times by 4 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
)
1-19155
618 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_qsslcertificate - unknown status
1
619-
620 int endPos = pem.indexOf("-----END CERTIFICATE-----", startPos);-
621 if (endPos == -1
endPos == -1Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 19154 times by 4 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
)
1-19154
622 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_qsslcertificate - unknown status
1
623-
624 offset = endPos + sizeof("-----END CERTIFICATE-----") - 1;-
625 if (offset < pem.size()
offset < pem.size()Description
TRUEevaluated 19153 times by 4 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
&& !matchLineFeed(pem, &offset)
!matchLineFeed(pem, &offset)Description
TRUEnever evaluated
FALSEevaluated 19153 times by 4 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
)
0-19153
626 break;
never executed: break;
0
627-
628 QByteArray decoded = QByteArray::fromBase64(-
629 QByteArray::fromRawData(pem.data() + startPos, endPos - startPos));-
630 const unsigned char *data = (const unsigned char *)decoded.data();-
631-
632 if (X509 *x509 = q_d2i_X509(0, &data, decoded.size())
X509 *x509 = q...ecoded.size())Description
TRUEevaluated 19154 times by 4 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
FALSEnever evaluated
) {
0-19154
633 certificates << QSslCertificate_from_X509(x509);-
634 q_X509_free(x509);-
635 }
executed 19154 times by 4 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
19154
636 }
executed 19154 times by 4 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
19154
637-
638 return
executed 9861 times by 4 tests: return certificates;
Executed by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
certificates;
executed 9861 times by 4 tests: return certificates;
Executed by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
9861
639}-
640-
641QList<QSslCertificate> QSslCertificatePrivate::certificatesFromDer(const QByteArray &der, int count)-
642{-
643 QList<QSslCertificate> certificates;-
644 QSslSocketPrivate::ensureInitialized();-
645-
646 const unsigned char *data = (const unsigned char *)der.data();-
647 int size = der.size();-
648-
649 while (size > 0
size > 0Description
TRUEevaluated 57 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
&& (count == -1
count == -1Description
TRUEevaluated 44 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 13 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
|| certificates.size() < count
certificates.size() < countDescription
TRUEevaluated 13 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEnever evaluated
)) {
0-57
650 if (X509 *x509 = q_d2i_X509(0, &data, size)
X509 *x509 = q..., &data, size)Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 43 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
) {
14-43
651 certificates << QSslCertificate_from_X509(x509);-
652 q_X509_free(x509);-
653 }
executed 14 times by 1 test: end of block
Executed by:
  • tst_qsslcertificate - unknown status
else {
14
654 break;
executed 43 times by 1 test: break;
Executed by:
  • tst_qsslcertificate - unknown status
43
655 }-
656 size -= ((const char *)data - der.data());-
657 }
executed 14 times by 1 test: end of block
Executed by:
  • tst_qsslcertificate - unknown status
14
658-
659 return
executed 57 times by 1 test: return certificates;
Executed by:
  • tst_qsslcertificate - unknown status
certificates;
executed 57 times by 1 test: return certificates;
Executed by:
  • tst_qsslcertificate - unknown status
57
660}-
661-
662-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9