Deliver connected keys to get-logins

This commit is contained in:
varjolintu 2018-04-03 08:18:18 +03:00
parent 7d631b5f94
commit dc58bc3573
2 changed files with 19 additions and 3 deletions

View file

@ -214,15 +214,24 @@ keepass.retrieveCredentials = function(callback, tab, url, submiturl, forceCallb
}
let entries = [];
let keys = [];
const kpAction = kpActions.GET_LOGINS;
const nonce = keepass.getNonce();
const incrementedNonce = keepass.incrementedNonce(nonce);
const {dbid} = keepass.getCryptoKey();
for (let keyHash in keepass.keyRing) {
keys.push({
id: keepass.keyRing[keyHash].id,
key: keepass.keyRing[keyHash].key
});
}
let messageData = {
action: kpAction,
id: dbid,
url: url
url: url,
keys: keys
};
if (submiturl) {
@ -704,7 +713,7 @@ keepass.isAssociated = function() {
keepass.migrateKeyRing = function() {
return new Promise((resolve, reject) => {
browser.storage.local.get('keyRing').then((item) => {
const keyring = item.keyRing;
const keyring = item.keyRing;
// Change dates to numbers, for compatibilty with Chromium based browsers
if (keyring) {
let num = 0;

View file

@ -158,7 +158,14 @@ Unencrypted message:
{
"action": "get-logins",
"url": "<snip>",
"submitUrl": optional
"submitUrl": optional,
"keys": [
{
"id": <connected_id>,
"key": <connected_key>
},
...
]
}
```