aboutsummaryrefslogtreecommitdiffstats
path: root/common/openpgpdefs.h
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2019-01-29 17:20:34 +0000
committerWerner Koch <[email protected]>2019-01-29 19:18:52 +0000
commitb78f293cf06f447d1d0a5c416ac129a4e1cf9f8c (patch)
tree43eb1de717fb2a0ea44d9bf3e9fde702c9c5f93d /common/openpgpdefs.h
parentcommon: New helper functions for OpenPGP curve OIDs. (diff)
downloadgnupg-b78f293cf06f447d1d0a5c416ac129a4e1cf9f8c.tar.gz
gnupg-b78f293cf06f447d1d0a5c416ac129a4e1cf9f8c.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]> (cherry picked from commit f382984966a31a4cbe572bce5370590c5490ed1e)
Diffstat (limited to '')
-rw-r--r--common/openpgpdefs.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/common/openpgpdefs.h b/common/openpgpdefs.h
index 85a4251de..73776b368 100644
--- a/common/openpgpdefs.h
+++ b/common/openpgpdefs.h
@@ -184,5 +184,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. */
+
#endif /*GNUPG_COMMON_OPENPGPDEFS_H*/