summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2003-12-19 13:53:48 +0000
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2003-12-19 13:53:48 +0000
commitf6a2c06df5cdaff5d1b4fce1f05707567c4f4cc3 (patch)
treee70bcbf1563886537771bcf86e318b8c6c4c2233
parentfe99243f9e2fcc17f7c3467a0bf6b675eb2e4d52 (diff)
downloadgnutls-f6a2c06df5cdaff5d1b4fce1f05707567c4f4cc3.tar.gz
Corrected a bug in the GNUTLS_KEY key usage definitions.
-rw-r--r--NEWS1
-rw-r--r--includes/gnutls/x509.h22
-rw-r--r--lib/gnutls_cert.h18
3 files changed, 23 insertions, 18 deletions
diff --git a/NEWS b/NEWS
index c8761c58e4..7272ea54dd 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,7 @@
Version 1.0.3
- Corrected bug in gnutls_bye() which made it return an error code
of INVALID_REQUEST instead of success.
+- Corrected a bug in the GNUTLS_KEY key usage definitions.
Version 1.0.2 (18/12/2003)
- Corrected a bug in the RSA key generation. This was
diff --git a/includes/gnutls/x509.h b/includes/gnutls/x509.h
index 143c67abd5..a59fd5ff1b 100644
--- a/includes/gnutls/x509.h
+++ b/includes/gnutls/x509.h
@@ -91,15 +91,19 @@ int gnutls_x509_dn_oid_known(const char* oid);
/* key_usage will be an OR of the following values:
*/
-#define GNUTLS_KEY_DIGITAL_SIGNATURE 256
-#define GNUTLS_KEY_NON_REPUDIATION 128
-#define GNUTLS_KEY_KEY_ENCIPHERMENT 64
-#define GNUTLS_KEY_DATA_ENCIPHERMENT 32
-#define GNUTLS_KEY_KEY_AGREEMENT 16
-#define GNUTLS_KEY_KEY_CERT_SIGN 8
-#define GNUTLS_KEY_CRL_SIGN 4
-#define GNUTLS_KEY_ENCIPHER_ONLY 2
-#define GNUTLS_KEY_DECIPHER_ONLY 1
+#define GNUTLS_KEY_DIGITAL_SIGNATURE 128 /* when the key is to be
+ * used for signing.
+ */
+#define GNUTLS_KEY_NON_REPUDIATION 64
+#define GNUTLS_KEY_KEY_ENCIPHERMENT 32 /* when the key is to be
+ * used for encryption.
+ */
+#define GNUTLS_KEY_DATA_ENCIPHERMENT 16
+#define GNUTLS_KEY_KEY_AGREEMENT 8
+#define GNUTLS_KEY_KEY_CERT_SIGN 4
+#define GNUTLS_KEY_CRL_SIGN 2
+#define GNUTLS_KEY_ENCIPHER_ONLY 1
+#define GNUTLS_KEY_DECIPHER_ONLY 256
int gnutls_x509_crt_get_extension_oid(gnutls_x509_crt cert, int indx,
void* oid, size_t * sizeof_oid);
diff --git a/lib/gnutls_cert.h b/lib/gnutls_cert.h
index f12bc96274..a809a9fdfd 100644
--- a/lib/gnutls_cert.h
+++ b/lib/gnutls_cert.h
@@ -15,15 +15,15 @@
/* For key Usage, test as:
* if (st.keyUsage & KEY_DIGITAL_SIGNATURE) ...
*/
-#define KEY_DIGITAL_SIGNATURE 256
-#define KEY_NON_REPUDIATION 128
-#define KEY_KEY_ENCIPHERMENT 64
-#define KEY_DATA_ENCIPHERMENT 32
-#define KEY_KEY_AGREEMENT 16
-#define KEY_KEY_CERT_SIGN 8
-#define KEY_CRL_SIGN 4
-#define KEY_ENCIPHER_ONLY 2
-#define KEY_DECIPHER_ONLY 1
+#define KEY_DIGITAL_SIGNATURE 128
+#define KEY_NON_REPUDIATION 64
+#define KEY_KEY_ENCIPHERMENT 32
+#define KEY_DATA_ENCIPHERMENT 16
+#define KEY_KEY_AGREEMENT 8
+#define KEY_KEY_CERT_SIGN 4
+#define KEY_CRL_SIGN 2
+#define KEY_ENCIPHER_ONLY 1
+#define KEY_DECIPHER_ONLY 256
typedef struct gnutls_cert {
GNUTLS_MPI params[MAX_PUBLIC_PARAMS_SIZE]; /* the size of params depends on the public