Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken browser integration since #6899 #7030

Merged
merged 3 commits into from
Oct 9, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core/Tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ namespace Tools
}

const auto uuid = hexToUuid(uuidStr);
if (uuid.isNull() || uuid.version() == QUuid::VerUnknown) {
if (uuid.isNull()) {
return false;
}

Expand Down
7 changes: 5 additions & 2 deletions tests/TestTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,17 @@ void TestTools::testEnvSubstitute()
void TestTools::testValidUuid()
{
auto validUuid = Tools::uuidToHex(QUuid::createUuid());
auto nonValidUuid = "1234567890abcdef1234567890abcdef";
auto nonRfc4122Uuid = "1234567890abcdef1234567890abcdef";
auto emptyUuid = QString();
auto shortUuid = validUuid.left(10);
auto longUuid = validUuid + "baddata";
auto nonHexUuid = Tools::uuidToHex(QUuid::createUuid()).replace(0, 1, 'p');

QVERIFY(Tools::isValidUuid(validUuid));
QVERIFY(not Tools::isValidUuid(nonValidUuid));
/* Before https://github.com/keepassxreboot/keepassxc/pull/1770/, entry
* UUIDs are simply random 16-byte strings. Such older entries should be
* accepted as well. */
QVERIFY(Tools::isValidUuid(nonRfc4122Uuid));
droidmonkey marked this conversation as resolved.
Show resolved Hide resolved
QVERIFY(not Tools::isValidUuid(emptyUuid));
QVERIFY(not Tools::isValidUuid(shortUuid));
QVERIFY(not Tools::isValidUuid(longUuid));
Expand Down