diff options
author | Werner Koch <[email protected]> | 2019-01-29 17:20:34 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2019-01-29 17:20:34 +0000 |
commit | f382984966a31a4cbe572bce5370590c5490ed1e (patch) | |
tree | e01bafffc5543ade4375183160f7ba32779c1c98 | |
parent | common: New helper functions for OpenPGP curve OIDs. (diff) | |
download | gnupg-f382984966a31a4cbe572bce5370590c5490ed1e.tar.gz gnupg-f382984966a31a4cbe572bce5370590c5490ed1e.zip |
common: Provide some convenient OpenPGP related constants.
* common/openpgpdefs.h (OPENPGP_MAX_NPKEY): New.
(OPENPGP_MAX_NSKEY): New.
(OPENPGP_MAX_NSIG): New.
(OPENPGP_MAX_NENC): New.
* g10/packet.h: Define PUBKEY_MAX using the new consts.
Signed-off-by: Werner Koch <[email protected]>
-rw-r--r-- | common/openpgpdefs.h | 6 | ||||
-rw-r--r-- | g10/packet.h | 10 |
2 files changed, 10 insertions, 6 deletions
diff --git a/common/openpgpdefs.h b/common/openpgpdefs.h index aadda434b..2f7ff456e 100644 --- a/common/openpgpdefs.h +++ b/common/openpgpdefs.h @@ -196,7 +196,11 @@ typedef enum } compress_algo_t; - +/* Limits to be used for static arrays. */ +#define OPENPGP_MAX_NPKEY 5 /* Maximum number of public key parameters. */ +#define OPENPGP_MAX_NSKEY 7 /* Maximum number of secret key parameters. */ +#define OPENPGP_MAX_NSIG 2 /* Maximum number of signature parameters. */ +#define OPENPGP_MAX_NENC 2 /* Maximum number of encryption parameters. */ /* Decode an rfc4880 encoded S2K count. */ diff --git a/g10/packet.h b/g10/packet.h index 78a57bacf..6160d0b01 100644 --- a/g10/packet.h +++ b/g10/packet.h @@ -34,11 +34,11 @@ #define DEBUG_PARSE_PACKET 1 -/* Constants to allocate static MPI arrays. */ -#define PUBKEY_MAX_NPKEY 5 -#define PUBKEY_MAX_NSKEY 7 -#define PUBKEY_MAX_NSIG 2 -#define PUBKEY_MAX_NENC 2 +/* Constants to allocate static MPI arrays. */ +#define PUBKEY_MAX_NPKEY OPENPGP_MAX_NPKEY +#define PUBKEY_MAX_NSKEY OPENPGP_MAX_NSKEY +#define PUBKEY_MAX_NSIG OPENPGP_MAX_NSIG +#define PUBKEY_MAX_NENC OPENPGP_MAX_NENC /* Usage flags */ #define PUBKEY_USAGE_SIG GCRY_PK_USAGE_SIGN /* Good for signatures. */ |