summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/element.c1
-rw-r--r--lib/int.h44
-rw-r--r--lib/libtasn1.h27
3 files changed, 49 insertions, 23 deletions
diff --git a/lib/element.c b/lib/element.c
index a0f841f..ea8eb48 100644
--- a/lib/element.c
+++ b/lib/element.c
@@ -992,6 +992,7 @@ 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/int.h b/lib/int.h
index f01cb4d..4d13d12 100644
--- a/lib/int.h
+++ b/lib/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/libtasn1.h b/lib/libtasn1.h
index 01030df..3373828 100644
--- a/lib/libtasn1.h
+++ b/lib/libtasn1.h
@@ -129,12 +129,37 @@ 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 vals[4]; /* reserved for future use */
+ unsigned int type; /* Node value type (ASN1_ETYPE_*) */
+ unsigned int vals[3]; /* reserved for future use */
};
typedef struct node_data_struct ASN1_DATA_NODE;