diff options
author | Mate Barany <[email protected]> | 2024-09-02 14:21:29 +0200 |
---|---|---|
committer | Mate Barany <[email protected]> | 2024-09-06 17:54:52 +0200 |
commit | c3093b3d8f27fa3df14e04245dea9ed1e781f61e (patch) | |
tree | d84a3c452383ee52097f488ca9ee49e1725dde76 | |
parent | e54ee29862bd97749d547330a739416768088986 (diff) |
Use NSDMI for all the members of the QNtlmPhaseBlock classes
After the base and derived classes have been merged we can uniformize
the initialization as well.
Task-number: QTBUG-127539
Pick-to: 6.8
Change-Id: I3828dc973fd7b3ccd06272e2e26eaae4edab8768
Reviewed-by: MÃ¥rten Nordheim <[email protected]>
-rw-r--r-- | src/network/kernel/qauthenticator.cpp | 33 |
1 files changed, 8 insertions, 25 deletions
diff --git a/src/network/kernel/qauthenticator.cpp b/src/network/kernel/qauthenticator.cpp index cb7e0e0b4cf..02a12f1dff7 100644 --- a/src/network/kernel/qauthenticator.cpp +++ b/src/network/kernel/qauthenticator.cpp @@ -1068,18 +1068,12 @@ static QDataStream& operator>>(QDataStream& s, QNtlmBuffer& b) class QNtlmPhase1Block { // request public: - char magic[8]; - quint32 type; - quint32 flags; + char magic[8] = {'N', 'T', 'L', 'M', 'S', 'S', 'P', '\0'}; + quint32 type = 1; + quint32 flags = NTLMSSP_NEGOTIATE_UNICODE | NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_REQUEST_TARGET | NTLMSSP_NEGOTIATE_ALWAYS_SIGN | NTLMSSP_NEGOTIATE_NTLM2; QNtlmBuffer domain; QNtlmBuffer workstation; - QNtlmPhase1Block() { - qstrncpy(magic, "NTLMSSP", 8); - type = 1; - flags = NTLMSSP_NEGOTIATE_UNICODE | NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_REQUEST_TARGET | NTLMSSP_NEGOTIATE_ALWAYS_SIGN | NTLMSSP_NEGOTIATE_NTLM2; - } - // extracted QString domainStr, workstationStr; }; @@ -1088,8 +1082,8 @@ public: class QNtlmPhase2Block { // challenge public: - char magic[8]; - quint32 type; + char magic[8] = {0}; + quint32 type = 0xffffffff; QNtlmBuffer targetName; quint32 flags = 0; unsigned char challenge[8] = {'\0'}; @@ -1097,11 +1091,6 @@ public: QNtlmBuffer targetInfo; enum { Size = 48 }; - QNtlmPhase2Block() { - magic[0] = 0; - type = 0xffffffff; - } - // extracted QString targetNameStr, targetInfoStr; QByteArray targetInfoBuff; @@ -1112,23 +1101,17 @@ public: class QNtlmPhase3Block { // response public: - char magic[8]; - quint32 type; + char magic[8] = {'N', 'T', 'L', 'M', 'S', 'S', 'P', '\0'}; + quint32 type = 3; QNtlmBuffer lmResponse; QNtlmBuffer ntlmResponse; QNtlmBuffer domain; QNtlmBuffer user; QNtlmBuffer workstation; QNtlmBuffer sessionKey; - quint32 flags; + quint32 flags = NTLMSSP_NEGOTIATE_UNICODE | NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_NEGOTIATE_TARGET_INFO; enum { Size = 64 }; - QNtlmPhase3Block() { - qstrncpy(magic, "NTLMSSP", 8); - type = 3; - flags = NTLMSSP_NEGOTIATE_UNICODE | NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_NEGOTIATE_TARGET_INFO; - } - // extracted QByteArray lmResponseBuf, ntlmResponseBuf; QString domainStr, userStr, workstationStr, sessionKeyStr; |