summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-09-01 08:25:54 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-09-01 08:25:54 (GMT)
commit1051e9d0dc5cbad27b89756839f3619cae2d44fe (patch)
treecd25969458735e14c0b5de365760c3fd7747659d /src/network
parent0d411622521a89c04a416e2aaf3da44b6015b183 (diff)
parent8f1596ae9b64870c54958611552c71b0b390038f (diff)
downloadQt-1051e9d0dc5cbad27b89756839f3619cae2d44fe.zip
Qt-1051e9d0dc5cbad27b89756839f3619cae2d44fe.tar.gz
Qt-1051e9d0dc5cbad27b89756839f3619cae2d44fe.tar.bz2
Merge branch '4.6' of git:qt/qt into 4.6
Diffstat (limited to 'src/network')
-rw-r--r--src/network/ssl/qsslcertificate.cpp8
-rw-r--r--src/network/ssl/qsslerror.cpp15
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols.cpp2
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols_p.h1
4 files changed, 23 insertions, 3 deletions
diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp
index 666770d..c128da9 100644
--- a/src/network/ssl/qsslcertificate.cpp
+++ b/src/network/ssl/qsslcertificate.cpp
@@ -250,6 +250,10 @@ void QSslCertificate::clear()
*/
QByteArray QSslCertificate::version() const
{
+ if (d->versionString.isEmpty() && d->x509)
+ d->versionString =
+ QByteArray::number(qlonglong(q_ASN1_INTEGER_get(d->x509->cert_info->version)));
+
return d->versionString;
}
@@ -258,6 +262,10 @@ QByteArray QSslCertificate::version() const
*/
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);
+
return d->serialNumberString;
}
diff --git a/src/network/ssl/qsslerror.cpp b/src/network/ssl/qsslerror.cpp
index 69d2ccd..d47c91d 100644
--- a/src/network/ssl/qsslerror.cpp
+++ b/src/network/ssl/qsslerror.cpp
@@ -105,10 +105,8 @@ public:
};
/*!
- Constructs a QSslError object. The two optional arguments specify the \a
- error that occurred, and which \a certificate the error relates to.
+ Constructs a QSslError object with no error and default certificate.
- \sa QSslCertificate
*/
// RVCT compiler in debug build does not like about default values in const-
@@ -120,6 +118,11 @@ QSslError::QSslError()
d->certificate = QSslCertificate();
}
+/*!
+ Constructs a QSslError object. The argument specifies the \a
+ error that occurred.
+
+*/
QSslError::QSslError(SslError error)
: d(new QSslErrorPrivate)
{
@@ -127,6 +130,12 @@ QSslError::QSslError(SslError error)
d->certificate = QSslCertificate();
}
+/*!
+ Constructs a QSslError object. The two arguments specify the \a
+ error that occurred, and which \a certificate the error relates to.
+
+ \sa QSslCertificate
+*/
QSslError::QSslError(SslError error, const QSslCertificate &certificate)
: d(new QSslErrorPrivate)
{
diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp
index 5b04a57..d3dcd51 100644
--- a/src/network/ssl/qsslsocket_openssl_symbols.cpp
+++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp
@@ -94,6 +94,7 @@ QT_BEGIN_NAMESPACE
#ifdef SSLEAY_MACROS
DEFINEFUNC3(void *, ASN1_dup, i2d_of_void *a, a, d2i_of_void *b, b, char *c, c, return 0, return)
#endif
+DEFINEFUNC(long, ASN1_INTEGER_get, ASN1_INTEGER *a, a, return 0, return)
DEFINEFUNC(unsigned char *, ASN1_STRING_data, ASN1_STRING *a, a, return 0, return)
DEFINEFUNC(int, ASN1_STRING_length, ASN1_STRING *a, a, return 0, return)
DEFINEFUNC4(long, BIO_ctrl, BIO *a, a, int b, b, long c, c, void *d, d, return -1, return)
@@ -608,6 +609,7 @@ bool q_resolveOpenSslSymbols()
#ifdef SSLEAY_MACROS
RESOLVEFUNC(ASN1_dup)
#endif
+ RESOLVEFUNC(ASN1_INTEGER_get)
RESOLVEFUNC(ASN1_STRING_data)
RESOLVEFUNC(ASN1_STRING_length)
RESOLVEFUNC(BIO_ctrl)
diff --git a/src/network/ssl/qsslsocket_openssl_symbols_p.h b/src/network/ssl/qsslsocket_openssl_symbols_p.h
index f9c92e5..30762ca 100644
--- a/src/network/ssl/qsslsocket_openssl_symbols_p.h
+++ b/src/network/ssl/qsslsocket_openssl_symbols_p.h
@@ -201,6 +201,7 @@ QT_BEGIN_NAMESPACE
#endif // !defined QT_LINKED_OPENSSL
bool q_resolveOpenSslSymbols();
+long q_ASN1_INTEGER_get(ASN1_INTEGER *a);
unsigned char * q_ASN1_STRING_data(ASN1_STRING *a);
int q_ASN1_STRING_length(ASN1_STRING *a);
long q_BIO_ctrl(BIO *a, int b, long c, void *d);