summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qmessageauthenticationcode.h
Commit message (Collapse)AuthorAgeFilesLines
* QMessageAuthenticationCode: make reset() noexceptMarc Mutz2023-03-171-1/+1
| | | | | | | | | | | | | | | | This is the last method that can and should be noexcept: - the ctor allocates the Private, so can't be - static hash() allocates QByteArray::data(), so also cannot be - ditto result() All other functions are already noexcept. Fixes: QTBUG-111688 Change-Id: I237c3d1292452da5ca92712531c3527c1fb2f59b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QMessageAuthenticationCode: port to QByteArrayView [3/3]: static hash()Marc Mutz2023-03-171-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | The class is not used frequently enough to warrant the overhead of a Q_WEAK_ QByteArray overload to fix the SiC Type A for users that pass objects that implicitly convert to QByteArray, esp. since we'd need _four_ overloads to handle the two byte array arguments here, and still cause ambiguities, because there's only one level of "weakness" in Q_WEAK_OVERLOAD, but we'd need two. QCryptographicHash::hash() also doesn't have it. [ChangeLog][QtCore][QMessageAuthenticationCode] The constructor, setKey(), addData() methods as well as the static hash() function take arguments by QByteArrayView instead of QByteArray now. [ChangeLog][Potentially Source-Incompatible Changes] More APIs now take QByteArrayView instead of QByteArray. You will now get a compile error when your code passes to such functions objects that implicitly convert to QByteArray, but not QByteArrayView. Wrapping such arguments in QByteArray{~~~} to make the cast explicit is a backwards-compatible way to avoid this problem. Fixes: QTBUG-111676 Change-Id: Iaff832df3b315ca2eee7bff93720b6681182036f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QMessageAuthenticationCode: port to QByteArrayView [2/3]: addData()Marc Mutz2023-03-171-0/+3
| | | | | | | | | | | | | | | | | | | | | The class is not used frequently enough to warrant the overhead of a Q_WEAK_ QByteArray overload to fix the SiC Type A for users that pass objects that implicitly convert to QByteArray. QCryptographicHash also doesn't have it. Also mark addData() noexcept. Now that it takes a view instead of an owning container, it only calls other noexcept functions. Make the new overload carry actual documentation instead of just \overload. ChangeLog will be on patch [3/3]. Task-number: QTBUG-111676 Task-number: QTBUG-111688 Change-Id: Ie6447bf54d7d442b1a76761bc0f28f868c08ef09 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QMessageAuthenticationCode: port to QByteArrayView [1/3]: ctor/setKey()Marc Mutz2023-03-171-1/+9
| | | | | | | | | | | | | | | | | The class is not used frequently enough to warrant the overhead of a Q_WEAK_ QByteArray overload to fix the SiC Type A for users that pass objects that implicitly convert to QByteArray. QCryptographicHash also doesn't have it. Also mark setKey() noexcept. Now that it takes a view instead of an owning container, it only calls other noexcept functions. ChangeLog will be on patch [3/3]. Task-number: QTBUG-111676 Task-number: QTBUG-111688 Change-Id: Ic2321d0d41ce8eb4d0390889f28b3fd4bd9af103 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QMessageAuthenticationCode: add move SMFs and swap()Marc Mutz2023-03-161-0/+6
| | | | | | | | | | | | QCryptographicHash is move-only these days, so QMessageAuthenticationCode should not be left behind. [ChangeLog][QtCore][QMessageAuthenticationCode] Added move constructor, move assignment operator and swap() function. Fixes: QTBUG-111677 Change-Id: I420f24c04828e8ad7043a9e8c9e7e2d47dd183e0 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Long live QMessageAuthenticationCode::resultView()!Marc Mutz2023-03-011-0/+1
| | | | | | | | | | | Use it in a few places. [ChangeLog][QtCore][QMessageAuthenticationCode] Added QCryptographicHash-style resultView(). Change-Id: I745d71f86f9c19c9a9aabb2021c6617775dab1cf Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Merge qmessageauthenticationcode.cpp into qcryptographichash.cppMarc Mutz2023-02-231-0/+1
| | | | | | | | | | | | | | | | They share so many things, and QMAC is lacking so many of the changes QCH has received over the last few months, that it seems QMAC is better off being implemented in the QCH TU. Among other things, this will allow QMAC to use QCHPrivate for its implementation, drastically reducing the number of memory allocations required to perform HMAC operations. Pick-to: 6.5 Change-Id: I3c81a52e3a9ad57c14c91c16bc347f215fd407ba Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Fix two missing conversions from in to qsizetypeAllan Sandfeld Jensen2020-10-291-1/+1
| | | | | Change-Id: I08ac9a0eb5dfb17f2b6cfaca9e3f3d7375c02bd4 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Updated license headersJani Heikkinen2016-01-151-13/+19
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-6/+6
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-18/+10
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-291-4/+0
| | | | | | | | | | | The macro was made empty in ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Id2bb2e2cabde059305d4af5f12593344ba30f001 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* Added QMessageAuthenticationCodeRuslan Nigmatullin2013-01-141-0/+84
QMessageAuthenticationCode is HMAC implementation based on QCryptographicHash abilities. HMAC is often used in OAuth and similar authentication protocols. Change-Id: Ifc73947ad06c36a1b770315b7e89ba5c01c5e79e Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>