js: properly reject pgp message without signature
authorMaximilian Krambach <maximilian.krambach@intevation.de>
Wed, 4 Jul 2018 13:46:45 +0000 (15:46 +0200)
committerMaximilian Krambach <maximilian.krambach@intevation.de>
Wed, 4 Jul 2018 13:46:45 +0000 (15:46 +0200)
--

* 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

index c2a6b8b..f49361d 100644 (file)
@@ -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);