![]() |
Qt 6.x
The Qt SDK
|
#include <qauthenticator_p.h>
Public Types | |
enum | Method { None , Basic , Negotiate , Ntlm , DigestMd5 } |
enum | Phase { Start , Phase1 , Phase2 , Done , Invalid } |
Public Member Functions | |
QAuthenticatorPrivate () | |
~QAuthenticatorPrivate () | |
QByteArray | calculateResponse (QByteArrayView method, QByteArrayView path, QStringView host) |
QByteArray | digestMd5Response (QByteArrayView challenge, QByteArrayView method, QByteArrayView path) |
void | parseHttpResponse (const QList< QPair< QByteArray, QByteArray > > &, bool isProxy, QStringView host) |
void | updateCredentials () |
Static Public Member Functions | |
static QAuthenticatorPrivate * | getPrivate (QAuthenticator &auth) |
static const QAuthenticatorPrivate * | getPrivate (const QAuthenticator &auth) |
static QHash< QByteArray, QByteArray > | parseDigestAuthenticationChallenge (QByteArrayView challenge) |
static bool | isMethodSupported (QByteArrayView method) |
Public Attributes | |
QString | user |
QString | extractedUser |
QString | password |
QVariantHash | options |
Method | method |
QString | realm |
QByteArray | challenge |
bool | hasFailed |
Phase | phase |
QByteArray | cnonce |
int | nonceCount |
QString | workstation |
QString | userDomain |
Definition at line 35 of file qauthenticator_p.h.
Enumerator | |
---|---|
None | |
Basic | |
Negotiate | |
Ntlm | |
DigestMd5 |
Definition at line 38 of file qauthenticator_p.h.
Enumerator | |
---|---|
Start | |
Phase1 | |
Phase2 | |
Done | |
Invalid |
Definition at line 56 of file qauthenticator_p.h.
QAuthenticatorPrivate::QAuthenticatorPrivate | ( | ) |
Definition at line 376 of file qauthenticator.cpp.
References cnonce, QCryptographicHash::hash(), QCryptographicHash::Md5, nonceCount, QByteArray::number(), QRandomGenerator::system(), and QByteArray::toHex().
|
default |
QByteArray QAuthenticatorPrivate::calculateResponse | ( | QByteArrayView | method, |
QByteArrayView | path, | ||
QStringView | host | ||
) |
Definition at line 543 of file qauthenticator.cpp.
References Basic, challenge, DigestMd5, digestMd5Response(), Done, QByteArray::fromBase64(), QByteArray::fromRawData(), QString::isEmpty(), QByteArray::isEmpty(), method, Negotiate, None, Ntlm, password, phase, Phase2, Q_UNUSED, qNtlmPhase1(), qNtlmPhase3(), qstrlen(), qWarning, QByteArray::toBase64(), QString::toLatin1(), and user.
QByteArray QAuthenticatorPrivate::digestMd5Response | ( | QByteArrayView | challenge, |
QByteArrayView | method, | ||
QByteArrayView | path | ||
) |
Definition at line 794 of file qauthenticator.cpp.
References challenge, cnonce, digestMd5ResponseHelper(), QByteArray::isEmpty(), method, nonceCount, QByteArray::number(), options, parseDigestAuthenticationChallenge(), password, QByteArray::prepend(), realm, QByteArray::size(), QString::toLatin1(), user, and QHash< Key, T >::value().
Referenced by calculateResponse().
|
inlinestatic |
Definition at line 76 of file qauthenticator_p.h.
|
inlinestatic |
Definition at line 75 of file qauthenticator_p.h.
Referenced by QHttpNetworkConnectionPrivate::copyCredentials(), QHttpNetworkConnectionPrivate::createAuthorization(), QHttpNetworkConnectionChannel::ensureConnection(), QHttpNetworkConnectionPrivate::handleAuthenticateChallenge(), QNetworkAccessManagerPrivate::proxyAuthenticationRequired(), QHttpSocketEngine::slotSocketConnected(), and QHttpSocketEngine::slotSocketReadNotification().
|
static |
Definition at line 412 of file qauthenticator.cpp.
References Qt::CaseInsensitive, method, methods, and Q_ASSERT.
Referenced by QHttpNetworkConnectionPrivate::handleAuthenticateChallenge().
|
static |
Definition at line 655 of file qauthenticator.cpp.
References challenge, QListSpecialMethodsBase< T >::contains(), d, QByteArray::data(), QByteArray::isEmpty(), options, quote(), QByteArray::size(), QByteArray::split(), and QHash< Key, T >::value().
Referenced by digestMd5Response(), parseHttpResponse(), and verifyDigestMD5().
void QAuthenticatorPrivate::parseHttpResponse | ( | const QList< QPair< QByteArray, QByteArray > > & | values, |
bool | isProxy, | ||
QStringView | host | ||
) |
Definition at line 447 of file qauthenticator.cpp.
References QByteArray::at(), Basic, Qt::CaseInsensitive, challenge, QString::clear(), QVariant::compare(), DigestMd5, Done, QString::fromLatin1(), i, Invalid, QString::isEmpty(), method, QByteArray::mid(), Negotiate, nonceCount, None, Ntlm, options, parseDigestAuthenticationChallenge(), password, phase, Q_UNUSED, realm, QByteArrayView::sliced(), Start, QString::startsWith(), str, QString::toLower(), QByteArray::trimmed(), updateCredentials(), user, QHash< Key, T >::value(), and verifyDigestMD5().
void QAuthenticatorPrivate::updateCredentials | ( | ) |
Definition at line 389 of file qauthenticator.cpp.
References QString::clear(), extractedUser, QString::indexOf(), QString::left(), method, QString::mid(), Ntlm, realm, user, and userDomain.
Referenced by parseHttpResponse(), and QAuthenticator::setUser().
QByteArray QAuthenticatorPrivate::challenge |
Definition at line 48 of file qauthenticator_p.h.
Referenced by calculateResponse(), digestMd5Response(), parseDigestAuthenticationChallenge(), and parseHttpResponse().
QByteArray QAuthenticatorPrivate::cnonce |
Definition at line 66 of file qauthenticator_p.h.
Referenced by QAuthenticatorPrivate(), and digestMd5Response().
QString QAuthenticatorPrivate::extractedUser |
Definition at line 43 of file qauthenticator_p.h.
Referenced by QAuthenticator::operator=(), and updateCredentials().
bool QAuthenticatorPrivate::hasFailed |
Definition at line 54 of file qauthenticator_p.h.
Method QAuthenticatorPrivate::method |
Definition at line 46 of file qauthenticator_p.h.
Referenced by calculateResponse(), digestMd5Response(), isMethodSupported(), QAuthenticator::operator=(), QAuthenticator::operator==(), parseHttpResponse(), and updateCredentials().
int QAuthenticatorPrivate::nonceCount |
Definition at line 67 of file qauthenticator_p.h.
Referenced by QAuthenticatorPrivate(), digestMd5Response(), and parseHttpResponse().
QVariantHash QAuthenticatorPrivate::options |
Definition at line 45 of file qauthenticator_p.h.
Referenced by digestMd5Response(), QAuthenticator::operator=(), QAuthenticator::operator==(), QAuthenticator::option(), QAuthenticator::options(), parseDigestAuthenticationChallenge(), parseHttpResponse(), and QAuthenticator::setOption().
QString QAuthenticatorPrivate::password |
Definition at line 44 of file qauthenticator_p.h.
Referenced by calculateResponse(), digestMd5Response(), QAuthenticator::operator=(), QAuthenticator::operator==(), parseHttpResponse(), QAuthenticator::password(), and QAuthenticator::setPassword().
Phase QAuthenticatorPrivate::phase |
Definition at line 63 of file qauthenticator_p.h.
Referenced by calculateResponse(), QAuthenticator::detach(), QAuthenticator::operator=(), and parseHttpResponse().
QString QAuthenticatorPrivate::realm |
Definition at line 47 of file qauthenticator_p.h.
Referenced by digestMd5Response(), QAuthenticator::operator=(), QAuthenticator::operator==(), parseHttpResponse(), QAuthenticator::realm(), QAuthenticator::setRealm(), and updateCredentials().
QString QAuthenticatorPrivate::user |
Definition at line 42 of file qauthenticator_p.h.
Referenced by calculateResponse(), digestMd5Response(), QAuthenticator::operator=(), QAuthenticator::operator==(), parseHttpResponse(), QAuthenticator::setUser(), updateCredentials(), and QAuthenticator::user().
QString QAuthenticatorPrivate::userDomain |
Definition at line 71 of file qauthenticator_p.h.
Referenced by QAuthenticator::operator=(), and updateCredentials().
QString QAuthenticatorPrivate::workstation |
Definition at line 70 of file qauthenticator_p.h.
Referenced by QAuthenticator::operator=().