From 10f2106404f01e7bb369fc66a597875fb455cd27 Mon Sep 17 00:00:00 2001 From: Maximilian Krambach Date: Wed, 4 Jul 2018 15:46:45 +0200 Subject: [PATCH] js: properly reject pgp message without signature -- * A verify at gpgme-json does not fail if there is a valid pgp message that does not include a signature. Instead, the answer will be devoid of signatures. In javascript, the SIG_NO_SIG error should be reported here, but wasn't. --- lang/js/src/gpgmejs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/js/src/gpgmejs.js b/lang/js/src/gpgmejs.js index c2a6b8b6..f49361dc 100644 --- a/lang/js/src/gpgmejs.js +++ b/lang/js/src/gpgmejs.js @@ -254,7 +254,7 @@ export class GpgME { } return new Promise(function(resolve, reject){ msg.post().then(function (message){ - if (!message.info.signatures){ + if (!message.info || !message.info.signatures){ reject(gpgme_error('SIG_NO_SIGS')); } else { let _result = collectSignatures(message.info.signatures);