mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-12-04 15:39:34 +01:00
Fix keepassxc-browser password entropy display (#3107)
* Pass correct entropy amount to keepassxc-browser instead of amount of bits for both password and passphrase. * Rename json key from "login" to "entropy" (keeping "login" key for backwards compatibility). * Also make some changes to entropy calculation methods: - Rename PassphraseGenerator::calculateEntropy to estimateEntropy - Rename PasswordGenerator::calculateEntropy to estimateEntropy
This commit is contained in:
committed by
Jonathan White
parent
7ceca8ff3c
commit
e40f10657d
@@ -35,15 +35,16 @@ PassphraseGenerator::PassphraseGenerator()
|
||||
setDefaultWordList();
|
||||
}
|
||||
|
||||
double PassphraseGenerator::calculateEntropy(const QString& passphrase)
|
||||
double PassphraseGenerator::estimateEntropy(int wordCount)
|
||||
{
|
||||
Q_UNUSED(passphrase);
|
||||
|
||||
if (m_wordlist.isEmpty()) {
|
||||
return 0.0;
|
||||
}
|
||||
if (wordCount < 1) {
|
||||
wordCount = m_wordCount;
|
||||
}
|
||||
|
||||
return std::log2(m_wordlist.size()) * m_wordCount;
|
||||
return std::log2(m_wordlist.size()) * wordCount;
|
||||
}
|
||||
|
||||
void PassphraseGenerator::setWordCount(int wordCount)
|
||||
|
||||
Reference in New Issue
Block a user