Skip to content

Commit 5eabc28

Browse files
committed
Fix warning C4996: 'Botan::KDF::derive_key': Use std::span or std::string_view overloads
Signed-off-by: Sven Strickroth <[email protected]>
1 parent d28ac77 commit 5eabc28

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/format/BitwardenReader.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,11 +387,11 @@ QSharedPointer<Database> BitwardenReader::convert(const QString& path, const QSt
387387
auto hkdf = Botan::KDF::create_or_throw("HKDF-Expand(SHA-256)");
388388

389389
// Derive the MAC Key
390-
auto stretched_mac = hkdf->derive_key(32, reinterpret_cast<const uint8_t*>(key.data()), key.size(), "", "mac");
390+
auto stretched_mac = hkdf->derive_key(32, std::span(reinterpret_cast<const uint8_t*>(key.data()), key.size()), "", "mac");
391391
auto mac = QByteArray(reinterpret_cast<const char*>(stretched_mac.data()), static_cast<int>(stretched_mac.size()));
392392

393393
// Stretch the Master Key
394-
auto stretched_key = hkdf->derive_key(32, reinterpret_cast<const uint8_t*>(key.data()), key.size(), "", "enc");
394+
auto stretched_key = hkdf->derive_key(32, std::span(reinterpret_cast<const uint8_t*>(key.data()), key.size()), "", "enc");
395395
key = QByteArray(reinterpret_cast<const char*>(stretched_key.data()), static_cast<int>(stretched_key.size()));
396396

397397
// Validate the encryption key

0 commit comments

Comments
 (0)