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

* verify.c (gpgsm_verify): Detect certs-only message.

This commit is contained in:
Werner Koch 2002-03-12 13:36:29 +00:00
parent c1791a8d15
commit 8337455483
11 changed files with 120 additions and 41 deletions

View file

@ -359,12 +359,18 @@ gpgsm_encrypt (CTRL ctrl, CERTLIST recplist, int data_fd, FILE *out_fp)
DEK dek = NULL;
int recpno;
FILE *data_fp = NULL;
struct certlist_s help_recplist;
CERTLIST cl;
memset (&encparm, 0, sizeof encparm);
help_recplist.next = NULL;
help_recplist.cert = NULL;
if (!recplist)
{
log_error(_("no valid recipients given\n"));
gpgsm_status (ctrl, STATUS_NO_RECP, "0");
rc = GNUPG_No_Public_Key;
goto leave;
}
kh = keydb_new (0);
if (!kh)
{
@ -373,21 +379,6 @@ gpgsm_encrypt (CTRL ctrl, CERTLIST recplist, int data_fd, FILE *out_fp)
goto leave;
}
/* If no recipient list is given, use a default one */
/* FIXME: we shoudl not do this but return an error and a
STATUS_NO_RECP */
if (!recplist)
{
rc = gpgsm_get_default_cert (&help_recplist.cert);
if (rc)
{
log_error ("no default recipient found\n");
rc = seterr (General_Error);
goto leave;
}
recplist = &help_recplist;
}
data_fp = fdopen ( dup (data_fd), "rb");
if (!data_fp)
{
@ -554,7 +545,5 @@ gpgsm_encrypt (CTRL ctrl, CERTLIST recplist, int data_fd, FILE *out_fp)
if (data_fp)
fclose (data_fp);
xfree (encparm.buffer);
if (help_recplist.cert)
ksba_cert_release (help_recplist.cert);
return rc;
}