s2k.js,async_proxy.js: Initialize variable data properly

It fixes error when running the example code (in Node.js with enforced strict
mode) from README.md:

[ReferenceError: data is not defined]
Error: Error generating keypair using js fallback!
    at /tmp/fff/node_modules/openpgp/src/openpgp.js:266:13
    at process._tickDomainCallback (node.js:399:9)
This commit is contained in:
Artem Chudinov 2015-08-19 22:32:06 +05:00
parent 1ee96a3f40
commit 9de55b49f3
2 changed files with 6 additions and 6 deletions

View File

@ -153,8 +153,8 @@ S2K.prototype.produce_key = function (passphrase, numBytes) {
case 'iterated':
var isp = [],
count = s2k.get_count();
data = s2k.salt + passphrase;
count = s2k.get_count(),
data = s2k.salt + passphrase;
while (isp.length * data.length < count)
isp.push(data);

View File

@ -333,8 +333,8 @@ AsyncProxy.prototype.decryptKey = function(privateKey, password) {
});
self.tasks.push({ resolve:function(data) {
var packetlist = packet.List.fromStructuredClone(data);
data = new key.Key(packetlist);
var packetlist = packet.List.fromStructuredClone(data),
data = new key.Key(packetlist);
resolve(data);
}, reject:reject });
});
@ -361,8 +361,8 @@ AsyncProxy.prototype.decryptKeyPacket = function(privateKey, keyIds, password) {
});
self.tasks.push({ resolve:function(data) {
var packetlist = packet.List.fromStructuredClone(data);
data = new key.Key(packetlist);
var packetlist = packet.List.fromStructuredClone(data),
data = new key.Key(packetlist);
resolve(data);
}, reject:reject });
});