mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Add support for the new password generator
This commit is contained in:
parent
f9a088882d
commit
4f94d4f7a3
1 changed files with 11 additions and 2 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue