add signature check to integration test

This commit is contained in:
Tankred Hase 2013-12-04 12:26:03 +01:00
parent 63db9246c6
commit 9ee587ad4f
3 changed files with 6 additions and 5 deletions

View File

@ -4,7 +4,7 @@
require.config({
baseUrl: './',
paths: {
openpgp: '../../resources/openpgp.min'
openpgp: '../../resources/openpgp'
},
shim: {
openpgp: {

View File

@ -132,7 +132,7 @@ define(function(require) {
});
});
describe('Encrypt', function() {
describe('Encrypt and Sign', function() {
it('should work', function(done) {
pgp.encrypt(message, [pubkey], function(err, ct) {
expect(err).to.not.exist;
@ -143,11 +143,12 @@ define(function(require) {
});
});
describe('Decrypt', function() {
describe('Decrypt and verify', function() {
it('should work', function(done) {
pgp.decrypt(ciphertext, pubkey, function(err, pt) {
expect(err).to.not.exist;
expect(pt).to.equal(message);
expect(pt.text).to.equal(message);
expect(pt.validSignatures[0]).to.be.true;
done();
});
});

View File

@ -160,7 +160,7 @@ define(function(require) {
}
if (keymat !== null) {
var decrypted = msg.decryptAndVerifySignature(keymat, sesskey, senderKey);
callback(null, decrypted.text);
callback(null, decrypted);
} else {
callback({