Use public domain snprintf() implementation by Patrick Powell to avoid
[oweals/openssl.git] / crypto / asn1 / a_type.c
index c9b5e7d0479112eaf6ace568f3f4c18ca2bc563c..161ef8119737446f4a6cea8d3e4b9a18ffe27eac 100644 (file)
 #include "cryptlib.h"
 #include <openssl/asn1_mac.h>
 
-/* ASN1err(ASN1_F_D2I_ASN1_BYTES,ASN1_R_WRONG_TAG);
- * ASN1err(ASN1_F_ASN1_COLLATE_PRIMATIVE,ASN1_R_WRONG_TAG);
- */
-
-#ifndef NOPROTO
 static void ASN1_TYPE_component_free(ASN1_TYPE *a);
-#else
-static void ASN1_TYPE_component_free();
-#endif
-
 int i2d_ASN1_TYPE(ASN1_TYPE *a, unsigned char **pp)
        {
        int r=0;
@@ -291,7 +282,7 @@ void ASN1_TYPE_free(ASN1_TYPE *a)
        {
        if (a == NULL) return;
        ASN1_TYPE_component_free(a);
-       Free((char *)(char *)a);
+       Free(a);
        }
 
 int ASN1_TYPE_get(ASN1_TYPE *a)
@@ -302,7 +293,7 @@ int ASN1_TYPE_get(ASN1_TYPE *a)
                return(0);
        }
 
-void ASN1_TYPE_set(ASN1_TYPE *a, int type, char *value)
+void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value)
        {
        if (a->value.ptr != NULL)
                ASN1_TYPE_component_free(a);
@@ -353,3 +344,5 @@ static void ASN1_TYPE_component_free(ASN1_TYPE *a)
                }
        }
 
+IMPLEMENT_STACK_OF(ASN1_TYPE)
+IMPLEMENT_ASN1_SET_OF(ASN1_TYPE)