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

gpg: Distinguish between missing and cleared key flags.

* include/cipher.h (PUBKEY_USAGE_NONE): New.
* g10/getkey.c (parse_key_usage): Set new flag.
--

We do not want to use the default capabilities (derived from the
algorithm) if any key flags are given in a signature.  Thus if key
flags are used in any way, the default key capabilities are never
used.

This allows to create a key with key flags set to all zero so it can't
be used.  This better reflects common sense.
(cherry picked from commit 4bde12206c)
(cherry picked from commit 0a805ed160)

Resolved conflicts:
	include/cipher.h
This commit is contained in:
Werner Koch 2013-03-15 15:46:03 +01:00
parent 69088ac76f
commit 27d0f32f77
2 changed files with 8 additions and 1 deletions

View file

@ -58,6 +58,7 @@
#define PUBKEY_USAGE_CERT 4 /* key is also good to certify other keys*/
#define PUBKEY_USAGE_AUTH 8 /* key is good for authentication */
#define PUBKEY_USAGE_UNKNOWN 128 /* key has an unknown usage bit */
#define PUBKEY_USAGE_NONE 256 /* No usage given. */
#define DIGEST_ALGO_MD5 1
#define DIGEST_ALGO_SHA1 2