Fix for d2i_ASN1_bytes and stop PKCS#7 routines crashing is signed message
[oweals/openssl.git] / crypto / asn1 / a_type.c
index 5ccd5de00e5a97379df50314b843042a6753b672..3f2ecee5c2f58c8ad87ee2505a3d37aaea75b353 100644 (file)
 
 #include <stdio.h>
 #include "cryptlib.h"
-#include "asn1_mac.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;
@@ -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)