Merge pull request #1599 from keepassxreboot/fix/password_generator_with_older_keepassxc

Fix password generator with KeePassXC version 2.7.0
This commit is contained in:
Sami Vänttinen 2022-04-10 14:58:25 +03:00 committed by GitHub
commit 2a5d45a44f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 5 deletions

View file

@ -1,3 +1,7 @@
1.7.12 (07-04-2022)
=========================
- Add support for the new password generator with KeePassXC 2.7.0.
1.7.11 (11-12-2021)
=========================
- Add new Predefined Sites (FNAC, HP) [#1469]

View file

@ -334,12 +334,16 @@ keepass.generatePassword = async function(tab) {
const kpAction = kpActions.GENERATE_PASSWORD;
const [ nonce, incrementedNonce ] = keepass.getNonces();
const request = {
const messageData = {
action: kpAction,
nonce: nonce,
clientID: keepass.clientID
clientID: keepass.clientID,
requestID: keepass.getRequestId(),
};
const request = keepass.buildRequest(kpAction, keepass.encrypt(messageData, nonce), nonce, messageData.clientID);
request["requestID"] = messageData.requestID;
const response = await keepass.sendNativeMessage(request);
if (response.message && response.nonce) {
const res = keepass.decrypt(response.message, response.nonce);
@ -902,6 +906,11 @@ keepass.generateNewKeyPair = function() {
//console.log(nacl.util.encodeBase64(keepass.keyPair.publicKey) + ' ' + nacl.util.encodeBase64(keepass.keyPair.secretKey));
};
// Creates a random 8 character string for Request ID
keepass.getRequestId = function() {
return Math.random().toString(16).substring(2, 10);
};
keepass.isConfigured = async function() {
if (typeof(keepass.databaseHash) === 'undefined') {
const hash = keepass.getDatabaseHash();

View file

@ -1,8 +1,8 @@
{
"manifest_version": 2,
"name": "KeePassXC-Browser",
"version": "1.7.11",
"version_name": "1.7.11",
"version": "1.7.12",
"version_name": "1.7.12",
"description": "__MSG_extensionDescription__",
"author": "KeePassXC Team",
"icons": {

View file

@ -1,6 +1,6 @@
{
"name": "KeePassXC-Browser",
"version": "1.7.11",
"version": "1.7.12",
"description": "KeePassXC-Browser",
"main": "build.js",
"devDependencies": {