diff options
author | Werner Koch <wk@gnupg.org> | 2004-04-08 11:53:32 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2004-04-08 11:53:32 +0200 |
commit | 389fa08de6077a0ef3499d841dee2d26ffa657d4 (patch) | |
tree | c53f7af233d85f5dff4b9951baadc0d182dcfa56 /sm | |
parent | Documented --force-crl-refresh (diff) | |
download | gnupg2-389fa08de6077a0ef3499d841dee2d26ffa657d4.tar.xz gnupg2-389fa08de6077a0ef3499d841dee2d26ffa657d4.zip |
(gpgsm_decrypt): Return GPG_ERR_NO_DATA if it is not a
encrypted message.
Diffstat (limited to 'sm')
-rw-r--r-- | sm/ChangeLog | 5 | ||||
-rw-r--r-- | sm/decrypt.c | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/sm/ChangeLog b/sm/ChangeLog index c2627d3d2..eac744b08 100644 --- a/sm/ChangeLog +++ b/sm/ChangeLog @@ -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. diff --git a/sm/decrypt.c b/sm/decrypt.c index 76524b51f..df0edc2ae 100644 --- a/sm/decrypt.c +++ b/sm/decrypt.c @@ -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; |