aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--g10/keydb.h14
-rw-r--r--g10/packet.h15
2 files changed, 22 insertions, 7 deletions
diff --git a/g10/keydb.h b/g10/keydb.h
index 68bc81840..255110cc7 100644
--- a/g10/keydb.h
+++ b/g10/keydb.h
@@ -37,14 +37,14 @@
|| IS_SUBKEY_REV(s) \
|| IS_ATTST_SIGS(s) )
#define IS_SIG(s) (!IS_CERT(s))
-#define IS_KEY_SIG(s) ((s)->sig_class == 0x1f)
-#define IS_UID_SIG(s) (((s)->sig_class & ~3) == 0x10)
+#define IS_KEY_SIG(s) ((s)->sig_class == SIGCLASS_KEY)
+#define IS_UID_SIG(s) (((s)->sig_class & ~3) == SIGCLASS_CERT)
#define IS_ATTST_SIGS(s) ((s)->sig_class == 0x16)
-#define IS_SUBKEY_SIG(s) ((s)->sig_class == 0x18)
-#define IS_BACK_SIG(s) ((s)->sig_class == 0x19)
-#define IS_KEY_REV(s) ((s)->sig_class == 0x20)
-#define IS_UID_REV(s) ((s)->sig_class == 0x30)
-#define IS_SUBKEY_REV(s) ((s)->sig_class == 0x28)
+#define IS_SUBKEY_SIG(s) ((s)->sig_class == SIGCLASS_SUBKEY)
+#define IS_BACK_SIG(s) ((s)->sig_class == SIGCLASS_BACKSIG)
+#define IS_KEY_REV(s) ((s)->sig_class == SIGCLASS_KEYREV)
+#define IS_UID_REV(s) ((s)->sig_class == SIGCLASS_CERTREV)
+#define IS_SUBKEY_REV(s) ((s)->sig_class == SIGCLASS_SUBREV)
struct getkey_ctx_s;
typedef struct getkey_ctx_s *GETKEY_CTX;
diff --git a/g10/packet.h b/g10/packet.h
index ac6df7d5c..e385966d3 100644
--- a/g10/packet.h
+++ b/g10/packet.h
@@ -69,6 +69,21 @@
/* The usage bits which define encryption. */
#define PUBKEY_USAGE_XENC_MASK (PUBKEY_USAGE_ENC | PUBKEY_USAGE_RENC)
+/* The signature classes. */
+#define SIGCLASS_DATA 0x00 /* Signature on a binary document. */
+#define SIGCLASS_TEXT 0x01 /* Signature on a text document. */
+#define SIGCLASS_SALONE 0x02 /* Standalone signature. */
+#define SIGCLASS_CERT 0x10 /* User ID certification signature. */
+#define SIGCLASS_CERT11 0x11 /* User ID certification signature. */
+#define SIGCLASS_CERT12 0x12 /* User ID certification signature. */
+#define SIGCLASS_CERT13 0x13 /* User ID certification signature. */
+#define SIGCLASS_SUBKEY 0x18 /* Key binding signature. */
+#define SIGCLASS_BACKSIG 0x19 /* Primary key binding signature. */
+#define SIGCLASS_KEY 0x1f /* Direct key signature (on primary key) */
+#define SIGCLASS_KEYREV 0x20 /* Key revoction signature. */
+#define SIGCLASS_SUBREV 0x28 /* Subkey revocation signature. */
+#define SIGCLASS_CERTREV 0x30 /* Certification revocation signature. */
+
/* Bitflags to convey hints on what kind of signature is created. */
#define SIGNHINT_KEYSIG 1
#define SIGNHINT_SELFSIG 2