(gpgsm_decrypt): Return GPG_ERR_NO_DATA if it is not a
authorWerner Koch <wk@gnupg.org>
Thu, 8 Apr 2004 09:53:32 +0000 (09:53 +0000)
committerWerner Koch <wk@gnupg.org>
Thu, 8 Apr 2004 09:53:32 +0000 (09:53 +0000)
encrypted message.

sm/ChangeLog
sm/decrypt.c

index c2627d3..eac744b 100644 (file)
@@ -1,3 +1,8 @@
+2004-04-08  Werner Koch  <wk@gnupg.org>
+
+       * decrypt.c (gpgsm_decrypt): Return GPG_ERR_NO_DATA if it is not a 
+       encrypted message.
+
 2004-04-07  Werner Koch  <wk@gnupg.org>
 
        * gpgsm.c: New option --force-crl-refresh.
index 76524b5..df0edc2 100644 (file)
@@ -333,6 +333,11 @@ gpgsm_decrypt (CTRL ctrl, int in_fd, FILE *out_fp)
                                numbuf, algoid?algoid:"?", NULL);
               }
 
+              /* If it seems that this is not an ecrypted message we
+                 return a more sensible error code. */
+              if (!algoid)
+                rc = gpg_error (GPG_ERR_NO_DATA);
+
               goto leave;
             }
           dfparm.algo = algo;