mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
* server.c (gpgsm_server): Add arg DEFAULT_RECPLIST.
(cmd_encrypt): Add all enrypt-to marked certs to the list. * encrypt.c (gpgsm_encrypt): Check that real recipients are available. * gpgsm.c (main): Make the --encrypt-to and --no-encrypt-to options work. Pass the list of recients to gpgsm_server. * gpgsm.h (certlist_s): Add field IS_ENCRYPT_TO. (opt): Add NO_ENCRYPT_TO. * certlist.c (gpgsm_add_to_certlist): New arg IS_ENCRYPT_TO. Changed all callers and ignore duplicate entries. (is_cert_in_certlist): New. (gpgsm_add_cert_to_certlist): New.
This commit is contained in:
parent
aac9cea6da
commit
711c4853d6
7 changed files with 203 additions and 87 deletions
12
sm/encrypt.c
12
sm/encrypt.c
|
@ -306,7 +306,13 @@ gpgsm_encrypt (CTRL ctrl, CERTLIST recplist, int data_fd, FILE *out_fp)
|
|||
|
||||
memset (&encparm, 0, sizeof encparm);
|
||||
|
||||
if (!recplist)
|
||||
/* Check that the certificate list is not empty and that at least
|
||||
one certificate is not flagged as encrypt_to; i.e. is a real
|
||||
recipient. */
|
||||
for (cl = recplist; cl; cl = cl->next)
|
||||
if (!cl->is_encrypt_to)
|
||||
break;
|
||||
if (!cl)
|
||||
{
|
||||
log_error(_("no valid recipients given\n"));
|
||||
gpgsm_status (ctrl, STATUS_NO_RECP, "0");
|
||||
|
@ -412,7 +418,7 @@ gpgsm_encrypt (CTRL ctrl, CERTLIST recplist, int data_fd, FILE *out_fp)
|
|||
goto leave;
|
||||
}
|
||||
|
||||
/* gather certificates of recipients, encrypt the session key for
|
||||
/* Gather certificates of recipients, encrypt the session key for
|
||||
each and store them in the CMS object */
|
||||
for (recpno = 0, cl = recplist; cl; recpno++, cl = cl->next)
|
||||
{
|
||||
|
@ -447,7 +453,7 @@ gpgsm_encrypt (CTRL ctrl, CERTLIST recplist, int data_fd, FILE *out_fp)
|
|||
}
|
||||
}
|
||||
|
||||
/* main control loop for encryption */
|
||||
/* Main control loop for encryption. */
|
||||
recpno = 0;
|
||||
do
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue