[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[SCM] GNU gnutls branch, gnutls_3_1_x, updated. gnutls_3_1_1-27-gc3e3f13
From: |
Nikos Mavrogiannopoulos |
Subject: |
[SCM] GNU gnutls branch, gnutls_3_1_x, updated. gnutls_3_1_1-27-gc3e3f13 |
Date: |
Sun, 16 Sep 2012 19:22:14 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU gnutls".
http://git.savannah.gnu.org/cgit/gnutls.git/commit/?id=c3e3f139160fe22b881b9f11d1c892a4dac5feea
The branch, gnutls_3_1_x has been updated
via c3e3f139160fe22b881b9f11d1c892a4dac5feea (commit)
via d11584102d4f2a255c9f87311965aa9d4c343e1a (commit)
via d1d7fecdee90ceb0c738654860385773d4008984 (commit)
via 20a3064af5cd7165c74418c998a81d65f6b7f253 (commit)
via 0ff2277def4b9f2d258cf3cfdd8564fb1d9ce88f (commit)
from afca5e28143c78c1ae9bdcf85be1e5f9faeb6e2a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit c3e3f139160fe22b881b9f11d1c892a4dac5feea
Author: Nikos Mavrogiannopoulos <address@hidden>
Date: Sun Sep 16 21:21:28 2012 +0200
updated minitasn1
commit d11584102d4f2a255c9f87311965aa9d4c343e1a
Author: Nikos Mavrogiannopoulos <address@hidden>
Date: Sun Sep 16 21:20:04 2012 +0200
Use the pkg-config macro to find libtasn1.
commit d1d7fecdee90ceb0c738654860385773d4008984
Author: Nikos Mavrogiannopoulos <address@hidden>
Date: Wed Sep 12 22:45:55 2012 +0200
Use the new asn1_read_node_value()
commit 20a3064af5cd7165c74418c998a81d65f6b7f253
Author: Nikos Mavrogiannopoulos <address@hidden>
Date: Sun Sep 16 20:48:36 2012 +0200
removed old libtasn1 requirements
commit 0ff2277def4b9f2d258cf3cfdd8564fb1d9ce88f
Author: Nikos Mavrogiannopoulos <address@hidden>
Date: Sun Sep 16 20:48:18 2012 +0200
MAX_NAME_SIZE -> MAX_SERVER_NAME_SIZE
-----------------------------------------------------------------------
Summary of changes:
lib/Makefile.am | 3 ++-
lib/minitasn1/element.c | 20 ++++++++++++++++++++
lib/minitasn1/int.h | 44 ++++++++++++++++++++++----------------------
lib/minitasn1/libtasn1.h | 38 +++++++++++++++++++++++++++++++++++++-
lib/x509/mpi.c | 3 ---
lib/x509/verify-high.c | 4 ++--
lib/x509/x509.c | 27 +++++++++++++++++++++------
lib/x509/x509_int.h | 8 --------
m4/hooks.m4 | 6 ++----
9 files changed, 106 insertions(+), 47 deletions(-)
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 8df6d9b..d0951d4 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -37,6 +37,7 @@ AM_CPPFLAGS = \
-I$(srcdir)/includes \
-I$(builddir)/includes \
-I$(srcdir)/x509 \
+ $(LIBTASN1_CFLAGS) \
$(P11_KIT_CFLAGS)
if ENABLE_OPENPGP
@@ -142,7 +143,7 @@ endif
if ENABLE_MINITASN1
libgnutls_la_LIBADD += minitasn1/libminitasn1.la
else
-libgnutls_la_LDFLAGS += $(LTLIBTASN1)
+libgnutls_la_LDFLAGS += $(LIBTASN1_LIBS)
endif
if ENABLE_NETTLE
diff --git a/lib/minitasn1/element.c b/lib/minitasn1/element.c
index ead899c..8e8807b 100644
--- a/lib/minitasn1/element.c
+++ b/lib/minitasn1/element.c
@@ -976,3 +976,23 @@ asn1_read_tag (ASN1_TYPE root, const char *name, int
*tagValue,
return ASN1_SUCCESS;
}
+
+/**
+ * asn1_read_node_value:
+ * @node: pointer to a node.
+ * @data: a point to a node_data_struct
+ *
+ * Returns the value a data node inside a ASN1_TYPE structure.
+ * The data returned should be handled as constant values.
+ *
+ * Returns: %ASN1_SUCCESS if the node exists.
+ **/
+asn1_retCode asn1_read_node_value (ASN1_TYPE node, ASN1_DATA_NODE* data)
+{
+ data->name = node->name;
+ data->value = node->value;
+ data->value_len = node->value_len;
+ data->type = type_field(node->type);
+
+ return ASN1_SUCCESS;
+}
diff --git a/lib/minitasn1/int.h b/lib/minitasn1/int.h
index 82de579..aad7ba6 100644
--- a/lib/minitasn1/int.h
+++ b/lib/minitasn1/int.h
@@ -83,28 +83,28 @@ struct node_asn_struct
#define type_field(x) (x&0xFF)
/* List of constants for field type of typedef node_asn */
-#define TYPE_CONSTANT 1
-#define TYPE_IDENTIFIER 2
-#define TYPE_INTEGER 3
-#define TYPE_BOOLEAN 4
-#define TYPE_SEQUENCE 5
-#define TYPE_BIT_STRING 6
-#define TYPE_OCTET_STRING 7
-#define TYPE_TAG 8
-#define TYPE_DEFAULT 9
-#define TYPE_SIZE 10
-#define TYPE_SEQUENCE_OF 11
-#define TYPE_OBJECT_ID 12
-#define TYPE_ANY 13
-#define TYPE_SET 14
-#define TYPE_SET_OF 15
-#define TYPE_DEFINITIONS 16
-#define TYPE_TIME 17
-#define TYPE_CHOICE 18
-#define TYPE_IMPORTS 19
-#define TYPE_NULL 20
-#define TYPE_ENUMERATED 21
-#define TYPE_GENERALSTRING 27
+#define TYPE_CONSTANT ASN1_ETYPE_CONSTANT
+#define TYPE_IDENTIFIER ASN1_ETYPE_IDENTIFIER
+#define TYPE_INTEGER ASN1_ETYPE_INTEGER
+#define TYPE_BOOLEAN ASN1_ETYPE_BOOLEAN
+#define TYPE_SEQUENCE ASN1_ETYPE_SEQUENCE
+#define TYPE_BIT_STRING ASN1_ETYPE_BIT_STRING
+#define TYPE_OCTET_STRING ASN1_ETYPE_OCTET_STRING
+#define TYPE_TAG ASN1_ETYPE_TAG
+#define TYPE_DEFAULT ASN1_ETYPE_DEFAULT
+#define TYPE_SIZE ASN1_ETYPE_SIZE
+#define TYPE_SEQUENCE_OF ASN1_ETYPE_SEQUENCE_OF
+#define TYPE_OBJECT_ID ASN1_ETYPE_OBJECT_ID
+#define TYPE_ANY ASN1_ETYPE_ANY
+#define TYPE_SET ASN1_ETYPE_SET
+#define TYPE_SET_OF ASN1_ETYPE_SET_OF
+#define TYPE_DEFINITIONS ASN1_ETYPE_DEFINITIONS
+#define TYPE_TIME ASN1_ETYPE_TIME
+#define TYPE_CHOICE ASN1_ETYPE_CHOICE
+#define TYPE_IMPORTS ASN1_ETYPE_IMPORTS
+#define TYPE_NULL ASN1_ETYPE_NULL
+#define TYPE_ENUMERATED ASN1_ETYPE_ENUMERATED
+#define TYPE_GENERALSTRING ASN1_ETYPE_GENERALSTRING
/***********************************************************************/
diff --git a/lib/minitasn1/libtasn1.h b/lib/minitasn1/libtasn1.h
index 063b1d6..e9337e2 100644
--- a/lib/minitasn1/libtasn1.h
+++ b/lib/minitasn1/libtasn1.h
@@ -44,7 +44,7 @@ extern "C"
{
#endif
-#define ASN1_VERSION "2.13"
+#define ASN1_VERSION "2.14"
typedef int asn1_retCode; /* type returned by libtasn1 functions */
@@ -141,6 +141,39 @@ extern "C"
};
typedef struct static_struct_asn ASN1_ARRAY_TYPE;
+/* List of constants for field type of typedef node_asn */
+#define ASN1_ETYPE_CONSTANT 1
+#define ASN1_ETYPE_IDENTIFIER 2
+#define ASN1_ETYPE_INTEGER 3
+#define ASN1_ETYPE_BOOLEAN 4
+#define ASN1_ETYPE_SEQUENCE 5
+#define ASN1_ETYPE_BIT_STRING 6
+#define ASN1_ETYPE_OCTET_STRING 7
+#define ASN1_ETYPE_TAG 8
+#define ASN1_ETYPE_DEFAULT 9
+#define ASN1_ETYPE_SIZE 10
+#define ASN1_ETYPE_SEQUENCE_OF 11
+#define ASN1_ETYPE_OBJECT_ID 12
+#define ASN1_ETYPE_ANY 13
+#define ASN1_ETYPE_SET 14
+#define ASN1_ETYPE_SET_OF 15
+#define ASN1_ETYPE_DEFINITIONS 16
+#define ASN1_ETYPE_TIME 17
+#define ASN1_ETYPE_CHOICE 18
+#define ASN1_ETYPE_IMPORTS 19
+#define ASN1_ETYPE_NULL 20
+#define ASN1_ETYPE_ENUMERATED 21
+#define ASN1_ETYPE_GENERALSTRING 27
+
+ struct node_data_struct
+ {
+ const char *name; /* Node name */
+ const void *value; /* Node value */
+ unsigned int value_len; /* Node value size */
+ unsigned int type; /* Node value type (ASN1_ETYPE_*) */
+ };
+ typedef struct node_data_struct ASN1_DATA_NODE;
+
/***********************************/
/* Fixed constants */
/***********************************/
@@ -193,6 +226,9 @@ extern "C"
void *ivalue, int *len);
extern ASN1_API asn1_retCode
+ asn1_read_node_value (ASN1_TYPE node, ASN1_DATA_NODE* data);
+
+ extern ASN1_API asn1_retCode
asn1_number_of_elements (ASN1_TYPE element, const char *name, int *num);
extern ASN1_API asn1_retCode
diff --git a/lib/x509/mpi.c b/lib/x509/mpi.c
index baef1ee..c9d3058 100644
--- a/lib/x509/mpi.c
+++ b/lib/x509/mpi.c
@@ -229,9 +229,6 @@ _gnutls_x509_write_sig_params (ASN1_TYPE dst, const char
*dst_name,
return 0;
}
-
-
-
/* this function reads a (small) unsigned integer
* from asn1 structs. Combines the read and the convertion
* steps.
diff --git a/lib/x509/verify-high.c b/lib/x509/verify-high.c
index 0c299b1..cdc9ecf 100644
--- a/lib/x509/verify-high.c
+++ b/lib/x509/verify-high.c
@@ -35,7 +35,7 @@
struct named_cert_st {
gnutls_x509_crt_t cert;
- uint8_t name[MAX_NAME_SIZE];
+ uint8_t name[MAX_SERVER_NAME_SIZE];
unsigned int name_size;
};
@@ -228,7 +228,7 @@
gnutls_x509_trust_list_add_named_crt(gnutls_x509_trust_list_t list,
int ret;
uint32_t hash;
- if (name_size >= MAX_NAME_SIZE)
+ if (name_size >= MAX_SERVER_NAME_SIZE)
return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST);
ret = gnutls_x509_crt_get_raw_issuer_dn(cert, &dn);
diff --git a/lib/x509/x509.c b/lib/x509/x509.c
index 1158b4b..c5f0b44 100644
--- a/lib/x509/x509.c
+++ b/lib/x509/x509.c
@@ -2153,10 +2153,12 @@ gnutls_x509_dn_get_rdn_ava (gnutls_x509_dn_t dn,
int irdn, int iava, gnutls_x509_ava_st * ava)
{
ASN1_TYPE rdn, elem;
+ ASN1_DATA_NODE vnode;
long len;
int lenlen, remlen, ret;
char rbuf[ASN1_MAX_NAME_SIZE];
- unsigned char cls, *ptr;
+ unsigned char cls;
+ const unsigned char *ptr;
iava++;
irdn++; /* 0->1, 1->2 etc */
@@ -2177,8 +2179,15 @@ gnutls_x509_dn_get_rdn_ava (gnutls_x509_dn_t dn,
return GNUTLS_E_ASN1_ELEMENT_NOT_FOUND;
}
- ava->oid.data = elem->value;
- ava->oid.size = elem->value_len;
+ ret = asn1_read_node_value(elem, &vnode);
+ if (ret != ASN1_SUCCESS)
+ {
+ gnutls_assert ();
+ return GNUTLS_E_ASN1_ELEMENT_NOT_FOUND;
+ }
+
+ ava->oid.data = (void*)vnode.value;
+ ava->oid.size = vnode.value_len;
snprintf (rbuf, sizeof (rbuf), "?%d.value", iava);
elem = asn1_find_node (rdn, rbuf);
@@ -2188,12 +2197,18 @@ gnutls_x509_dn_get_rdn_ava (gnutls_x509_dn_t dn,
return GNUTLS_E_ASN1_ELEMENT_NOT_FOUND;
}
+ ret = asn1_read_node_value(elem, &vnode);
+ if (ret != ASN1_SUCCESS)
+ {
+ gnutls_assert ();
+ return GNUTLS_E_ASN1_ELEMENT_NOT_FOUND;
+ }
/* The value still has the previous tag's length bytes, plus the
* current value's tag and length bytes. Decode them.
*/
- ptr = elem->value;
- remlen = elem->value_len;
+ ptr = vnode.value;
+ remlen = vnode.value_len;
len = asn1_get_length_der (ptr, remlen, &lenlen);
if (len < 0)
{
@@ -2224,7 +2239,7 @@ gnutls_x509_dn_get_rdn_ava (gnutls_x509_dn_t dn,
}
ava->value.size = tmp;
}
- ava->value.data = ptr + lenlen;
+ ava->value.data = (void*)(ptr + lenlen);
return 0;
}
diff --git a/lib/x509/x509_int.h b/lib/x509/x509_int.h
index c83edb0..28f6a4d 100644
--- a/lib/x509/x509_int.h
+++ b/lib/x509/x509_int.h
@@ -28,14 +28,6 @@
#include <libtasn1.h>
-/* Remove these when we require libtasn1 v1.6 or later. */
-#ifndef ASN1_MAX_NAME_SIZE
-#define ASN1_MAX_NAME_SIZE MAX_NAME_SIZE
-#endif
-#ifndef ASN1_MAX_ERROR_DESCRIPTION_SIZE
-#define ASN1_MAX_ERROR_DESCRIPTION_SIZE MAX_ERROR_DESCRIPTION_SIZE
-#endif
-
#define MAX_CRQ_EXTENSIONS_SIZE 8*1024
#define MAX_OID_SIZE 128
diff --git a/m4/hooks.m4 b/m4/hooks.m4
index 0b5c972..6c9f814 100644
--- a/m4/hooks.m4
+++ b/m4/hooks.m4
@@ -99,10 +99,8 @@ fi
included_libtasn1=$withval,
included_libtasn1=no)
if test "$included_libtasn1" = "no"; then
- AC_LIB_HAVE_LINKFLAGS(tasn1,, [#include <libtasn1.h>],
- [asn1_check_version (NULL)])
- if test "$ac_cv_libtasn1" != yes; then
- included_libtasn1=yes
+ PKG_CHECK_MODULES(LIBTASN1, [libtasn1 >= 2.14], [],
[included_libtasn1=yes])
+ if test "$included_libtasn1" = yes; then
AC_MSG_WARN([[
***
*** Libtasn1 was not found. Will use the included one.
hooks/post-receive
--
GNU gnutls
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [SCM] GNU gnutls branch, gnutls_3_1_x, updated. gnutls_3_1_1-27-gc3e3f13,
Nikos Mavrogiannopoulos <=