summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Hartmann <phartmann@blackberry.com>2013-11-06 22:44:38 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-08 18:58:27 +0100
commitbecdfa6fabb80d35e430a13835f01a6ff3f6cc73 (patch)
treee185f00d3391910f7c6d20c0b135acacfe9a607b
parentf45e12f91aa9a230e78f939d2a86398ed90d370d (diff)
QSslConfiguration: rename [get]session() to [get]sessionTicket()
to reflect the fact that this returns and sets the whole session ticket, and not just the session ID. Change-Id: I00fe2bc4197dbcd7a02b3ae4f2f84e3a2a7edad0 Reviewed-by: Richard J. Moore <rich@kde.org>
-rw-r--r--src/network/ssl/qssl.cpp2
-rw-r--r--src/network/ssl/qsslconfiguration.cpp24
-rw-r--r--src/network/ssl/qsslconfiguration.h4
-rw-r--r--src/network/ssl/qsslcontext.cpp4
-rw-r--r--src/network/ssl/qsslsocket.cpp2
-rw-r--r--tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp4
6 files changed, 20 insertions, 20 deletions
diff --git a/src/network/ssl/qssl.cpp b/src/network/ssl/qssl.cpp
index ec771e1f49..5b7274e3e6 100644
--- a/src/network/ssl/qssl.cpp
+++ b/src/network/ssl/qssl.cpp
@@ -164,7 +164,7 @@ QT_BEGIN_NAMESPACE
\value SslOptionDisableSessionSharing Disables SSL session sharing via
the session ID handshake attribute.
\value SslOptionDisableSessionPersistence Disables storing the SSL session
- in ASN.1 format as returned by QSslConfiguration::session(). Enabling
+ in ASN.1 format as returned by QSslConfiguration::sessionTicket(). Enabling
this feature adds memory overhead of approximately 1K per used session
ticket.
diff --git a/src/network/ssl/qsslconfiguration.cpp b/src/network/ssl/qsslconfiguration.cpp
index 8979c48d5d..4aad7c04c5 100644
--- a/src/network/ssl/qsslconfiguration.cpp
+++ b/src/network/ssl/qsslconfiguration.cpp
@@ -602,19 +602,19 @@ bool QSslConfiguration::testSslOption(QSsl::SslOption option) const
\since 5.2
If QSsl::SslOptionDisableSessionPersistence was turned off, this
- function returns the session used in the SSL handshake in ASN.1
- format, suitable to e.g. be persisted to disk. If no session was
+ function returns the session ticket used in the SSL handshake in ASN.1
+ format, suitable to e.g. be persisted to disk. If no session ticket was
used or QSsl::SslOptionDisableSessionPersistence was not turned off,
this function returns an empty QByteArray.
- \b{Note:} When persisting the session to disk or similar, be
+ \b{Note:} When persisting the session ticket to disk or similar, be
careful not to expose the session to a potential attacker, as
knowledge of the session allows for eavesdropping on data
encrypted with the session parameters.
- \sa setSession(), QSsl::SslOptionDisableSessionPersistence, setSslOption()
+ \sa setSessionTicket(), QSsl::SslOptionDisableSessionPersistence, setSslOption()
*/
-QByteArray QSslConfiguration::session() const
+QByteArray QSslConfiguration::sessionTicket() const
{
return d->sslSession;
}
@@ -622,16 +622,16 @@ QByteArray QSslConfiguration::session() const
/*!
\since 5.2
- Sets the session to be used in an SSL handshake.
+ Sets the session ticket to be used in an SSL handshake.
QSsl::SslOptionDisableSessionPersistence must be turned off
- for this to work, and \a session must be in ASN.1 format
- as returned by session().
+ for this to work, and \a sessionTicket must be in ASN.1 format
+ as returned by sessionTicket().
- \sa session(), QSsl::SslOptionDisableSessionPersistence, setSslOption()
+ \sa sessionTicket(), QSsl::SslOptionDisableSessionPersistence, setSslOption()
*/
-void QSslConfiguration::setSession(const QByteArray &session)
+void QSslConfiguration::setSessionTicket(const QByteArray &sessionTicket)
{
- d->sslSession = session;
+ d->sslSession = sessionTicket;
}
/*!
@@ -645,7 +645,7 @@ void QSslConfiguration::setSession(const QByteArray &session)
QSsl::SslOptionDisableSessionPersistence was not turned off,
this function returns -1.
- \sa session(), QSsl::SslOptionDisableSessionPersistence, setSslOption()
+ \sa sessionTicket(), QSsl::SslOptionDisableSessionPersistence, setSslOption()
*/
int QSslConfiguration::sessionTicketLifeTimeHint() const
{
diff --git a/src/network/ssl/qsslconfiguration.h b/src/network/ssl/qsslconfiguration.h
index 949ce70d4c..a48eceb63e 100644
--- a/src/network/ssl/qsslconfiguration.h
+++ b/src/network/ssl/qsslconfiguration.h
@@ -124,8 +124,8 @@ public:
void setSslOption(QSsl::SslOption option, bool on);
bool testSslOption(QSsl::SslOption option) const;
- QByteArray session() const;
- void setSession(const QByteArray &session);
+ QByteArray sessionTicket() const;
+ void setSessionTicket(const QByteArray &sessionTicket);
int sessionTicketLifeTimeHint() const;
static QSslConfiguration defaultConfiguration();
diff --git a/src/network/ssl/qsslcontext.cpp b/src/network/ssl/qsslcontext.cpp
index 6d281c390d..037ee8c672 100644
--- a/src/network/ssl/qsslcontext.cpp
+++ b/src/network/ssl/qsslcontext.cpp
@@ -260,8 +260,8 @@ init_context:
q_SSL_CTX_set_verify_depth(sslContext->ctx, sslContext->sslConfiguration.peerVerifyDepth());
// set persisted session if the user set it
- if (!configuration.session().isEmpty())
- sslContext->setSessionASN1(configuration.session());
+ if (!configuration.sessionTicket().isEmpty())
+ sslContext->setSessionASN1(configuration.sessionTicket());
return sslContext;
}
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp
index 24843e9f92..38b493a769 100644
--- a/src/network/ssl/qsslsocket.cpp
+++ b/src/network/ssl/qsslsocket.cpp
@@ -903,7 +903,7 @@ void QSslSocket::setSslConfiguration(const QSslConfiguration &configuration)
d->configuration.peerVerifyMode = configuration.peerVerifyMode();
d->configuration.protocol = configuration.protocol();
d->configuration.sslOptions = configuration.d->sslOptions;
- d->configuration.sslSession = configuration.session();
+ d->configuration.sslSession = configuration.sessionTicket();
d->configuration.sslSessionTicketLifeTimeHint = configuration.sessionTicketLifeTimeHint();
// if the CA certificates were set explicitly (either via
diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
index 2826c497df..1837e8d665 100644
--- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
@@ -6042,7 +6042,7 @@ void tst_QNetworkReply::sslSessionSharingFromPersistentSession()
QTestEventLoop::instance().enterLoop(20);
QVERIFY(!QTestEventLoop::instance().timeout());
QCOMPARE(warmupReply->error(), QNetworkReply::NoError);
- QByteArray sslSession = warmupReply->sslConfiguration().session();
+ QByteArray sslSession = warmupReply->sslConfiguration().sessionTicket();
QCOMPARE(!sslSession.isEmpty(), sessionPersistenceEnabled);
// test server sends a life time hint of 0 (old server) or 300 (new server),
@@ -6060,7 +6060,7 @@ void tst_QNetworkReply::sslSessionSharingFromPersistentSession()
QNetworkRequest request(warmupRequest);
if (sessionPersistenceEnabled) {
QSslConfiguration configuration = request.sslConfiguration();
- configuration.setSession(sslSession);
+ configuration.setSessionTicket(sslSession);
request.setSslConfiguration(configuration);
}
QNetworkAccessManager newManager;