1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

gpg: Do not pre-check keys given on the command line.

* g10/keydb.h (PK_LIST_ENCRYPT_TO, PK_LIST_HIDDEN, PK_LIST_CONFIG)
(PK_LIST_SHIFT): New.
* g10/pkclist.c (build_pk_list): Use them here.
* g10/gpg.c (check_user_ids, main): Ditto.

* g10/gpg.c (main): Set PK_LIST_CONFIG for REMUSR and LOCUSR.
(check_user_ids): Skip check for command line specified options.
--

If a key has been given on the command line and it has not been
given by one of the encrypt-to options, we now skip the checks.  The
reason is that the actual key selection code does its own checks and
provides proper status message to the caller to detect the wrong keys.
Without this we would break most frontends because they expect for
example STATUS_INV_RECP.

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2015-12-04 08:56:02 +01:00
parent 4ff2cae7de
commit 28311d1fa5
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
4 changed files with 61 additions and 21 deletions

View file

@ -69,6 +69,14 @@ enum resource_type {
};
/* Bit flags used with build_pk_list. */
#define PK_LIST_ENCRYPT_TO 1 /* This is an encrypt-to recipient. */
#define PK_LIST_HIDDEN 2 /* This is a hidden recipient. */
#define PK_LIST_CONFIG 4 /* Specified via config file. */
/* To store private data in the flags they must be left shifted by
this value. */
#define PK_LIST_SHIFT 3
/****************
* A data structure to hold information about the external position
* of a keyblock.