KVIrc  4.9.2
DeveloperAPIs
Classes | Macros | Functions | Variables
qhttpauthenticator.cpp File Reference
#include "qhttpauthenticator_p.h"
#include <qdebug.h>
#include <qhash.h>
#include <qbytearray.h>
#include <qcryptographichash.h>
#include "qhttp.h"
#include <qiodevice.h>
#include <qdatastream.h>
#include <qendian.h>
#include <qstring.h>
#include <qdatetime.h>

Classes

class  QNtlmBuffer
 
class  QNtlmPhase1Block
 
class  QNtlmPhase1BlockBase
 
class  QNtlmPhase2Block
 
class  QNtlmPhase2BlockBase
 
class  QNtlmPhase3Block
 
class  QNtlmPhase3BlockBase
 

Macros

#define AVTIMESTAMP   7
 
#define NTLMSSP_NEGOTIATE_128   0x20000000
 
#define NTLMSSP_NEGOTIATE_56   0x80000000
 
#define NTLMSSP_NEGOTIATE_ALWAYS_SIGN   0x00008000
 
#define NTLMSSP_NEGOTIATE_DATAGRAM   0x00000040
 
#define NTLMSSP_NEGOTIATE_DOMAIN_SUPPLIED   0x00001000
 
#define NTLMSSP_NEGOTIATE_KEY_EXCHANGE   0x40000000
 
#define NTLMSSP_NEGOTIATE_LM_KEY   0x00000080
 
#define NTLMSSP_NEGOTIATE_LOCAL_CALL   0x00004000
 
#define NTLMSSP_NEGOTIATE_NTLM   0x00000200
 
#define NTLMSSP_NEGOTIATE_NTLM2   0x00080000
 
#define NTLMSSP_NEGOTIATE_OEM   0x00000002
 
#define NTLMSSP_NEGOTIATE_SEAL   0x00000020
 
#define NTLMSSP_NEGOTIATE_SIGN   0x00000010
 
#define NTLMSSP_NEGOTIATE_TARGET_INFO   0x00800000
 
#define NTLMSSP_NEGOTIATE_UNICODE   0x00000001
 
#define NTLMSSP_NEGOTIATE_WORKSTATION_SUPPLIED   0x00002000
 
#define NTLMSSP_REQUEST_TARGET   0x00000004
 
#define NTLMSSP_TARGET_TYPE_DOMAIN   0x00010000
 
#define NTLMSSP_TARGET_TYPE_SERVER   0x00020000
 
#define NTLMSSP_TARGET_TYPE_SHARE   0x00040000
 

Functions

static QByteArray clientChallenge (const QHttpAuthenticatorPrivate *ctx)
 
static QByteArray digestMd5ResponseHelper (const QByteArray &alg, const QByteArray &userName, const QByteArray &realm, const QByteArray &password, const QByteArray &nonce, const QByteArray &nonceCount, const QByteArray &cNonce, const QByteArray &qop, const QByteArray &method, const QByteArray &digestUri, const QByteArray &hEntity)
 
static QDataStream & operator<< (QDataStream &s, const QNtlmBuffer &b)
 
static QDataStream & operator<< (QDataStream &s, const QNtlmPhase1Block &b)
 
static QDataStream & operator<< (QDataStream &s, const QNtlmPhase3Block &b)
 
static QDataStream & operator>> (QDataStream &s, QNtlmBuffer &b)
 
static QByteArray qCreatev2Hash (const QHttpAuthenticatorPrivate *ctx, QNtlmPhase3Block *phase3)
 
QByteArray qEncodeHmacMd5 (QByteArray &key, const QByteArray &message)
 
static QByteArray qEncodeLmv2Response (const QHttpAuthenticatorPrivate *ctx, const QNtlmPhase2Block &ch, QNtlmPhase3Block *phase3)
 
static int qEncodeNtlmBuffer (QNtlmBuffer &buf, int offset, const QByteArray &s)
 
static int qEncodeNtlmString (QNtlmBuffer &buf, int offset, const QString &s, bool unicode)
 
static QByteArray qEncodeNtlmv2Response (const QHttpAuthenticatorPrivate *ctx, const QNtlmPhase2Block &ch, QNtlmPhase3Block *phase3)
 
static QByteArray qExtractServerTime (const QByteArray &targetInfoBuff)
 
static bool qNtlmDecodePhase2 (const QByteArray &data, QNtlmPhase2Block &ch)
 
static QT_BEGIN_NAMESPACE
QByteArray 
qNtlmPhase1 ()
 
static QByteArray qNtlmPhase3 (QHttpAuthenticatorPrivate *ctx, const QByteArray &phase2data)
 
static void qStreamNtlmBuffer (QDataStream &ds, const QByteArray &s)
 
static void qStreamNtlmString (QDataStream &ds, const QString &s, bool unicode)
 
static QByteArray qStringAsUcs2Le (const QString &src)
 
static QString qStringFromUcs2Le (const QByteArray &src)
 

Variables

const int blockSize = 64
 
const quint8 hirespversion = 1
 
const int nDigestLen = 16
 
const quint8 respversion = 1
 

Macro Definition Documentation

#define AVTIMESTAMP   7

Referenced by qExtractServerTime().

#define NTLMSSP_NEGOTIATE_128   0x20000000
#define NTLMSSP_NEGOTIATE_56   0x80000000
#define NTLMSSP_NEGOTIATE_ALWAYS_SIGN   0x00008000
#define NTLMSSP_NEGOTIATE_DATAGRAM   0x00000040
#define NTLMSSP_NEGOTIATE_DOMAIN_SUPPLIED   0x00001000
#define NTLMSSP_NEGOTIATE_KEY_EXCHANGE   0x40000000
#define NTLMSSP_NEGOTIATE_LM_KEY   0x00000080
#define NTLMSSP_NEGOTIATE_LOCAL_CALL   0x00004000
#define NTLMSSP_NEGOTIATE_NTLM   0x00000200
#define NTLMSSP_NEGOTIATE_NTLM2   0x00080000
#define NTLMSSP_NEGOTIATE_OEM   0x00000002

Referenced by qNtlmPhase3().

#define NTLMSSP_NEGOTIATE_SEAL   0x00000020
#define NTLMSSP_NEGOTIATE_SIGN   0x00000010
#define NTLMSSP_NEGOTIATE_TARGET_INFO   0x00800000
#define NTLMSSP_NEGOTIATE_UNICODE   0x00000001
#define NTLMSSP_NEGOTIATE_WORKSTATION_SUPPLIED   0x00002000
#define NTLMSSP_REQUEST_TARGET   0x00000004
#define NTLMSSP_TARGET_TYPE_DOMAIN   0x00010000
#define NTLMSSP_TARGET_TYPE_SERVER   0x00020000
#define NTLMSSP_TARGET_TYPE_SHARE   0x00040000

Function Documentation

static QByteArray clientChallenge ( const QHttpAuthenticatorPrivate ctx)
static
static QByteArray digestMd5ResponseHelper ( const QByteArray &  alg,
const QByteArray &  userName,
const QByteArray &  realm,
const QByteArray &  password,
const QByteArray &  nonce,
const QByteArray &  nonceCount,
const QByteArray &  cNonce,
const QByteArray &  qop,
const QByteArray &  method,
const QByteArray &  digestUri,
const QByteArray &  hEntity 
)
static
static QDataStream& operator<< ( QDataStream &  s,
const QNtlmBuffer b 
)
static
static QDataStream& operator<< ( QDataStream &  s,
const QNtlmPhase1Block b 
)
static
static QDataStream& operator<< ( QDataStream &  s,
const QNtlmPhase3Block b 
)
static
static QDataStream& operator>> ( QDataStream &  s,
QNtlmBuffer b 
)
static
static QByteArray qCreatev2Hash ( const QHttpAuthenticatorPrivate ctx,
QNtlmPhase3Block phase3 
)
static
QByteArray qEncodeHmacMd5 ( QByteArray &  key,
const QByteArray &  message 
)
static QByteArray qEncodeLmv2Response ( const QHttpAuthenticatorPrivate ctx,
const QNtlmPhase2Block ch,
QNtlmPhase3Block phase3 
)
static
static int qEncodeNtlmBuffer ( QNtlmBuffer buf,
int  offset,
const QByteArray &  s 
)
static
static int qEncodeNtlmString ( QNtlmBuffer buf,
int  offset,
const QString &  s,
bool  unicode 
)
static
static QByteArray qEncodeNtlmv2Response ( const QHttpAuthenticatorPrivate ctx,
const QNtlmPhase2Block ch,
QNtlmPhase3Block phase3 
)
static
static QByteArray qExtractServerTime ( const QByteArray &  targetInfoBuff)
static

References AVTIMESTAMP.

Referenced by qEncodeNtlmv2Response().

static bool qNtlmDecodePhase2 ( const QByteArray &  data,
QNtlmPhase2Block ch 
)
static
static QByteArray qNtlmPhase1 ( )
static
static QByteArray qNtlmPhase3 ( QHttpAuthenticatorPrivate ctx,
const QByteArray &  phase2data 
)
static
static void qStreamNtlmBuffer ( QDataStream &  ds,
const QByteArray &  s 
)
static

Referenced by operator<<(), and qStreamNtlmString().

static void qStreamNtlmString ( QDataStream &  ds,
const QString &  s,
bool  unicode 
)
static

References d, i, and qStreamNtlmBuffer().

Referenced by operator<<().

static QByteArray qStringAsUcs2Le ( const QString &  src)
static

References d, i, and s.

Referenced by qCreatev2Hash().

static QString qStringFromUcs2Le ( const QByteArray &  src)
static

References d, and i.

Referenced by qNtlmDecodePhase2().

Variable Documentation

const int blockSize = 64
const quint8 hirespversion = 1

Referenced by qEncodeNtlmv2Response().

const int nDigestLen = 16
const quint8 respversion = 1

Referenced by qEncodeNtlmv2Response().