Fixes for symmetrically encrypted session keys

This commit is contained in:
Bart Butler
2015-03-15 17:17:06 -07:00
committed by Tankred Hase
parent 6c4e0ed6a0
commit 2e4e9387a0
9 changed files with 243 additions and 107 deletions

View File

@@ -243,6 +243,9 @@ describe('Basic', function() {
var plaintext = 'short message\nnext line\n한국어/조선말';
var password1 = 'I am a password';
var password2 = 'I am another password';
var privKey, message, keyids;
it('Test initialization', function (done) {
@@ -256,7 +259,7 @@ describe('Basic', function() {
expect(pubKey).to.exist;
openpgp.encryptMessage([pubKey], plaintext).then(function(encrypted) {
openpgp.encryptMessage([pubKey], plaintext, [password1, password2]).then(function(encrypted) {
expect(encrypted).to.exist;
@@ -315,6 +318,22 @@ describe('Basic', function() {
});
});
it('Decrypt with password1 leads to the same result', function (done) {
openpgp.decryptMessage(password1, message).then(function(decrypted) {
expect(decrypted).to.exist;
expect(decrypted).to.equal(plaintext);
done();
});
});
it('Decrypt with password2 leads to the same result', function (done) {
openpgp.decryptMessage(password2, message).then(function(decrypted) {
expect(decrypted).to.exist;
expect(decrypted).to.equal(plaintext);
done();
});
});
it('Decrypt message 2x', function(done) {
var decrypted1;