1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

[g13] Add RECIPEINT and CREATE command.

[sm] Chnage --include-certs default
This commit is contained in:
Werner Koch 2009-10-19 09:18:46 +00:00
parent d839e154d3
commit 97be197d31
16 changed files with 150 additions and 64 deletions

View file

@ -1,3 +1,9 @@
2009-10-19 Werner Koch <wk@g10code.com>
* options.h (glo_ctrl): Add field LASTERR.
* mainproc.c (proc_encrypted): Set LASTERR.
* server.c (cmd_decrypt): Check LASTERR.
2009-10-02 Werner Koch <wk@g10code.com>
* server.c (cmd_encrypt, cmd_decrypt): Implement.

View file

@ -581,6 +581,7 @@ proc_encrypted( CTX c, PACKET *pkt )
}
}
else if( result == G10ERR_BAD_SIGN ) {
glo_ctrl.lasterr = result;
log_error(_("WARNING: encrypted message has been manipulated!\n"));
write_status( STATUS_BADMDC );
write_status( STATUS_DECRYPTION_FAILED );
@ -593,6 +594,7 @@ proc_encrypted( CTX c, PACKET *pkt )
c->dek->s2k_cacheid);
passphrase_clear_cache (NULL, c->dek->s2k_cacheid, 0);
}
glo_ctrl.lasterr = result;
write_status( STATUS_DECRYPTION_FAILED );
log_error(_("decryption failed: %s\n"), g10_errstr(result));
/* Hmmm: does this work when we have encrypted using multiple

View file

@ -257,6 +257,11 @@ EXTERN_UNLESS_MAIN_MODULE
struct {
int in_auto_key_retrieve; /* True if we are doing an
auto_key_retrieve. */
/* Hack to store the last error. We currently need it because the
proc_packet machinery is not able to reliabale return error
codes. Thus for the --server purposes we store some of the error
codes here. FIXME! */
gpg_error_t lasterr;
} glo_ctrl;
#define DBG_PACKET_VALUE 1 /* debug packet reading/writing */

View file

@ -362,7 +362,10 @@ cmd_decrypt (assuan_context_t ctx, char *line)
if (out_fd == -1)
return set_error (GPG_ERR_ASS_NO_OUTPUT, NULL);
glo_ctrl.lasterr = 0;
err = decrypt_message_fd (inp_fd, out_fd);
if (!err)
err = glo_ctrl.lasterr;
/* Close and reset the fds. */
close_message_fd (ctrl);