summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2014-05-17 08:15:00 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2014-05-17 08:15:41 +0200
commit44a4680d83fe4ff732e4e1b826c987bc5d67bd1c (patch)
tree8e714a6eae5ce493918ba981f3965482b40530d0
parent02d59b37540609c0be510642a8eb0f72799ca6c6 (diff)
downloadlibtasn1-44a4680d83fe4ff732e4e1b826c987bc5d67bd1c.tar.gz
libtasn1-44a4680d83fe4ff732e4e1b826c987bc5d67bd1c.tar.bz2
libtasn1-44a4680d83fe4ff732e4e1b826c987bc5d67bd1c.zip
Marked asn1_der_decoding_element() as deprecated.
-rw-r--r--lib/decoding.c2
-rw-r--r--lib/libtasn1.h14
-rw-r--r--tests/Test_simple.c2
-rw-r--r--tests/Test_tree.c2
4 files changed, 18 insertions, 2 deletions
diff --git a/lib/decoding.c b/lib/decoding.c
index 949467a..2d7b7ef 100644
--- a/lib/decoding.c
+++ b/lib/decoding.c
@@ -1501,6 +1501,8 @@ cleanup:
* decoding procedure, the *@STRUCTURE is deleted and set equal to
* %NULL.
*
+ * This function is deprecated. Use asn1_der_decoding() instead.
+ *
* Returns: %ASN1_SUCCESS if DER encoding OK, %ASN1_ELEMENT_NOT_FOUND
* if ELEMENT is %NULL or @elementName == NULL, and
* %ASN1_TAG_ERROR or %ASN1_DER_ERROR if the der encoding doesn't
diff --git a/lib/libtasn1.h b/lib/libtasn1.h
index 92ae54e..92ef0ef 100644
--- a/lib/libtasn1.h
+++ b/lib/libtasn1.h
@@ -46,6 +46,17 @@ extern "C"
#define ASN1_VERSION "3.5"
+#if defined(__GNUC__) && !defined(ASN1_INTERNAL_BUILD)
+# define _ASN1_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
+# if _ASN1_GCC_VERSION >= 30100
+# define _ASN1_GCC_ATTR_DEPRECATED __attribute__ ((__deprecated__))
+# endif
+#endif
+
+#ifndef _ASN1_GCC_ATTR_DEPRECATED
+#define _ASN1_GCC_ATTR_DEPRECATED
+#endif
+
/*****************************************/
/* Errors returned by libtasn1 functions */
/*****************************************/
@@ -251,11 +262,12 @@ extern "C"
asn1_der_decoding (asn1_node * element, const void *ider,
int len, char *errorDescription);
+ /* Do not use. Use asn1_der_decoding() instead. */
extern ASN1_API int
asn1_der_decoding_element (asn1_node * structure,
const char *elementName,
const void *ider, int len,
- char *errorDescription);
+ char *errorDescription) _ASN1_GCC_ATTR_DEPRECATED;
extern ASN1_API int
asn1_der_decoding_startEnd (asn1_node element,
diff --git a/tests/Test_simple.c b/tests/Test_simple.c
index a8ddf8d..a846958 100644
--- a/tests/Test_simple.c
+++ b/tests/Test_simple.c
@@ -128,7 +128,7 @@ main (int argc, char *argv[])
if (result != ASN1_SUCCESS || ret_len != tv[i].derlen
|| bit_len != tv[i].bitlen)
{
- fprintf (stderr, "asn1_get_bit_der iter %lu\n", (unsigned long) i);
+ fprintf (stderr, "asn1_get_bit_der iter %lu, err: %d\n", (unsigned long) i, result);
return 1;
}
}
diff --git a/tests/Test_tree.c b/tests/Test_tree.c
index fce392e..0b6a7df 100644
--- a/tests/Test_tree.c
+++ b/tests/Test_tree.c
@@ -33,6 +33,8 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+
+#define ASN1_INTERNAL_BUILD
#include "libtasn1.h"
#include "Test_tree_asn1_tab.c"