mirror of
https://github.com/openpgpjs/openpgpjs.git
synced 2026-02-28 14:03:26 +00:00
Fixes for symmetrically encrypted session keys
This commit is contained in:
committed by
Tankred Hase
parent
6c4e0ed6a0
commit
2e4e9387a0
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user