Replace the macros in asn1.h with function equivalents. Also make UTF8Strings
authorDr. Stephen Henson <steve@openssl.org>
Wed, 20 Oct 1999 01:50:23 +0000 (01:50 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Wed, 20 Oct 1999 01:50:23 +0000 (01:50 +0000)
tolerated in certificates.

87 files changed:
CHANGES
crypto/asn1/a_bitstr.c
crypto/asn1/a_bmp.c
crypto/asn1/a_enum.c
crypto/asn1/a_gentm.c
crypto/asn1/a_hdr.c
crypto/asn1/a_int.c
crypto/asn1/a_octet.c
crypto/asn1/a_print.c
crypto/asn1/a_time.c
crypto/asn1/a_utctm.c
crypto/asn1/a_utf8.c
crypto/asn1/a_vis.c
crypto/asn1/asn1.h
crypto/asn1/asn1_lib.c
crypto/asn1/asn1_par.c
crypto/asn1/d2i_dhp.c
crypto/asn1/d2i_dsap.c
crypto/asn1/d2i_r_pr.c
crypto/asn1/d2i_r_pu.c
crypto/asn1/d2i_s_pr.c
crypto/asn1/d2i_s_pu.c
crypto/asn1/evp_asn1.c
crypto/asn1/n_pkey.c
crypto/asn1/p5_pbe.c
crypto/asn1/p5_pbev2.c
crypto/asn1/p7_dgst.c
crypto/asn1/p7_enc.c
crypto/asn1/p7_enc_c.c
crypto/asn1/p7_evp.c
crypto/asn1/p7_i_s.c
crypto/asn1/p7_lib.c
crypto/asn1/p7_recip.c
crypto/asn1/p7_s_e.c
crypto/asn1/p7_signd.c
crypto/asn1/p7_signi.c
crypto/asn1/p8_pkey.c
crypto/asn1/t_crl.c
crypto/asn1/t_req.c
crypto/asn1/t_x509.c
crypto/asn1/x_cinf.c
crypto/asn1/x_crl.c
crypto/asn1/x_exten.c
crypto/asn1/x_name.c
crypto/asn1/x_pkey.c
crypto/asn1/x_pubkey.c
crypto/asn1/x_req.c
crypto/asn1/x_sig.c
crypto/asn1/x_spki.c
crypto/asn1/x_val.c
crypto/asn1/x_x509.c
crypto/dsa/dsa_asn1.c
crypto/evp/evp_pkey.c
crypto/pkcs12/p12_add.c
crypto/pkcs12/p12_attr.c
crypto/pkcs12/p12_bags.c
crypto/pkcs12/p12_decr.c
crypto/pkcs12/p12_init.c
crypto/pkcs12/p12_kiss.c
crypto/pkcs12/p12_lib.c
crypto/pkcs12/p12_mac.c
crypto/pkcs12/p12_mutl.c
crypto/pkcs7/pk7_doit.c
crypto/pkcs7/pk7_lib.c
crypto/rsa/rsa_saos.c
crypto/x509/x509_cmp.c
crypto/x509/x509_r2x.c
crypto/x509/x509_set.c
crypto/x509/x509_v3.c
crypto/x509v3/Makefile.ssl
crypto/x509v3/README [deleted file]
crypto/x509v3/v3_akey.c
crypto/x509v3/v3_alt.c
crypto/x509v3/v3_bcons.c
crypto/x509v3/v3_bitst.c
crypto/x509v3/v3_conf.c
crypto/x509v3/v3_cpols.c
crypto/x509v3/v3_crld.c
crypto/x509v3/v3_enum.c
crypto/x509v3/v3_genn.c
crypto/x509v3/v3_ia5.c
crypto/x509v3/v3_int.c
crypto/x509v3/v3_pku.c
crypto/x509v3/v3_skey.c
crypto/x509v3/v3_sxnet.c
crypto/x509v3/x509v3.h
util/libeay.num

diff --git a/CHANGES b/CHANGES
index 3843a9ea751de3a2be093cc1a1292ae9806d4d4c..7bea83c6d63c2da8c529fa24ee624772a85dbeaa 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -4,6 +4,12 @@
 
  Changes between 0.9.4 and 0.9.5  [xx XXX 1999]
 
+  *) Add function equivalents to the various macros in asn1.h. The old
+     macros are retained with an M_ prefix. Code inside the library can
+     use the M_ macros. External code (including the openssl utility)
+     should *NOT* in order to be "shared library friendly".
+     [Steve Henson]
+
   *) Add various functions that can check a certificate's extensions
      to see if it usable for various purposes such as SSL client,
      server or S/MIME and CAs of these types. This is currently 
index 38ea802be817e7e81e3c1ea12747d7c35a0ca1c5..a441cde1db46c980812662c11733a4315c0d9747 100644 (file)
 #include "cryptlib.h"
 #include <openssl/asn1.h>
 
+ASN1_BIT_STRING *ASN1_BIT_STRING_new(void)
+{ return M_ASN1_BIT_STRING_new(); }
+
+void ASN1_BIT_STRING_free(ASN1_BIT_STRING *x)
+{ return M_ASN1_BIT_STRING_free(x); }
+
+int ASN1_BIT_STRING_set(ASN1_BIT_STRING *x, unsigned char *d, int len)
+{ return M_ASN1_BIT_STRING_set(x, d, len); }
+
 int i2d_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp)
        {
        int ret,j,r,bits,len;
@@ -121,7 +130,7 @@ ASN1_BIT_STRING *d2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, unsigned char **pp,
 
        if ((a == NULL) || ((*a) == NULL))
                {
-               if ((ret=ASN1_BIT_STRING_new()) == NULL) return(NULL);
+               if ((ret=M_ASN1_BIT_STRING_new()) == NULL) return(NULL);
                }
        else
                ret=(*a);
@@ -173,7 +182,7 @@ ASN1_BIT_STRING *d2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, unsigned char **pp,
 err:
        ASN1err(ASN1_F_D2I_ASN1_BIT_STRING,i);
        if ((ret != NULL) && ((a == NULL) || (*a != ret)))
-               ASN1_BIT_STRING_free(ret);
+               M_ASN1_BIT_STRING_free(ret);
        return(NULL);
        }
 
index 6075871984f599daa3c06e81f2489f9aab884c51..eba61a77479236ded9c3f4281ae770b4a7e8bd6e 100644 (file)
 #include "cryptlib.h"
 #include <openssl/asn1.h>
 
+ASN1_BMPSTRING *ASN1_BMPSTRING_new(void)
+{ return M_ASN1_BMPSTRING_new(); }
+
+void ASN1_BMPSTRING_free(ASN1_BMPSTRING *x)
+{ return M_ASN1_BMPSTRING_free(x); }
+
 int i2d_ASN1_BMPSTRING(ASN1_BMPSTRING *a, unsigned char **pp)
        {
        return(i2d_ASN1_bytes((ASN1_STRING *)a,pp,
index 9239ecc439a0ee477e7c60ae8e98d32816660e22..32cfe5b599e75aa51960acd16782285d490ba3a8 100644 (file)
  * for comments on encoding see a_int.c
  */
 
+ASN1_ENUMERATED *ASN1_ENUMERATED_new(void)
+{ return M_ASN1_ENUMERATED_new(); }
+
+void ASN1_ENUMERATED_free(ASN1_ENUMERATED *x)
+{ return M_ASN1_ENUMERATED_free(x); }
+
 int i2d_ASN1_ENUMERATED(ASN1_ENUMERATED *a, unsigned char **pp)
        {
        int pad=0,ret,r,i,t;
@@ -142,7 +148,7 @@ ASN1_ENUMERATED *d2i_ASN1_ENUMERATED(ASN1_ENUMERATED **a, unsigned char **pp,
 
        if ((a == NULL) || ((*a) == NULL))
                {
-               if ((ret=ASN1_ENUMERATED_new()) == NULL) return(NULL);
+               if ((ret=M_ASN1_ENUMERATED_new()) == NULL) return(NULL);
                ret->type=V_ASN1_ENUMERATED;
                }
        else
@@ -217,7 +223,7 @@ ASN1_ENUMERATED *d2i_ASN1_ENUMERATED(ASN1_ENUMERATED **a, unsigned char **pp,
 err:
        ASN1err(ASN1_F_D2I_ASN1_ENUMERATED,i);
        if ((ret != NULL) && ((a == NULL) || (*a != ret)))
-               ASN1_ENUMERATED_free(ret);
+               M_ASN1_ENUMERATED_free(ret);
        return(NULL);
        }
 
@@ -295,7 +301,7 @@ ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai)
        int len,j;
 
        if (ai == NULL)
-               ret=ASN1_ENUMERATED_new();
+               ret=M_ASN1_ENUMERATED_new();
        else
                ret=ai;
        if (ret == NULL)
@@ -311,7 +317,7 @@ ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai)
        ret->length=BN_bn2bin(bn,ret->data);
        return(ret);
 err:
-       if (ret != ai) ASN1_ENUMERATED_free(ret);
+       if (ret != ai) M_ASN1_ENUMERATED_free(ret);
        return(NULL);
        }
 
index 226474f057ba41b20d041d768487ba0b26101433..d5b8bd99b23f72df6d825fe599d3dcc1cab38ed5 100644 (file)
 #include "cryptlib.h"
 #include <openssl/asn1.h>
 
+ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_new(void)
+{ return M_ASN1_GENERALIZEDTIME_new(); }
+
+void ASN1_GENERALIZEDTIME_free(ASN1_GENERALIZEDTIME *x)
+{ return M_ASN1_GENERALIZEDTIME_free(x); }
+
 int i2d_ASN1_GENERALIZEDTIME(ASN1_GENERALIZEDTIME *a, unsigned char **pp)
        {
 #ifdef CHARSET_EBCDIC
@@ -106,7 +112,7 @@ ASN1_GENERALIZEDTIME *d2i_ASN1_GENERALIZEDTIME(ASN1_GENERALIZEDTIME **a,
        return(ret);
 err:
        if ((ret != NULL) && ((a == NULL) || (*a != ret)))
-               ASN1_GENERALIZEDTIME_free(ret);
+               M_ASN1_GENERALIZEDTIME_free(ret);
        return(NULL);
        }
 
@@ -193,7 +199,7 @@ ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,
 #endif
 
        if (s == NULL)
-               s=ASN1_GENERALIZEDTIME_new();
+               s=M_ASN1_GENERALIZEDTIME_new();
        if (s == NULL)
                return(NULL);
 
index 1171d3644397afbf25ee6ac3958a0af530237598..8dc58ed6d217420437b0a27cbbc1028ced194d1f 100644 (file)
@@ -102,7 +102,7 @@ ASN1_HEADER *ASN1_HEADER_new(void)
        ASN1_CTX c;
 
        M_ASN1_New_Malloc(ret,ASN1_HEADER);
-       M_ASN1_New(ret->header,ASN1_OCTET_STRING_new);
+       M_ASN1_New(ret->header,M_ASN1_OCTET_STRING_new);
        ret->meth=NULL;
        ret->data=NULL;
        return(ret);
@@ -112,7 +112,7 @@ ASN1_HEADER *ASN1_HEADER_new(void)
 void ASN1_HEADER_free(ASN1_HEADER *a)
        {
        if (a == NULL) return;
-       ASN1_OCTET_STRING_free(a->header);
+       M_ASN1_OCTET_STRING_free(a->header);
        if (a->meth != NULL)
                a->meth->destroy(a->data);
        Free((char *)a);
index d05436378b94876a8dd5ea1cb8db5f7e05d1dbbc..de40623f42bfeaaa33f34c85e85b4d14d909e0ab 100644 (file)
 #include "cryptlib.h"
 #include <openssl/asn1.h>
 
+ASN1_INTEGER *ASN1_INTEGER_new(void)
+{ return M_ASN1_INTEGER_new();}
+
+void ASN1_INTEGER_free(ASN1_INTEGER *x)
+{ return M_ASN1_INTEGER_free(x);}
+
+ASN1_INTEGER *ASN1_INTEGER_dup(ASN1_INTEGER *x)
+{ return M_ASN1_INTEGER_dup(x);}
+
+int ASN1_INTEGER_cmp(ASN1_INTEGER *x, ASN1_INTEGER *y)
+{ return M_ASN1_INTEGER_cmp(x,y);}
+
 /* 
  * This converts an ASN1 INTEGER into its DER encoding.
  * The internal representation is an ASN1_STRING whose data is a big endian
@@ -160,7 +172,7 @@ ASN1_INTEGER *d2i_ASN1_INTEGER(ASN1_INTEGER **a, unsigned char **pp,
 
        if ((a == NULL) || ((*a) == NULL))
                {
-               if ((ret=ASN1_INTEGER_new()) == NULL) return(NULL);
+               if ((ret=M_ASN1_INTEGER_new()) == NULL) return(NULL);
                ret->type=V_ASN1_INTEGER;
                }
        else
@@ -240,7 +252,7 @@ ASN1_INTEGER *d2i_ASN1_INTEGER(ASN1_INTEGER **a, unsigned char **pp,
 err:
        ASN1err(ASN1_F_D2I_ASN1_INTEGER,i);
        if ((ret != NULL) && ((a == NULL) || (*a != ret)))
-               ASN1_INTEGER_free(ret);
+               M_ASN1_INTEGER_free(ret);
        return(NULL);
        }
 
@@ -260,7 +272,7 @@ ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, unsigned char **pp,
 
        if ((a == NULL) || ((*a) == NULL))
                {
-               if ((ret=ASN1_INTEGER_new()) == NULL) return(NULL);
+               if ((ret=M_ASN1_INTEGER_new()) == NULL) return(NULL);
                ret->type=V_ASN1_INTEGER;
                }
        else
@@ -307,7 +319,7 @@ ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, unsigned char **pp,
 err:
        ASN1err(ASN1_F_D2I_ASN1_UINTEGER,i);
        if ((ret != NULL) && ((a == NULL) || (*a != ret)))
-               ASN1_INTEGER_free(ret);
+               M_ASN1_INTEGER_free(ret);
        return(NULL);
        }
 
@@ -385,7 +397,7 @@ ASN1_INTEGER *BN_to_ASN1_INTEGER(BIGNUM *bn, ASN1_INTEGER *ai)
        int len,j;
 
        if (ai == NULL)
-               ret=ASN1_INTEGER_new();
+               ret=M_ASN1_INTEGER_new();
        else
                ret=ai;
        if (ret == NULL)
@@ -401,7 +413,7 @@ ASN1_INTEGER *BN_to_ASN1_INTEGER(BIGNUM *bn, ASN1_INTEGER *ai)
        ret->length=BN_bn2bin(bn,ret->data);
        return(ret);
 err:
-       if (ret != ai) ASN1_INTEGER_free(ret);
+       if (ret != ai) M_ASN1_INTEGER_free(ret);
        return(NULL);
        }
 
index 7659a13bd38e4127316a9ebd0aae717c00ecbb22..bd6264eec16c65e823313474bf6d54adf35cbd41 100644 (file)
 #include "cryptlib.h"
 #include <openssl/asn1.h>
 
+ASN1_OCTET_STRING *ASN1_OCTET_STRING_new(void)
+{ return M_ASN1_OCTET_STRING_new(); }
+
+void ASN1_OCTET_STRING_free(ASN1_OCTET_STRING *x)
+{ return M_ASN1_OCTET_STRING_free(x); }
+
+ASN1_OCTET_STRING *ASN1_OCTET_STRING_dup(ASN1_OCTET_STRING *x)
+{ return M_ASN1_OCTET_STRING_dup(x); }
+
+int ASN1_OCTET_STRING_cmp(ASN1_OCTET_STRING *a, ASN1_OCTET_STRING *b)
+{ return M_ASN1_OCTET_STRING_cmp(a, b); }
+
+int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *x, unsigned char *d, int len)
+{ return M_ASN1_OCTET_STRING_set(x, d, len); }
+
 int i2d_ASN1_OCTET_STRING(ASN1_OCTET_STRING *a, unsigned char **pp)
-       {
-       return(i2d_ASN1_bytes((ASN1_STRING *)a,pp,
-               V_ASN1_OCTET_STRING,V_ASN1_UNIVERSAL));
-       }
+{ return M_i2d_ASN1_OCTET_STRING(a, pp); }
 
 ASN1_OCTET_STRING *d2i_ASN1_OCTET_STRING(ASN1_OCTET_STRING **a,
             unsigned char **pp, long length)
index cdec7a1561d873c99729b308f0cec80c185f1e28..21bdcdb9042e99d5d5d51c729636808118bedbdf 100644 (file)
 #include "cryptlib.h"
 #include <openssl/asn1.h>
 
+ASN1_IA5STRING *ASN1_IA5STRING_new(void)
+{ return M_ASN1_IA5STRING_new();}
+
+void ASN1_IA5STRING_free(ASN1_IA5STRING *x)
+{ return M_ASN1_IA5STRING_free(x);}
+
 int i2d_ASN1_IA5STRING(ASN1_IA5STRING *a, unsigned char **pp)
        { return(M_i2d_ASN1_IA5STRING(a,pp)); }
 
@@ -67,10 +73,22 @@ ASN1_IA5STRING *d2i_ASN1_IA5STRING(ASN1_IA5STRING **a, unsigned char **pp,
             long l)
        { return(M_d2i_ASN1_IA5STRING(a,pp,l)); }
 
+ASN1_T61STRING *ASN1_T61STRING_new(void)
+{ return M_ASN1_T61STRING_new();}
+
+void ASN1_T61STRING_free(ASN1_T61STRING *x)
+{ return M_ASN1_T61STRING_free(x);}
+
 ASN1_T61STRING *d2i_ASN1_T61STRING(ASN1_T61STRING **a, unsigned char **pp,
             long l)
        { return(M_d2i_ASN1_T61STRING(a,pp,l)); }
 
+ASN1_PRINTABLESTRING *ASN1_PRINTABLESTRING_new(void)
+{ return M_ASN1_PRINTABLESTRING_new();}
+
+void ASN1_PRINTABLESTRING_free(ASN1_PRINTABLESTRING *x)
+{ return M_ASN1_PRINTABLESTRING_free(x);}
+
 ASN1_PRINTABLESTRING *d2i_ASN1_PRINTABLESTRING(ASN1_PRINTABLESTRING **a,
             unsigned char **pp, long l)
        { return(M_d2i_ASN1_PRINTABLESTRING(a,pp,
@@ -149,6 +167,11 @@ int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s)
        return(1);
        }
 
+ASN1_STRING *DIRECTORYSTRING_new(void)
+{ return M_DIRECTORYSTRING_new();}
+
+void DIRECTORYSTRING_free(ASN1_STRING *x)
+{ return M_DIRECTORYSTRING_free(x);}
 
 int i2d_DIRECTORYSTRING(ASN1_STRING *a, unsigned char **pp)
        { return(M_i2d_DIRECTORYSTRING(a,pp)); }
@@ -157,6 +180,12 @@ ASN1_STRING *d2i_DIRECTORYSTRING(ASN1_STRING **a, unsigned char **pp,
             long l)
        { return(M_d2i_DIRECTORYSTRING(a,pp,l)); }
 
+ASN1_STRING *DISPLAYTEXT_new(void)
+{ return M_DISPLAYTEXT_new();}
+
+void DISPLAYTEXT_free(ASN1_STRING *x)
+{ return M_DISPLAYTEXT_free(x);}
+
 int i2d_DISPLAYTEXT(ASN1_STRING *a, unsigned char **pp)
        { return(M_i2d_DISPLAYTEXT(a,pp)); }
 
index c1690a56949d4127d6ce9f4dba0cd208cdd9fce3..d1900f68e459b57d4fe047958ec1e20e84f947c9 100644 (file)
 #include "cryptlib.h"
 #include <openssl/asn1.h>
 
+ASN1_TIME *ASN1_TIME_new(void)
+{ return M_ASN1_TIME_new(); }
+
+void ASN1_TIME_free(ASN1_TIME *x)
+{ return M_ASN1_TIME_free(x); }
+
 int i2d_ASN1_TIME(ASN1_TIME *a, unsigned char **pp)
        {
 #ifdef CHARSET_EBCDIC
index 688199fdd2292e5cffcf270e45c0154782b63cba..ba349455a175856d4e441d36e416820da298c925 100644 (file)
 #include "cryptlib.h"
 #include <openssl/asn1.h>
 
+ASN1_UTCTIME *ASN1_UTCTIME_new(void)
+{ return M_ASN1_UTCTIME_new(); }
+
+void ASN1_UTCTIME_free(ASN1_UTCTIME *x)
+{ return M_ASN1_UTCTIME_free(x); }
+
 int i2d_ASN1_UTCTIME(ASN1_UTCTIME *a, unsigned char **pp)
        {
 #ifndef CHARSET_EBCDIC
@@ -109,7 +115,7 @@ ASN1_UTCTIME *d2i_ASN1_UTCTIME(ASN1_UTCTIME **a, unsigned char **pp,
        return(ret);
 err:
        if ((ret != NULL) && ((a == NULL) || (*a != ret)))
-               ASN1_UTCTIME_free(ret);
+               M_ASN1_UTCTIME_free(ret);
        return(NULL);
        }
 
@@ -192,7 +198,7 @@ ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t)
 #endif
 
        if (s == NULL)
-               s=ASN1_UTCTIME_new();
+               s=M_ASN1_UTCTIME_new();
        if (s == NULL)
                return(NULL);
 
index 7f68b88cd145ef7769396cd66c9d7c556a624d4d..16aab7f43e935266f2ebbb39df6ad03fa036c103 100644 (file)
 #include "cryptlib.h"
 #include <openssl/asn1.h>
 
+ASN1_UTF8STRING *ASN1_UTF8STRING_new(void)
+{ return M_ASN1_UTF8STRING_new();}
+
+void ASN1_UTF8STRING_free(ASN1_UTF8STRING *x)
+{ return M_ASN1_UTF8STRING_free(x);}
+
 int i2d_ASN1_UTF8STRING(ASN1_UTF8STRING *a, unsigned char **pp)
        {
        return(i2d_ASN1_bytes((ASN1_STRING *)a,pp,
index 2072be780d430cf880ef030ce8551e7f2606ce6e..3bc3d79f5d3e84f0be9186d6ab5f6f33a914a556 100644 (file)
 #include "cryptlib.h"
 #include <openssl/asn1.h>
 
+ASN1_VISIBLESTRING *ASN1_VISIBLESTRING_new(void)
+{ return M_ASN1_VISIBLESTRING_new(); }
+
+void ASN1_VISIBLESTRING_free(ASN1_VISIBLESTRING *x)
+{ return M_ASN1_VISIBLESTRING_free(x); }
+
 int i2d_ASN1_VISIBLESTRING(ASN1_VISIBLESTRING *a, unsigned char **pp)
        {
        return(i2d_ASN1_bytes((ASN1_STRING *)a,pp,
index bb5c12131cbe2f4eaf93c456d781a95cde61ac7b..edc7aae4b2f13eb26f564c8c7886771a2c78d09b 100644 (file)
@@ -281,60 +281,50 @@ typedef struct asn1_header_st
        ASN1_METHOD *meth;
        } ASN1_HEADER;
 
-#define ASN1_STRING_length(x)  ((x)->length)
-#define ASN1_STRING_type(x)    ((x)->type)
-#define ASN1_STRING_data(x)    ((x)->data)
+#define M_ASN1_STRING_length(x)        ((x)->length)
+#define M_ASN1_STRING_length_set(x, n) ((x)->length = (n))
+#define M_ASN1_STRING_type(x)  ((x)->type)
+#define M_ASN1_STRING_data(x)  ((x)->data)
 
 /* Macros for string operations */
-#define ASN1_BIT_STRING_new()  (ASN1_BIT_STRING *)\
+#define M_ASN1_BIT_STRING_new()        (ASN1_BIT_STRING *)\
                ASN1_STRING_type_new(V_ASN1_BIT_STRING)
-#define ASN1_BIT_STRING_free(a)        ASN1_STRING_free((ASN1_STRING *)a)
-#define ASN1_BIT_STRING_dup(a) (ASN1_BIT_STRING *)\
+#define M_ASN1_BIT_STRING_free(a)      ASN1_STRING_free((ASN1_STRING *)a)
+#define M_ASN1_BIT_STRING_dup(a) (ASN1_BIT_STRING *)\
                ASN1_STRING_dup((ASN1_STRING *)a)
-#define ASN1_BIT_STRING_cmp(a,b) ASN1_STRING_cmp(\
+#define M_ASN1_BIT_STRING_cmp(a,b) ASN1_STRING_cmp(\
                (ASN1_STRING *)a,(ASN1_STRING *)b)
-#define ASN1_BIT_STRING_set(a,b,c) ASN1_STRING_set((ASN1_STRING *)a,b,c)
-/* i2d_ASN1_BIT_STRING() is a function */
-/* d2i_ASN1_BIT_STRING() is a function */
+#define M_ASN1_BIT_STRING_set(a,b,c) ASN1_STRING_set((ASN1_STRING *)a,b,c)
 
-#define ASN1_INTEGER_new()     (ASN1_INTEGER *)\
+#define M_ASN1_INTEGER_new()   (ASN1_INTEGER *)\
                ASN1_STRING_type_new(V_ASN1_INTEGER)
-#define ASN1_INTEGER_free(a)           ASN1_STRING_free((ASN1_STRING *)a)
-#define ASN1_INTEGER_dup(a) (ASN1_INTEGER *)ASN1_STRING_dup((ASN1_STRING *)a)
-#define ASN1_INTEGER_cmp(a,b)  ASN1_STRING_cmp(\
+#define M_ASN1_INTEGER_free(a)         ASN1_STRING_free((ASN1_STRING *)a)
+#define M_ASN1_INTEGER_dup(a) (ASN1_INTEGER *)ASN1_STRING_dup((ASN1_STRING *)a)
+#define M_ASN1_INTEGER_cmp(a,b)        ASN1_STRING_cmp(\
                (ASN1_STRING *)a,(ASN1_STRING *)b)
-/* ASN1_INTEGER_set() is a function, also see BN_to_ASN1_INTEGER() */
-/* ASN1_INTEGER_get() is a function, also see ASN1_INTEGER_to_BN() */
-/* i2d_ASN1_INTEGER() is a function */
-/* d2i_ASN1_INTEGER() is a function */
 
-#define ASN1_ENUMERATED_new()  (ASN1_ENUMERATED *)\
+#define M_ASN1_ENUMERATED_new()        (ASN1_ENUMERATED *)\
                ASN1_STRING_type_new(V_ASN1_ENUMERATED)
-#define ASN1_ENUMERATED_free(a)                ASN1_STRING_free((ASN1_STRING *)a)
-#define ASN1_ENUMERATED_dup(a) (ASN1_ENUMERATED *)ASN1_STRING_dup((ASN1_STRING *)a)
-#define ASN1_ENUMERATED_cmp(a,b)       ASN1_STRING_cmp(\
+#define M_ASN1_ENUMERATED_free(a)      ASN1_STRING_free((ASN1_STRING *)a)
+#define M_ASN1_ENUMERATED_dup(a) (ASN1_ENUMERATED *)ASN1_STRING_dup((ASN1_STRING *)a)
+#define M_ASN1_ENUMERATED_cmp(a,b)     ASN1_STRING_cmp(\
                (ASN1_STRING *)a,(ASN1_STRING *)b)
-/* ASN1_ENUMERATED_set() is a function, also see BN_to_ASN1_ENUMERATED() */
-/* ASN1_ENUMERATED_get() is a function, also see ASN1_ENUMERATED_to_BN() */
-/* i2d_ASN1_ENUMERATED() is a function */
-/* d2i_ASN1_ENUMERATED() is a function */
 
-#define ASN1_OCTET_STRING_new()        (ASN1_OCTET_STRING *)\
+#define M_ASN1_OCTET_STRING_new()      (ASN1_OCTET_STRING *)\
                ASN1_STRING_type_new(V_ASN1_OCTET_STRING)
-#define ASN1_OCTET_STRING_free(a)      ASN1_STRING_free((ASN1_STRING *)a)
-#define ASN1_OCTET_STRING_dup(a) (ASN1_OCTET_STRING *)\
+#define M_ASN1_OCTET_STRING_free(a)    ASN1_STRING_free((ASN1_STRING *)a)
+#define M_ASN1_OCTET_STRING_dup(a) (ASN1_OCTET_STRING *)\
                ASN1_STRING_dup((ASN1_STRING *)a)
-#define ASN1_OCTET_STRING_cmp(a,b) ASN1_STRING_cmp(\
+#define M_ASN1_OCTET_STRING_cmp(a,b) ASN1_STRING_cmp(\
                (ASN1_STRING *)a,(ASN1_STRING *)b)
-#define ASN1_OCTET_STRING_set(a,b,c)   ASN1_STRING_set((ASN1_STRING *)a,b,c)
-#define ASN1_OCTET_STRING_print(a,b)   ASN1_STRING_print(a,(ASN1_STRING *)b)
+#define M_ASN1_OCTET_STRING_set(a,b,c) ASN1_STRING_set((ASN1_STRING *)a,b,c)
+#define M_ASN1_OCTET_STRING_print(a,b) ASN1_STRING_print(a,(ASN1_STRING *)b)
 #define M_i2d_ASN1_OCTET_STRING(a,pp) \
                i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_OCTET_STRING,\
-               V_ASN1_OCTET_STRING)
-/* d2i_ASN1_OCTET_STRING() is a function */
+               V_ASN1_UNIVERSAL)
 
-#define ASN1_PRINTABLE_new()   ASN1_STRING_type_new(V_ASN1_T61STRING)
-#define ASN1_PRINTABLE_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+#define M_ASN1_PRINTABLE_new() ASN1_STRING_type_new(V_ASN1_T61STRING)
+#define M_ASN1_PRINTABLE_free(a)       ASN1_STRING_free((ASN1_STRING *)a)
 #define M_i2d_ASN1_PRINTABLE(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\
                pp,a->type,V_ASN1_UNIVERSAL)
 #define M_d2i_ASN1_PRINTABLE(a,pp,l) \
@@ -345,10 +335,11 @@ typedef struct asn1_header_st
                        B_ASN1_BIT_STRING| \
                        B_ASN1_UNIVERSALSTRING|\
                        B_ASN1_BMPSTRING|\
+                       B_ASN1_UTF8STRING|\
                        B_ASN1_UNKNOWN)
 
-#define DIRECTORYSTRING_new() ASN1_STRING_type_new(V_ASN1_PRINTABLESTRING)
-#define DIRECTORYSTRING_free(a)        ASN1_STRING_free((ASN1_STRING *)a)
+#define M_DIRECTORYSTRING_new() ASN1_STRING_type_new(V_ASN1_PRINTABLESTRING)
+#define M_DIRECTORYSTRING_free(a)      ASN1_STRING_free((ASN1_STRING *)a)
 #define M_i2d_DIRECTORYSTRING(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\
                                                pp,a->type,V_ASN1_UNIVERSAL)
 #define M_d2i_DIRECTORYSTRING(a,pp,l) \
@@ -359,8 +350,8 @@ typedef struct asn1_header_st
                        B_ASN1_UNIVERSALSTRING|\
                        B_ASN1_UTF8STRING)
 
-#define DISPLAYTEXT_new() ASN1_STRING_type_new(V_ASN1_VISIBLESTRING)
-#define DISPLAYTEXT_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+#define M_DISPLAYTEXT_new() ASN1_STRING_type_new(V_ASN1_VISIBLESTRING)
+#define M_DISPLAYTEXT_free(a) ASN1_STRING_free((ASN1_STRING *)a)
 #define M_i2d_DISPLAYTEXT(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\
                                                pp,a->type,V_ASN1_UNIVERSAL)
 #define M_d2i_DISPLAYTEXT(a,pp,l) \
@@ -369,9 +360,9 @@ typedef struct asn1_header_st
                        B_ASN1_BMPSTRING|\
                        B_ASN1_UTF8STRING)
 
-#define ASN1_PRINTABLESTRING_new() (ASN1_PRINTABLESTRING *)\
+#define M_ASN1_PRINTABLESTRING_new() (ASN1_PRINTABLESTRING *)\
                ASN1_STRING_type_new(V_ASN1_PRINTABLESTRING)
-#define ASN1_PRINTABLESTRING_free(a)   ASN1_STRING_free((ASN1_STRING *)a)
+#define M_ASN1_PRINTABLESTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
 #define M_i2d_ASN1_PRINTABLESTRING(a,pp) \
                i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_PRINTABLESTRING,\
                V_ASN1_UNIVERSAL)
@@ -379,9 +370,9 @@ typedef struct asn1_header_st
                (ASN1_PRINTABLESTRING *)d2i_ASN1_type_bytes\
                ((ASN1_STRING **)a,pp,l,B_ASN1_PRINTABLESTRING)
 
-#define ASN1_T61STRING_new()   (ASN1_T61STRING *)\
+#define M_ASN1_T61STRING_new() (ASN1_T61STRING *)\
                ASN1_STRING_type_new(V_ASN1_T61STRING)
-#define ASN1_T61STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+#define M_ASN1_T61STRING_free(a)       ASN1_STRING_free((ASN1_STRING *)a)
 #define M_i2d_ASN1_T61STRING(a,pp) \
                i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_T61STRING,\
                V_ASN1_UNIVERSAL)
@@ -389,10 +380,10 @@ typedef struct asn1_header_st
                (ASN1_T61STRING *)d2i_ASN1_type_bytes\
                ((ASN1_STRING **)a,pp,l,B_ASN1_T61STRING)
 
-#define ASN1_IA5STRING_new()   (ASN1_IA5STRING *)\
+#define M_ASN1_IA5STRING_new() (ASN1_IA5STRING *)\
                ASN1_STRING_type_new(V_ASN1_IA5STRING)
-#define ASN1_IA5STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
-#define ASN1_IA5STRING_dup(a)  \
+#define M_ASN1_IA5STRING_free(a)       ASN1_STRING_free((ASN1_STRING *)a)
+#define M_ASN1_IA5STRING_dup(a)        \
                        (ASN1_IA5STRING *)ASN1_STRING_dup((ASN1_STRING *)a)
 #define M_i2d_ASN1_IA5STRING(a,pp) \
                i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_IA5STRING,\
@@ -401,38 +392,25 @@ typedef struct asn1_header_st
                (ASN1_IA5STRING *)d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l,\
                        B_ASN1_IA5STRING)
 
-#define ASN1_UTCTIME_new()     (ASN1_UTCTIME *)\
+#define M_ASN1_UTCTIME_new()   (ASN1_UTCTIME *)\
                ASN1_STRING_type_new(V_ASN1_UTCTIME)
-#define ASN1_UTCTIME_free(a)   ASN1_STRING_free((ASN1_STRING *)a)
-#define ASN1_UTCTIME_dup(a) (ASN1_UTCTIME *)ASN1_STRING_dup((ASN1_STRING *)a)
-/* i2d_ASN1_UTCTIME() is a function */
-/* d2i_ASN1_UTCTIME() is a function */
-/* ASN1_UTCTIME_set() is a function */
-/* ASN1_UTCTIME_check() is a function */
-
-#define ASN1_GENERALIZEDTIME_new()     (ASN1_GENERALIZEDTIME *)\
+#define M_ASN1_UTCTIME_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+#define M_ASN1_UTCTIME_dup(a) (ASN1_UTCTIME *)ASN1_STRING_dup((ASN1_STRING *)a)
+
+#define M_ASN1_GENERALIZEDTIME_new()   (ASN1_GENERALIZEDTIME *)\
                ASN1_STRING_type_new(V_ASN1_GENERALIZEDTIME)
-#define ASN1_GENERALIZEDTIME_free(a)   ASN1_STRING_free((ASN1_STRING *)a)
-#define ASN1_GENERALIZEDTIME_dup(a) (ASN1_GENERALIZEDTIME *)ASN1_STRING_dup(\
+#define M_ASN1_GENERALIZEDTIME_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+#define M_ASN1_GENERALIZEDTIME_dup(a) (ASN1_GENERALIZEDTIME *)ASN1_STRING_dup(\
        (ASN1_STRING *)a)
-/* i2d_ASN1_GENERALIZEDTIME() is a function */
-/* d2i_ASN1_GENERALIZEDTIME() is a function */
-/* ASN1_GENERALIZEDTIME_set() is a function */
-/* ASN1_GENERALIZEDTIME_check() is a function */
 
-#define ASN1_TIME_new()        (ASN1_TIME *)\
+#define M_ASN1_TIME_new()      (ASN1_TIME *)\
                ASN1_STRING_type_new(V_ASN1_UTCTIME)
-#define ASN1_TIME_free(a)      ASN1_STRING_free((ASN1_STRING *)a)
-#define ASN1_TIME_dup(a) (ASN1_TIME *)ASN1_STRING_dup((ASN1_STRING *)a)
-
-/* i2d_ASN1_TIME() is a function */
-/* d2i_ASN1_TIME() is a function */
-/* ASN1_TIME_set() is a function */
-/* ASN1_TIME_check() is a function */
+#define M_ASN1_TIME_free(a)    ASN1_STRING_free((ASN1_STRING *)a)
+#define M_ASN1_TIME_dup(a) (ASN1_TIME *)ASN1_STRING_dup((ASN1_STRING *)a)
 
-#define ASN1_GENERALSTRING_new()       (ASN1_GENERALSTRING *)\
+#define M_ASN1_GENERALSTRING_new()     (ASN1_GENERALSTRING *)\
                ASN1_STRING_type_new(V_ASN1_GENERALSTRING)
-#define ASN1_GENERALSTRING_free(a)     ASN1_STRING_free((ASN1_STRING *)a)
+#define M_ASN1_GENERALSTRING_free(a)   ASN1_STRING_free((ASN1_STRING *)a)
 #define M_i2d_ASN1_GENERALSTRING(a,pp) \
                i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_GENERALSTRING,\
                        V_ASN1_UNIVERSAL)
@@ -440,9 +418,9 @@ typedef struct asn1_header_st
                (ASN1_GENERALSTRING *)d2i_ASN1_type_bytes\
                ((ASN1_STRING **)a,pp,l,B_ASN1_GENERALSTRING)
 
-#define ASN1_UNIVERSALSTRING_new()     (ASN1_UNIVERSALSTRING *)\
+#define M_ASN1_UNIVERSALSTRING_new()   (ASN1_UNIVERSALSTRING *)\
                ASN1_STRING_type_new(V_ASN1_UNIVERSALSTRING)
-#define ASN1_UNIVERSALSTRING_free(a)   ASN1_STRING_free((ASN1_STRING *)a)
+#define M_ASN1_UNIVERSALSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
 #define M_i2d_ASN1_UNIVERSALSTRING(a,pp) \
                i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_UNIVERSALSTRING,\
                        V_ASN1_UNIVERSAL)
@@ -450,9 +428,9 @@ typedef struct asn1_header_st
                (ASN1_UNIVERSALSTRING *)d2i_ASN1_type_bytes\
                ((ASN1_STRING **)a,pp,l,B_ASN1_UNIVERSALSTRING)
 
-#define ASN1_BMPSTRING_new()   (ASN1_BMPSTRING *)\
+#define M_ASN1_BMPSTRING_new() (ASN1_BMPSTRING *)\
                ASN1_STRING_type_new(V_ASN1_BMPSTRING)
-#define ASN1_BMPSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+#define M_ASN1_BMPSTRING_free(a)       ASN1_STRING_free((ASN1_STRING *)a)
 #define M_i2d_ASN1_BMPSTRING(a,pp) \
                i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_BMPSTRING,\
                        V_ASN1_UNIVERSAL)
@@ -460,9 +438,9 @@ typedef struct asn1_header_st
                (ASN1_BMPSTRING *)d2i_ASN1_type_bytes\
                ((ASN1_STRING **)a,pp,l,B_ASN1_BMPSTRING)
 
-#define ASN1_VISIBLESTRING_new()       (ASN1_VISIBLESTRING *)\
+#define M_ASN1_VISIBLESTRING_new()     (ASN1_VISIBLESTRING *)\
                ASN1_STRING_type_new(V_ASN1_VISIBLESTRING)
-#define ASN1_VISIBLESTRING_free(a)     ASN1_STRING_free((ASN1_STRING *)a)
+#define M_ASN1_VISIBLESTRING_free(a)   ASN1_STRING_free((ASN1_STRING *)a)
 #define M_i2d_ASN1_VISIBLESTRING(a,pp) \
                i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_VISIBLESTRING,\
                        V_ASN1_UNIVERSAL)
@@ -470,9 +448,9 @@ typedef struct asn1_header_st
                (ASN1_VISIBLESTRING *)d2i_ASN1_type_bytes\
                ((ASN1_STRING **)a,pp,l,B_ASN1_VISIBLESTRING)
 
-#define ASN1_UTF8STRING_new()  (ASN1_UTF8STRING *)\
+#define M_ASN1_UTF8STRING_new()        (ASN1_UTF8STRING *)\
                ASN1_STRING_type_new(V_ASN1_UTF8STRING)
-#define ASN1_UTF8STRING_free(a)        ASN1_STRING_free((ASN1_STRING *)a)
+#define M_ASN1_UTF8STRING_free(a)      ASN1_STRING_free((ASN1_STRING *)a)
 #define M_i2d_ASN1_UTF8STRING(a,pp) \
                i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_UTF8STRING,\
                        V_ASN1_UNIVERSAL)
@@ -500,7 +478,7 @@ ASN1_OBJECT *       d2i_ASN1_OBJECT(ASN1_OBJECT **a,unsigned char **pp,
 DECLARE_STACK_OF(ASN1_OBJECT)
 DECLARE_ASN1_SET_OF(ASN1_OBJECT)
 
-ASN1_STRING *  ASN1_STRING_new(void );
+ASN1_STRING *  ASN1_STRING_new(void);
 void           ASN1_STRING_free(ASN1_STRING *a);
 ASN1_STRING *  ASN1_STRING_dup(ASN1_STRING *a);
 ASN1_STRING *  ASN1_STRING_type_new(int type );
@@ -508,10 +486,18 @@ int               ASN1_STRING_cmp(ASN1_STRING *a, ASN1_STRING *b);
   /* Since this is used to store all sorts of things, via macros, for now, make
      its data void * */
 int            ASN1_STRING_set(ASN1_STRING *str, const void *data, int len);
+int ASN1_STRING_length(ASN1_STRING *x);
+void ASN1_STRING_length_set(ASN1_STRING *x, int n);
+int ASN1_STRING_type(ASN1_STRING *x);
+unsigned char * ASN1_STRING_data(ASN1_STRING *x);
 
+ASN1_BIT_STRING *      ASN1_BIT_STRING_new(void);
+void           ASN1_BIT_STRING_free(ASN1_BIT_STRING *a);
 int            i2d_ASN1_BIT_STRING(ASN1_BIT_STRING *a,unsigned char **pp);
 ASN1_BIT_STRING *d2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,unsigned char **pp,
                        long length);
+int            ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d,
+                       int length );
 int            ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value);
 int            ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n);
 
@@ -519,12 +505,18 @@ int               ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n);
 int            i2d_ASN1_BOOLEAN(int a,unsigned char **pp);
 int            d2i_ASN1_BOOLEAN(int *a,unsigned char **pp,long length);
 
+ASN1_INTEGER * ASN1_INTEGER_new(void);
+void           ASN1_INTEGER_free(ASN1_INTEGER *a);
 int            i2d_ASN1_INTEGER(ASN1_INTEGER *a,unsigned char **pp);
 ASN1_INTEGER *d2i_ASN1_INTEGER(ASN1_INTEGER **a,unsigned char **pp,
                        long length);
 ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a,unsigned char **pp,
                        long length);
+ASN1_INTEGER * ASN1_INTEGER_dup(ASN1_INTEGER *x);
+int ASN1_INTEGER_cmp(ASN1_INTEGER *x, ASN1_INTEGER *y);
 
+ASN1_ENUMERATED *      ASN1_ENUMERATED_new(void);
+void           ASN1_ENUMERATED_free(ASN1_ENUMERATED *a);
 int            i2d_ASN1_ENUMERATED(ASN1_ENUMERATED *a,unsigned char **pp);
 ASN1_ENUMERATED *d2i_ASN1_ENUMERATED(ASN1_ENUMERATED **a,unsigned char **pp,
                        long length);
@@ -537,18 +529,29 @@ int ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *a);
 ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,time_t t);
 int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, char *str); 
 
+ASN1_OCTET_STRING *    ASN1_OCTET_STRING_new(void);
+void           ASN1_OCTET_STRING_free(ASN1_OCTET_STRING *a);
 int            i2d_ASN1_OCTET_STRING(ASN1_OCTET_STRING *a,unsigned char **pp);
 ASN1_OCTET_STRING *d2i_ASN1_OCTET_STRING(ASN1_OCTET_STRING **a,
                        unsigned char **pp,long length);
+ASN1_OCTET_STRING *    ASN1_OCTET_STRING_dup(ASN1_OCTET_STRING *a);
+int    ASN1_OCTET_STRING_cmp(ASN1_OCTET_STRING *a, ASN1_OCTET_STRING *b);
+int    ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str, unsigned char *data, int len);
 
+ASN1_VISIBLESTRING *   ASN1_VISIBLESTRING_new(void);
+void           ASN1_VISIBLESTRING_free(ASN1_VISIBLESTRING *a);
 int    i2d_ASN1_VISIBLESTRING(ASN1_VISIBLESTRING *a,unsigned char **pp);
 ASN1_VISIBLESTRING *d2i_ASN1_VISIBLESTRING(ASN1_VISIBLESTRING **a,
                        unsigned char **pp,long length);
 
+ASN1_UTF8STRING *      ASN1_UTF8STRING_new(void);
+void           ASN1_UTF8STRING_free(ASN1_UTF8STRING *a);
 int            i2d_ASN1_UTF8STRING(ASN1_UTF8STRING *a,unsigned char **pp);
 ASN1_UTF8STRING *d2i_ASN1_UTF8STRING(ASN1_UTF8STRING **a,
                        unsigned char **pp,long length);
 
+ASN1_BMPSTRING *       ASN1_BMPSTRING_new(void);
+void           ASN1_BMPSTRING_free(ASN1_BMPSTRING *a);
 int i2d_ASN1_BMPSTRING(ASN1_BMPSTRING *a, unsigned char **pp);
 ASN1_BMPSTRING *d2i_ASN1_BMPSTRING(ASN1_BMPSTRING **a, unsigned char **pp,
        long length);
@@ -560,30 +563,48 @@ int UTF8_putc(unsigned char *str, int len, unsigned long value);
 int i2d_ASN1_PRINTABLE(ASN1_STRING *a,unsigned char **pp);
 ASN1_STRING *d2i_ASN1_PRINTABLE(ASN1_STRING **a,
        unsigned char **pp, long l);
+
+ASN1_PRINTABLESTRING * ASN1_PRINTABLESTRING_new(void);
+void           ASN1_PRINTABLESTRING_free(ASN1_PRINTABLESTRING *a);
 ASN1_PRINTABLESTRING *d2i_ASN1_PRINTABLESTRING(ASN1_PRINTABLESTRING **a,
        unsigned char **pp, long l);
 
+ASN1_STRING *  DIRECTORYSTRING_new(void);
+void           DIRECTORYSTRING_free(ASN1_STRING *a);
 int    i2d_DIRECTORYSTRING(ASN1_STRING *a,unsigned char **pp);
 ASN1_STRING *d2i_DIRECTORYSTRING(ASN1_STRING **a, unsigned char **pp,
                                                                 long length);
 
+ASN1_STRING *  DISPLAYTEXT_new(void);
+void           DISPLAYTEXT_free(ASN1_STRING *a);
 int    i2d_DISPLAYTEXT(ASN1_STRING *a,unsigned char **pp);
 ASN1_STRING *d2i_DISPLAYTEXT(ASN1_STRING **a, unsigned char **pp, long length);
 
+ASN1_T61STRING *       ASN1_T61STRING_new(void);
+void           ASN1_T61STRING_free(ASN1_IA5STRING *a);
 ASN1_T61STRING *d2i_ASN1_T61STRING(ASN1_T61STRING **a,
        unsigned char **pp, long l);
+
+ASN1_IA5STRING *       ASN1_IA5STRING_new(void);
+void           ASN1_IA5STRING_free(ASN1_IA5STRING *a);
 int i2d_ASN1_IA5STRING(ASN1_IA5STRING *a,unsigned char **pp);
 ASN1_IA5STRING *d2i_ASN1_IA5STRING(ASN1_IA5STRING **a,
        unsigned char **pp, long l);
 
+ASN1_UTCTIME * ASN1_UTCTIME_new(void);
+void           ASN1_UTCTIME_free(ASN1_UTCTIME *a);
 int            i2d_ASN1_UTCTIME(ASN1_UTCTIME *a,unsigned char **pp);
 ASN1_UTCTIME * d2i_ASN1_UTCTIME(ASN1_UTCTIME **a,unsigned char **pp,
                        long length);
 
+ASN1_GENERALIZEDTIME * ASN1_GENERALIZEDTIME_new(void);
+void           ASN1_GENERALIZEDTIME_free(ASN1_GENERALIZEDTIME *a);
 int            i2d_ASN1_GENERALIZEDTIME(ASN1_GENERALIZEDTIME *a,unsigned char **pp);
 ASN1_GENERALIZEDTIME * d2i_ASN1_GENERALIZEDTIME(ASN1_GENERALIZEDTIME **a,unsigned char **pp,
                        long length);
 
+ASN1_TIME *    ASN1_TIME_new(void);
+void           ASN1_TIME_free(ASN1_TIME *a);
 int            i2d_ASN1_TIME(ASN1_TIME *a,unsigned char **pp);
 ASN1_TIME *    d2i_ASN1_TIME(ASN1_TIME **a,unsigned char **pp, long length);
 ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s,time_t t);
index 95e54ed6267d029d5f630973acce892946f211a3..ddb7869958d4d086058ca015984a774c363b9d34 100644 (file)
@@ -411,3 +411,14 @@ void asn1_add_error(unsigned char *address, int offset)
        ERR_add_error_data(4,"address=",buf1," offset=",buf2);
        }
 
+int ASN1_STRING_length(ASN1_STRING *x)
+{ return M_ASN1_STRING_length(x); }
+
+void ASN1_STRING_length_set(ASN1_STRING *x, int len)
+{ M_ASN1_STRING_length_set(x, len); return; }
+
+int ASN1_STRING_type(ASN1_STRING *x)
+{ return M_ASN1_STRING_type(x); }
+
+unsigned char * ASN1_STRING_data(ASN1_STRING *x)
+{ return ASN1_STRING_data(x); }
index 5a628a4bc244c3bd6e9708249f79411f0027eb33..d1e9816bad328f2781d045bd7a6d9bd7e017006e 100644 (file)
@@ -273,7 +273,7 @@ static int asn1_parse2(BIO *bp, unsigned char **pp, long length, int offset,
                                                        os->length) <= 0)
                                                        goto end;
                                                }
-                                       ASN1_OCTET_STRING_free(os);
+                                       M_ASN1_OCTET_STRING_free(os);
                                        os=NULL;
                                        }
                                }
@@ -307,7 +307,7 @@ static int asn1_parse2(BIO *bp, unsigned char **pp, long length, int offset,
                                        if (BIO_write(bp,"BAD INTEGER",11) <= 0)
                                                goto end;
                                        }
-                               ASN1_INTEGER_free(bs);
+                               M_ASN1_INTEGER_free(bs);
                                }
                        else if (tag == V_ASN1_ENUMERATED)
                                {
@@ -339,7 +339,7 @@ static int asn1_parse2(BIO *bp, unsigned char **pp, long length, int offset,
                                        if (BIO_write(bp,"BAD ENUMERATED",11) <= 0)
                                                goto end;
                                        }
-                               ASN1_ENUMERATED_free(bs);
+                               M_ASN1_ENUMERATED_free(bs);
                                }
 
                        if (!nl) 
@@ -358,7 +358,7 @@ static int asn1_parse2(BIO *bp, unsigned char **pp, long length, int offset,
        ret=1;
 end:
        if (o != NULL) ASN1_OBJECT_free(o);
-       if (os != NULL) ASN1_OCTET_STRING_free(os);
+       if (os != NULL) M_ASN1_OCTET_STRING_free(os);
        *pp=p;
        return(ret);
        }
index a077211a4c190c6a7b5a415f2f0d3080409ec141..635ae829db3febf265f1d63b5e21885eb1f8ca82 100644 (file)
@@ -86,7 +86,7 @@ DH *d2i_DHparams(DH **a, unsigned char **pp, long length)
                ret->length=(int)v;
                }
 
-       ASN1_BIT_STRING_free(bs);
+       M_ASN1_BIT_STRING_free(bs);
 
        M_ASN1_D2I_Finish_2(a);
 
@@ -95,7 +95,7 @@ err_bn:
 err:
        ASN1err(ASN1_F_D2I_DHPARAMS,i);
        if ((ret != NULL) && ((a == NULL) || (*a != ret))) DH_free(ret);
-       if (bs != NULL) ASN1_BIT_STRING_free(bs);
+       if (bs != NULL) M_ASN1_BIT_STRING_free(bs);
        return(NULL);
        }
 #endif
index cdd7136f512ae0b9ad4d121c5bf0696a76324963..6d1c2971330d2cddfe0c4febabf9baf0e01d605b 100644 (file)
@@ -83,7 +83,7 @@ DSA *d2i_DSAparams(DSA **a, unsigned char **pp, long length)
        M_ASN1_D2I_get(bs,d2i_ASN1_INTEGER);
        if ((ret->g=BN_bin2bn(bs->data,bs->length,ret->g)) == NULL) goto err_bn;
 
-       ASN1_BIT_STRING_free(bs);
+       M_ASN1_BIT_STRING_free(bs);
 
        M_ASN1_D2I_Finish_2(a);
 
@@ -92,7 +92,7 @@ err_bn:
 err:
        ASN1err(ASN1_F_D2I_DSAPARAMS,i);
        if ((ret != NULL) && ((a == NULL) || (*a != ret))) DSA_free(ret);
-       if (bs != NULL) ASN1_BIT_STRING_free(bs);
+       if (bs != NULL) M_ASN1_BIT_STRING_free(bs);
        return(NULL);
        }
 #endif
index 18f11b6f5efe64aead1c41ccf252e9f5794922cf..b6b2fc81a4f516d11508ecbff2ac6dd8b7c367a5 100644 (file)
@@ -107,7 +107,7 @@ RSA *d2i_RSAPrivateKey(RSA **a, unsigned char **pp, long length)
        if ((ret->iqmp=BN_bin2bn(bs->data,bs->length,ret->iqmp)) == NULL)
                goto err_bn;
 
-       ASN1_INTEGER_free(bs);
+       M_ASN1_INTEGER_free(bs);
 
        M_ASN1_D2I_Finish_2(a);
 err_bn:
@@ -115,7 +115,8 @@ err_bn:
 err:
        ASN1err(ASN1_F_D2I_RSAPRIVATEKEY,i);
        if ((ret != NULL) && ((a == NULL) || (*a != ret))) RSA_free(ret);
-       if (bs != NULL) ASN1_INTEGER_free(bs);
+       if (bs != NULL) M_ASN1_INTEGER_free(bs);
+
        return(NULL);
        }
 #endif
index c4ae58b59439b419d1671d4eb035b2bba723e1a2..e8ca78219068b539f592ab5f3775f354caa1c7a3 100644 (file)
@@ -81,7 +81,7 @@ RSA *d2i_RSAPublicKey(RSA **a, unsigned char **pp, long length)
        M_ASN1_D2I_get(bs,d2i_ASN1_INTEGER);
        if ((ret->e=BN_bin2bn(bs->data,bs->length,ret->e)) == NULL) goto err_bn;
 
-       ASN1_INTEGER_free(bs);
+       M_ASN1_INTEGER_free(bs);
        bs=NULL;
 
        M_ASN1_D2I_Finish_2(a);
@@ -91,7 +91,7 @@ err_bn:
 err:
        ASN1err(ASN1_F_D2I_RSAPUBLICKEY,i);
        if ((ret != NULL) && ((a == NULL) || (*a != ret))) RSA_free(ret);
-       if (bs != NULL) ASN1_INTEGER_free(bs);
+       if (bs != NULL) M_ASN1_INTEGER_free(bs);
        return(NULL);
        }
 #endif
index 050e1cc5fb21d2db4e53a2d7c10542f29571d135..dec2a2ebd3857ff2cbbdce10d0a37f198e7b993c 100644 (file)
@@ -91,7 +91,7 @@ DSA *d2i_DSAPrivateKey(DSA **a, unsigned char **pp, long length)
        if ((ret->priv_key=BN_bin2bn(bs->data,bs->length,ret->priv_key))
                == NULL) goto err_bn;
 
-       ASN1_INTEGER_free(bs);
+       M_ASN1_INTEGER_free(bs);
 
        M_ASN1_D2I_Finish_2(a);
 err_bn:
@@ -99,7 +99,7 @@ err_bn:
 err:
        ASN1err(ASN1_F_D2I_DSAPRIVATEKEY,i);
        if ((ret != NULL) && ((a == NULL) || (*a != ret))) DSA_free(ret);
-       if (bs != NULL) ASN1_INTEGER_free(bs);
+       if (bs != NULL) M_ASN1_INTEGER_free(bs);
        return(NULL);
        }
 #endif
index 94ea1c313b686fecb836024b7634fbe69a432e78..e0adaa0393677ed65fca4a6018b2f9d2b3b88f97 100644 (file)
@@ -107,7 +107,7 @@ DSA *d2i_DSAPublicKey(DSA **a, unsigned char **pp, long length)
                ret->write_params=1;
                }
 
-       ASN1_INTEGER_free(bs);
+       M_ASN1_INTEGER_free(bs);
        bs=NULL;
        M_ASN1_D2I_Finish_2(a);
 err_bn:
@@ -115,7 +115,7 @@ err_bn:
 err:
        ASN1err(ASN1_F_D2I_DSAPUBLICKEY,i);
        if ((ret != NULL) && ((a == NULL) || (*a != ret))) DSA_free(ret);
-       if (bs != NULL) ASN1_INTEGER_free(bs);
+       if (bs != NULL) M_ASN1_INTEGER_free(bs);
        return(NULL);
        }
 #endif
index 41ced49c1906c399edf119a416ecf79472309d8b..3506005a7146faef41f681abfc70f273fe0cee00 100644 (file)
@@ -65,8 +65,8 @@ int ASN1_TYPE_set_octetstring(ASN1_TYPE *a, unsigned char *data, int len)
        {
        ASN1_STRING *os;
 
-       if ((os=ASN1_OCTET_STRING_new()) == NULL) return(0);
-       if (!ASN1_OCTET_STRING_set(os,data,len)) return(0);
+       if ((os=M_ASN1_OCTET_STRING_new()) == NULL) return(0);
+       if (!M_ASN1_OCTET_STRING_set(os,data,len)) return(0);
        ASN1_TYPE_set(a,V_ASN1_OCTET_STRING,os);
        return(1);
        }
@@ -83,8 +83,8 @@ int ASN1_TYPE_get_octetstring(ASN1_TYPE *a, unsigned char *data,
                ASN1err(ASN1_F_ASN1_TYPE_GET_OCTETSTRING,ASN1_R_DATA_IS_WRONG);
                return(-1);
                }
-       p=ASN1_STRING_data(a->value.octet_string);
-       ret=ASN1_STRING_length(a->value.octet_string);
+       p=M_ASN1_STRING_data(a->value.octet_string);
+       ret=M_ASN1_STRING_length(a->value.octet_string);
        if (ret < max_len)
                num=ret;
        else
@@ -117,8 +117,8 @@ int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num, unsigned char *data,
        /* Grow the 'string' */
        ASN1_STRING_set(osp,NULL,size);
 
-       ASN1_STRING_length(osp)=size;
-       p=ASN1_STRING_data(osp);
+       M_ASN1_STRING_length_set(osp, size);
+       p=M_ASN1_STRING_data(osp);
 
        ASN1_put_object(&p,1,n,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL);
          i2d_ASN1_INTEGER(&in,&p);
@@ -145,8 +145,8 @@ int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a, long *num, unsigned char *data,
                {
                goto err;
                }
-       p=ASN1_STRING_data(a->value.sequence);
-       length=ASN1_STRING_length(a->value.sequence);
+       p=M_ASN1_STRING_data(a->value.sequence);
+       length=M_ASN1_STRING_length(a->value.sequence);
 
        c.pp= &p;
        c.p=p;
@@ -165,21 +165,21 @@ int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a, long *num, unsigned char *data,
        if (num != NULL)
                *num=ASN1_INTEGER_get(ai);
 
-       ret=ASN1_STRING_length(os);
+       ret=M_ASN1_STRING_length(os);
        if (max_len > ret)
                n=ret;
        else
                n=max_len;
 
        if (data != NULL)
-               memcpy(data,ASN1_STRING_data(os),n);
+               memcpy(data,M_ASN1_STRING_data(os),n);
        if (0)
                {
 err:
                ASN1err(ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING,ASN1_R_DATA_IS_WRONG);
                }
-       if (os != NULL) ASN1_OCTET_STRING_free(os);
-       if (ai != NULL) ASN1_INTEGER_free(ai);
+       if (os != NULL) M_ASN1_OCTET_STRING_free(os);
+       if (ai != NULL) M_ASN1_INTEGER_free(ai);
        return(ret);
        }
 
index cdc0d8b7c46d5e2e7788bf4ffbfc2f8196b5384c..b2fdadcc15ec1030effb33c228750a73c61a810e 100644 (file)
@@ -205,10 +205,10 @@ RSA *d2i_Netscape_RSA(RSA **a, unsigned char **pp, long length, int (*cb)())
                (char *)os->data,os->length) != 0))
                {
                ASN1err(ASN1_F_D2I_NETSCAPE_RSA,ASN1_R_PRIVATE_KEY_HEADER_MISSING);
-               ASN1_BIT_STRING_free(os);
+               M_ASN1_BIT_STRING_free(os);
                goto err;
                }
-       ASN1_BIT_STRING_free(os);
+       M_ASN1_BIT_STRING_free(os);
        c.q=c.p;
        if ((ret=d2i_Netscape_RSA_2(a,&c.p,c.slen,cb)) == NULL) goto err;
        c.slen-=(c.p-c.q);
@@ -279,7 +279,7 @@ RSA *d2i_Netscape_RSA_2(RSA **a, unsigned char **pp, long length,
        *pp=c.p;
 err:
        if (pkey != NULL) NETSCAPE_PKEY_free(pkey);
-       if (os != NULL) ASN1_BIT_STRING_free(os);
+       if (os != NULL) M_ASN1_BIT_STRING_free(os);
        if (alg != NULL) X509_ALGOR_free(alg);
        return(ret);
        }
@@ -321,9 +321,9 @@ static NETSCAPE_PKEY *NETSCAPE_PKEY_new(void)
        ASN1_CTX c;
 
        M_ASN1_New_Malloc(ret,NETSCAPE_PKEY);
-       M_ASN1_New(ret->version,ASN1_INTEGER_new);
+       M_ASN1_New(ret->version,M_ASN1_INTEGER_new);
        M_ASN1_New(ret->algor,X509_ALGOR_new);
-       M_ASN1_New(ret->private_key,ASN1_OCTET_STRING_new);
+       M_ASN1_New(ret->private_key,M_ASN1_OCTET_STRING_new);
        return(ret);
        M_ASN1_New_Error(ASN1_F_NETSCAPE_PKEY_NEW);
        }
@@ -331,9 +331,9 @@ static NETSCAPE_PKEY *NETSCAPE_PKEY_new(void)
 static void NETSCAPE_PKEY_free(NETSCAPE_PKEY *a)
        {
        if (a == NULL) return;
-       ASN1_INTEGER_free(a->version);
+       M_ASN1_INTEGER_free(a->version);
        X509_ALGOR_free(a->algor);
-       ASN1_OCTET_STRING_free(a->private_key);
+       M_ASN1_OCTET_STRING_free(a->private_key);
        Free((char *)a);
        }
 
index b831836e7b085d8b9a8c4ca559a5e9b89c06f26b..adb92e5fd057cb0e74968dd743f1b18a5918e716 100644 (file)
@@ -82,8 +82,8 @@ PBEPARAM *PBEPARAM_new(void)
        PBEPARAM *ret=NULL;
        ASN1_CTX c;
        M_ASN1_New_Malloc(ret, PBEPARAM);
-       M_ASN1_New(ret->iter,ASN1_INTEGER_new);
-       M_ASN1_New(ret->salt,ASN1_OCTET_STRING_new);
+       M_ASN1_New(ret->iter,M_ASN1_INTEGER_new);
+       M_ASN1_New(ret->salt,M_ASN1_OCTET_STRING_new);
        return (ret);
        M_ASN1_New_Error(ASN1_F_PBEPARAM_NEW);
 }
@@ -101,8 +101,8 @@ PBEPARAM *d2i_PBEPARAM(PBEPARAM **a, unsigned char **pp, long length)
 void PBEPARAM_free (PBEPARAM *a)
 {
        if(a==NULL) return;
-       ASN1_OCTET_STRING_free(a->salt);
-       ASN1_INTEGER_free (a->iter);
+       M_ASN1_OCTET_STRING_free(a->salt);
+       M_ASN1_INTEGER_free (a->iter);
        Free ((char *)a);
 }
 
index 09f4bf61121b2a0a9c064c59ccf8ac57ea68b338..19888473e67f546a2ad67311b97c6a10f8232943 100644 (file)
@@ -131,7 +131,7 @@ PBKDF2PARAM *PBKDF2PARAM_new(void)
        ASN1_CTX c;
        M_ASN1_New_Malloc(ret, PBKDF2PARAM);
        M_ASN1_New(ret->salt, ASN1_TYPE_new);
-       M_ASN1_New(ret->iter, ASN1_INTEGER_new);
+       M_ASN1_New(ret->iter, M_ASN1_INTEGER_new);
        ret->keylength = NULL;
        ret->prf = NULL;
        return (ret);
@@ -155,8 +155,8 @@ void PBKDF2PARAM_free (PBKDF2PARAM *a)
 {
        if(a==NULL) return;
        ASN1_TYPE_free(a->salt);
-       ASN1_INTEGER_free(a->iter);
-       ASN1_INTEGER_free(a->keylength);
+       M_ASN1_INTEGER_free(a->iter);
+       M_ASN1_INTEGER_free(a->keylength);
        X509_ALGOR_free(a->prf);
        Free ((char *)a);
 }
@@ -199,7 +199,7 @@ X509_ALGOR *PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter,
        EVP_CIPHER_CTX_cleanup(&ctx);
 
        if(!(kdf = PBKDF2PARAM_new())) goto merr;
-       if(!(osalt = ASN1_OCTET_STRING_new())) goto merr;
+       if(!(osalt = M_ASN1_OCTET_STRING_new())) goto merr;
 
        if (!saltlen) saltlen = PKCS5_SALT_LEN;
        if (!(osalt->data = Malloc (saltlen))) goto merr;
@@ -218,7 +218,7 @@ X509_ALGOR *PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter,
        /* If its RC2 then we'd better setup the key length */
 
        if(alg_nid == NID_rc2_cbc) {
-               if(!(kdf->keylength = ASN1_INTEGER_new())) goto merr;
+               if(!(kdf->keylength = M_ASN1_INTEGER_new())) goto merr;
                if(!ASN1_INTEGER_set (kdf->keylength,
                                 EVP_CIPHER_key_length(cipher))) goto merr;
        }
@@ -264,7 +264,7 @@ X509_ALGOR *PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter,
        err:
        PBE2PARAM_free(pbe2);
        /* Note 'scheme' is freed as part of pbe2 */
-       ASN1_OCTET_STRING_free(osalt);
+       M_ASN1_OCTET_STRING_free(osalt);
        PBKDF2PARAM_free(kdf);
        X509_ALGOR_free(kalg);
        X509_ALGOR_free(ret);
index 62783a2b8de9041862881171a72080a0a37c36f7..84e4d557be14b48ae4582463283f66ef2f4257da 100644 (file)
@@ -101,10 +101,10 @@ PKCS7_DIGEST *PKCS7_DIGEST_new(void)
        ASN1_CTX c;
 
        M_ASN1_New_Malloc(ret,PKCS7_DIGEST);
-       M_ASN1_New(ret->version,ASN1_INTEGER_new);
+       M_ASN1_New(ret->version,M_ASN1_INTEGER_new);
        M_ASN1_New(ret->md,X509_ALGOR_new);
        M_ASN1_New(ret->contents,PKCS7_new);
-       M_ASN1_New(ret->digest,ASN1_OCTET_STRING_new);
+       M_ASN1_New(ret->digest,M_ASN1_OCTET_STRING_new);
        return(ret);
        M_ASN1_New_Error(ASN1_F_PKCS7_DIGEST_NEW);
        }
@@ -112,10 +112,10 @@ PKCS7_DIGEST *PKCS7_DIGEST_new(void)
 void PKCS7_DIGEST_free(PKCS7_DIGEST *a)
        {
        if (a == NULL) return;
-       ASN1_INTEGER_free(a->version);
+       M_ASN1_INTEGER_free(a->version);
        X509_ALGOR_free(a->md);
        PKCS7_free(a->contents);
-       ASN1_OCTET_STRING_free(a->digest);
+       M_ASN1_OCTET_STRING_free(a->digest);
        Free((char *)a);
        }
 
index 474112658704935d32f16c7e85f3a63786f41ab3..8c19b2dc0d77508171778480640abd7bffde2c73 100644 (file)
@@ -95,7 +95,7 @@ PKCS7_ENCRYPT *PKCS7_ENCRYPT_new(void)
        ASN1_CTX c;
 
        M_ASN1_New_Malloc(ret,PKCS7_ENCRYPT);
-       M_ASN1_New(ret->version,ASN1_INTEGER_new);
+       M_ASN1_New(ret->version,M_ASN1_INTEGER_new);
        M_ASN1_New(ret->enc_data,PKCS7_ENC_CONTENT_new);
        return(ret);
        M_ASN1_New_Error(ASN1_F_PKCS7_ENCRYPT_NEW);
@@ -104,7 +104,7 @@ PKCS7_ENCRYPT *PKCS7_ENCRYPT_new(void)
 void PKCS7_ENCRYPT_free(PKCS7_ENCRYPT *a)
        {
        if (a == NULL) return;
-       ASN1_INTEGER_free(a->version);
+       M_ASN1_INTEGER_free(a->version);
        PKCS7_ENC_CONTENT_free(a->enc_data);
        Free((char *)a);
        }
index d8dcb112462e1624fbe8378a767c996428cdb658..180a11dc9473fa2f8b3182d9e7fae1443e781668 100644 (file)
@@ -114,7 +114,7 @@ void PKCS7_ENC_CONTENT_free(PKCS7_ENC_CONTENT *a)
        if (a == NULL) return;
        ASN1_OBJECT_free(a->content_type);
        X509_ALGOR_free(a->algorithm);
-       ASN1_OCTET_STRING_free(a->enc_data);
+       M_ASN1_OCTET_STRING_free(a->enc_data);
        Free((char *)a);
        }
 
index b2b3d50dcd809428d3d4ac69ee8d2c370a7f3a0a..bf45f44029612ecce628e4aaba0c2884b40e5546 100644 (file)
@@ -101,7 +101,7 @@ PKCS7_ENVELOPE *PKCS7_ENVELOPE_new(void)
        ASN1_CTX c;
 
        M_ASN1_New_Malloc(ret,PKCS7_ENVELOPE);
-       M_ASN1_New(ret->version,ASN1_INTEGER_new);
+       M_ASN1_New(ret->version,M_ASN1_INTEGER_new);
        M_ASN1_New(ret->recipientinfo,sk_PKCS7_RECIP_INFO_new_null);
        M_ASN1_New(ret->enc_data,PKCS7_ENC_CONTENT_new);
        return(ret);
@@ -111,7 +111,7 @@ PKCS7_ENVELOPE *PKCS7_ENVELOPE_new(void)
 void PKCS7_ENVELOPE_free(PKCS7_ENVELOPE *a)
        {
        if (a == NULL) return;
-       ASN1_INTEGER_free(a->version);
+       M_ASN1_INTEGER_free(a->version);
        sk_PKCS7_RECIP_INFO_pop_free(a->recipientinfo,PKCS7_RECIP_INFO_free);
        PKCS7_ENC_CONTENT_free(a->enc_data);
        Free((char *)a);
index 7d4b457e0171445f4ac903d2877b5da806dc1009..46fc0821b4d2e2e47dcf62595d8a4f52c9309f28 100644 (file)
@@ -96,7 +96,7 @@ PKCS7_ISSUER_AND_SERIAL *PKCS7_ISSUER_AND_SERIAL_new(void)
 
        M_ASN1_New_Malloc(ret,PKCS7_ISSUER_AND_SERIAL);
        M_ASN1_New(ret->issuer,X509_NAME_new);
-       M_ASN1_New(ret->serial,ASN1_INTEGER_new);
+       M_ASN1_New(ret->serial,M_ASN1_INTEGER_new);
        return(ret);
        M_ASN1_New_Error(ASN1_F_PKCS7_ISSUER_AND_SERIAL_NEW);
        }
@@ -105,7 +105,7 @@ void PKCS7_ISSUER_AND_SERIAL_free(PKCS7_ISSUER_AND_SERIAL *a)
        {
        if (a == NULL) return;
        X509_NAME_free(a->issuer);
-       ASN1_INTEGER_free(a->serial);
+       M_ASN1_INTEGER_free(a->serial);
        Free((char *)a);
        }
 
index 846be171588a8d2423499509ab56c5792137f229..d3e596dab3ee325a63c76e6b7a257561f85c3df1 100644 (file)
@@ -268,7 +268,7 @@ void PKCS7_content_free(PKCS7 *a)
                switch (OBJ_obj2nid(a->type))
                        {
                case NID_pkcs7_data:
-                       ASN1_OCTET_STRING_free(a->d.data);
+                       M_ASN1_OCTET_STRING_free(a->d.data);
                        break;
                case NID_pkcs7_signed:
                        PKCS7_SIGNED_free(a->d.sign);
index 9fda4f20d4975f61eda43726ea534f6c094bf959..b1abfa3b8f2bbb30892343710e0fcd747b333164 100644 (file)
@@ -101,10 +101,10 @@ PKCS7_RECIP_INFO *PKCS7_RECIP_INFO_new(void)
        ASN1_CTX c;
 
        M_ASN1_New_Malloc(ret,PKCS7_RECIP_INFO);
-       M_ASN1_New(ret->version,ASN1_INTEGER_new);
+       M_ASN1_New(ret->version,M_ASN1_INTEGER_new);
        M_ASN1_New(ret->issuer_and_serial,PKCS7_ISSUER_AND_SERIAL_new);
        M_ASN1_New(ret->key_enc_algor,X509_ALGOR_new);
-       M_ASN1_New(ret->enc_key,ASN1_OCTET_STRING_new);
+       M_ASN1_New(ret->enc_key,M_ASN1_OCTET_STRING_new);
        ret->cert=NULL;
        return(ret);
        M_ASN1_New_Error(ASN1_F_PKCS7_RECIP_INFO_NEW);
@@ -113,10 +113,10 @@ PKCS7_RECIP_INFO *PKCS7_RECIP_INFO_new(void)
 void PKCS7_RECIP_INFO_free(PKCS7_RECIP_INFO *a)
        {
        if (a == NULL) return;
-       ASN1_INTEGER_free(a->version);
+       M_ASN1_INTEGER_free(a->version);
        PKCS7_ISSUER_AND_SERIAL_free(a->issuer_and_serial);
        X509_ALGOR_free(a->key_enc_algor);
-       ASN1_OCTET_STRING_free(a->enc_key);
+       M_ASN1_OCTET_STRING_free(a->enc_key);
        if (a->cert != NULL) X509_free(a->cert);
        Free(a);
        }
index 90946695c9503a0c75b2d0200c91429742582f68..3d18fedf8e5be79b9dfac58e8196676f7a693b3f 100644 (file)
@@ -119,7 +119,7 @@ PKCS7_SIGN_ENVELOPE *PKCS7_SIGN_ENVELOPE_new(void)
        ASN1_CTX c;
 
        M_ASN1_New_Malloc(ret,PKCS7_SIGN_ENVELOPE);
-       M_ASN1_New(ret->version,ASN1_INTEGER_new);
+       M_ASN1_New(ret->version,M_ASN1_INTEGER_new);
        M_ASN1_New(ret->recipientinfo,sk_PKCS7_RECIP_INFO_new_null);
        M_ASN1_New(ret->md_algs,sk_X509_ALGOR_new_null);
        M_ASN1_New(ret->enc_data,PKCS7_ENC_CONTENT_new);
@@ -133,7 +133,7 @@ PKCS7_SIGN_ENVELOPE *PKCS7_SIGN_ENVELOPE_new(void)
 void PKCS7_SIGN_ENVELOPE_free(PKCS7_SIGN_ENVELOPE *a)
        {
        if (a == NULL) return;
-       ASN1_INTEGER_free(a->version);
+       M_ASN1_INTEGER_free(a->version);
        sk_PKCS7_RECIP_INFO_pop_free(a->recipientinfo,PKCS7_RECIP_INFO_free);
        sk_X509_ALGOR_pop_free(a->md_algs,X509_ALGOR_free);
        PKCS7_ENC_CONTENT_free(a->enc_data);
index 74f0f522e15d28247a1aef909188c6b4fe0f511d..f6f16a87158dcf8b6ec949a64a20645bb9168263 100644 (file)
@@ -112,7 +112,7 @@ PKCS7_SIGNED *PKCS7_SIGNED_new(void)
        ASN1_CTX c;
 
        M_ASN1_New_Malloc(ret,PKCS7_SIGNED);
-       M_ASN1_New(ret->version,ASN1_INTEGER_new);
+       M_ASN1_New(ret->version,M_ASN1_INTEGER_new);
        M_ASN1_New(ret->md_algs,sk_X509_ALGOR_new_null);
        M_ASN1_New(ret->contents,PKCS7_new);
        ret->cert=NULL;
@@ -125,7 +125,7 @@ PKCS7_SIGNED *PKCS7_SIGNED_new(void)
 void PKCS7_SIGNED_free(PKCS7_SIGNED *a)
        {
        if (a == NULL) return;
-       ASN1_INTEGER_free(a->version);
+       M_ASN1_INTEGER_free(a->version);
        sk_X509_ALGOR_pop_free(a->md_algs,X509_ALGOR_free);
        PKCS7_free(a->contents);
        sk_X509_pop_free(a->cert,X509_free);
index 21132ef4ddd7b28d05252dc61ba8d4dc781c6112..acc38fc3bf0a91d18ead3ba16ede1dbfe99bf2bd 100644 (file)
@@ -119,12 +119,12 @@ PKCS7_SIGNER_INFO *PKCS7_SIGNER_INFO_new(void)
        ASN1_CTX c;
 
        M_ASN1_New_Malloc(ret,PKCS7_SIGNER_INFO);
-       M_ASN1_New(ret->version,ASN1_INTEGER_new);
+       M_ASN1_New(ret->version,M_ASN1_INTEGER_new);
        M_ASN1_New(ret->issuer_and_serial,PKCS7_ISSUER_AND_SERIAL_new);
        M_ASN1_New(ret->digest_alg,X509_ALGOR_new);
        ret->auth_attr=NULL;
        M_ASN1_New(ret->digest_enc_alg,X509_ALGOR_new);
-       M_ASN1_New(ret->enc_digest,ASN1_OCTET_STRING_new);
+       M_ASN1_New(ret->enc_digest,M_ASN1_OCTET_STRING_new);
        ret->unauth_attr=NULL;
        ret->pkey=NULL;
        return(ret);
@@ -134,12 +134,12 @@ PKCS7_SIGNER_INFO *PKCS7_SIGNER_INFO_new(void)
 void PKCS7_SIGNER_INFO_free(PKCS7_SIGNER_INFO *a)
        {
        if (a == NULL) return;
-       ASN1_INTEGER_free(a->version);
+       M_ASN1_INTEGER_free(a->version);
        PKCS7_ISSUER_AND_SERIAL_free(a->issuer_and_serial);
        X509_ALGOR_free(a->digest_alg);
        sk_X509_ATTRIBUTE_pop_free(a->auth_attr,X509_ATTRIBUTE_free);
        X509_ALGOR_free(a->digest_enc_alg);
-       ASN1_OCTET_STRING_free(a->enc_digest);
+       M_ASN1_OCTET_STRING_free(a->enc_digest);
        sk_X509_ATTRIBUTE_pop_free(a->unauth_attr,X509_ATTRIBUTE_free);
        if (a->pkey != NULL)
                EVP_PKEY_free(a->pkey);
index aa9a4f6c9684c8f390de7c5f16780f2e2961fb5e..cf38a6aaf8fdd309097e7c47d2db2465ae1096f1 100644 (file)
@@ -88,7 +88,7 @@ PKCS8_PRIV_KEY_INFO *PKCS8_PRIV_KEY_INFO_new(void)
        PKCS8_PRIV_KEY_INFO *ret=NULL;
        ASN1_CTX c;
        M_ASN1_New_Malloc(ret, PKCS8_PRIV_KEY_INFO);
-       M_ASN1_New (ret->version, ASN1_INTEGER_new);
+       M_ASN1_New (ret->version, M_ASN1_INTEGER_new);
        M_ASN1_New (ret->pkeyalg, X509_ALGOR_new);
        M_ASN1_New (ret->pkey, ASN1_TYPE_new);
        ret->attributes = NULL;
@@ -117,7 +117,7 @@ PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO(PKCS8_PRIV_KEY_INFO **a,
 void PKCS8_PRIV_KEY_INFO_free (PKCS8_PRIV_KEY_INFO *a)
 {
        if (a == NULL) return;
-       ASN1_INTEGER_free (a->version);
+       M_ASN1_INTEGER_free (a->version);
        X509_ALGOR_free(a->pkeyalg);
        /* Clear sensitive data */
        if (a->pkey->value.octet_string)
index c2e447ce6ff3f1d5da206f438f7dce0ae7e29d40..d78e4a8f8878609ada45afb425f65af3f399a80e 100644 (file)
@@ -160,7 +160,7 @@ static void ext_print(BIO *out, X509_EXTENSION *ex)
        BIO_printf(out, ": %s\n", j ? "critical":"","");
        if(!X509V3_EXT_print(out, ex, 0, 16)) {
                BIO_printf(out, "%16s", "");
-               ASN1_OCTET_STRING_print(out,ex->value);
+               M_ASN1_OCTET_STRING_print(out,ex->value);
        }
        BIO_write(out,"\n",1);
 }
index 6049909a02f4dca8f66d86e33199f4cd066de25a..81dd6355a887368e496fb4b4b2a2e562dcebe801 100644 (file)
@@ -221,7 +221,7 @@ get_next:
                                goto err;
                        if(!X509V3_EXT_print(bp, ex, 0, 16)) {
                                BIO_printf(bp, "%16s", "");
-                               ASN1_OCTET_STRING_print(bp,ex->value);
+                               M_ASN1_OCTET_STRING_print(bp,ex->value);
                        }
                        if (BIO_write(bp,"\n",1) <= 0) goto err;
                }
index 80cf37bf0499d3a4443929a9e9a920a18757c345..0e2727e470ab561949e788c944048c5fa4936f51 100644 (file)
@@ -199,7 +199,7 @@ int X509_print(BIO *bp, X509 *x)
                        if(!X509V3_EXT_print(bp, ex, 0, 16))
                                {
                                BIO_printf(bp, "%16s", "");
-                               ASN1_OCTET_STRING_print(bp,ex->value);
+                               M_ASN1_OCTET_STRING_print(bp,ex->value);
                                }
                        if (BIO_write(bp,"\n",1) <= 0) goto err;
                        }
index fe1b18a90ffb956148525d04aab54be46592c5a8..b87c8fff1713f4196e93c16a4a6fc9e4d9e8c7c2 100644 (file)
@@ -115,7 +115,7 @@ X509_CINF *d2i_X509_CINF(X509_CINF **a, unsigned char **pp, long length)
                {
                if (ret->version != NULL)
                        {
-                       ASN1_INTEGER_free(ret->version);
+                       M_ASN1_INTEGER_free(ret->version);
                        ret->version=NULL;
                        }
                }
@@ -129,12 +129,12 @@ X509_CINF *d2i_X509_CINF(X509_CINF **a, unsigned char **pp, long length)
                {
                if (ret->issuerUID != NULL)
                        {
-                       ASN1_BIT_STRING_free(ret->issuerUID);
+                       M_ASN1_BIT_STRING_free(ret->issuerUID);
                        ret->issuerUID=NULL;
                        }
                if (ret->subjectUID != NULL)
                        {
-                       ASN1_BIT_STRING_free(ret->subjectUID);
+                       M_ASN1_BIT_STRING_free(ret->subjectUID);
                        ret->subjectUID=NULL;
                        }
                M_ASN1_D2I_get_IMP_opt(ret->issuerUID,d2i_ASN1_BIT_STRING,  1,
@@ -170,7 +170,7 @@ X509_CINF *X509_CINF_new(void)
 
        M_ASN1_New_Malloc(ret,X509_CINF);
        ret->version=NULL;
-       M_ASN1_New(ret->serialNumber,ASN1_INTEGER_new);
+       M_ASN1_New(ret->serialNumber,M_ASN1_INTEGER_new);
        M_ASN1_New(ret->signature,X509_ALGOR_new);
        M_ASN1_New(ret->issuer,X509_NAME_new);
        M_ASN1_New(ret->validity,X509_VAL_new);
@@ -186,15 +186,15 @@ X509_CINF *X509_CINF_new(void)
 void X509_CINF_free(X509_CINF *a)
        {
        if (a == NULL) return;
-       ASN1_INTEGER_free(a->version);
-       ASN1_INTEGER_free(a->serialNumber);
+       M_ASN1_INTEGER_free(a->version);
+       M_ASN1_INTEGER_free(a->serialNumber);
        X509_ALGOR_free(a->signature);
        X509_NAME_free(a->issuer);
        X509_VAL_free(a->validity);
        X509_NAME_free(a->subject);
        X509_PUBKEY_free(a->key);
-       ASN1_BIT_STRING_free(a->issuerUID);
-       ASN1_BIT_STRING_free(a->subjectUID);
+       M_ASN1_BIT_STRING_free(a->issuerUID);
+       M_ASN1_BIT_STRING_free(a->subjectUID);
        sk_X509_EXTENSION_pop_free(a->extensions,X509_EXTENSION_free);
        Free(a);
        }
index 25657a8799c11f79b57c25d986063288ed4db24d..6755cd610424941d06148e342e691d169e3207e2 100644 (file)
@@ -157,7 +157,7 @@ X509_CRL_INFO *d2i_X509_CRL_INFO(X509_CRL_INFO **a, unsigned char **pp,
        
        if ((ver == 0) && (ret->version != NULL))
                {
-               ASN1_INTEGER_free(ret->version);
+               M_ASN1_INTEGER_free(ret->version);
                ret->version=NULL;
                }
        M_ASN1_D2I_get(ret->sig_alg,d2i_X509_ALGOR);
@@ -242,8 +242,8 @@ X509_REVOKED *X509_REVOKED_new(void)
        ASN1_CTX c;
 
        M_ASN1_New_Malloc(ret,X509_REVOKED);
-       M_ASN1_New(ret->serialNumber,ASN1_INTEGER_new);
-       M_ASN1_New(ret->revocationDate,ASN1_UTCTIME_new);
+       M_ASN1_New(ret->serialNumber,M_ASN1_INTEGER_new);
+       M_ASN1_New(ret->revocationDate,M_ASN1_UTCTIME_new);
        ret->extensions=NULL;
        return(ret);
        M_ASN1_New_Error(ASN1_F_X509_REVOKED_NEW);
@@ -258,7 +258,7 @@ X509_CRL_INFO *X509_CRL_INFO_new(void)
        ret->version=NULL;
        M_ASN1_New(ret->sig_alg,X509_ALGOR_new);
        M_ASN1_New(ret->issuer,X509_NAME_new);
-       M_ASN1_New(ret->lastUpdate,ASN1_UTCTIME_new);
+       M_ASN1_New(ret->lastUpdate,M_ASN1_UTCTIME_new);
        ret->nextUpdate=NULL;
        M_ASN1_New(ret->revoked,sk_X509_REVOKED_new_null);
        M_ASN1_New(ret->extensions,sk_X509_EXTENSION_new_null);
@@ -276,7 +276,7 @@ X509_CRL *X509_CRL_new(void)
        ret->references=1;
        M_ASN1_New(ret->crl,X509_CRL_INFO_new);
        M_ASN1_New(ret->sig_alg,X509_ALGOR_new);
-       M_ASN1_New(ret->signature,ASN1_BIT_STRING_new);
+       M_ASN1_New(ret->signature,M_ASN1_BIT_STRING_new);
        return(ret);
        M_ASN1_New_Error(ASN1_F_X509_CRL_NEW);
        }
@@ -284,8 +284,8 @@ X509_CRL *X509_CRL_new(void)
 void X509_REVOKED_free(X509_REVOKED *a)
        {
        if (a == NULL) return;
-       ASN1_INTEGER_free(a->serialNumber);
-       ASN1_UTCTIME_free(a->revocationDate);
+       M_ASN1_INTEGER_free(a->serialNumber);
+       M_ASN1_UTCTIME_free(a->revocationDate);
        sk_X509_EXTENSION_pop_free(a->extensions,X509_EXTENSION_free);
        Free(a);
        }
@@ -293,12 +293,12 @@ void X509_REVOKED_free(X509_REVOKED *a)
 void X509_CRL_INFO_free(X509_CRL_INFO *a)
        {
        if (a == NULL) return;
-       ASN1_INTEGER_free(a->version);
+       M_ASN1_INTEGER_free(a->version);
        X509_ALGOR_free(a->sig_alg);
        X509_NAME_free(a->issuer);
-       ASN1_UTCTIME_free(a->lastUpdate);
+       M_ASN1_UTCTIME_free(a->lastUpdate);
        if (a->nextUpdate)
-               ASN1_UTCTIME_free(a->nextUpdate);
+               M_ASN1_UTCTIME_free(a->nextUpdate);
        sk_X509_REVOKED_pop_free(a->revoked,X509_REVOKED_free);
        sk_X509_EXTENSION_pop_free(a->extensions,X509_EXTENSION_free);
        Free(a);
@@ -325,7 +325,7 @@ void X509_CRL_free(X509_CRL *a)
 
        X509_CRL_INFO_free(a->crl);
        X509_ALGOR_free(a->sig_alg);
-       ASN1_BIT_STRING_free(a->signature);
+       M_ASN1_BIT_STRING_free(a->signature);
        Free(a);
        }
 
index f5931f762383c9bc9cd229e7f3da5a1941d6c986..269e1ee721cd3a16f2494d57b1d23035a3f15f5c 100644 (file)
@@ -122,7 +122,7 @@ X509_EXTENSION *X509_EXTENSION_new(void)
 
        M_ASN1_New_Malloc(ret,X509_EXTENSION);
        ret->object=OBJ_nid2obj(NID_undef);
-       M_ASN1_New(ret->value,ASN1_OCTET_STRING_new);
+       M_ASN1_New(ret->value,M_ASN1_OCTET_STRING_new);
        ret->critical=0;
        ret->netscape_hack=0;
        return(ret);
@@ -133,7 +133,7 @@ void X509_EXTENSION_free(X509_EXTENSION *a)
        {
        if (a == NULL) return;
        ASN1_OBJECT_free(a->object);
-       ASN1_OCTET_STRING_free(a->value);
+       M_ASN1_OCTET_STRING_free(a->value);
        Free((char *)a);
        }
 
index b09fba33fbd2d7cbca38feebc0637a210d72eeb2..64baf5719d86e167e217f5bffc009863e9a0908f 100644 (file)
@@ -253,7 +253,7 @@ void X509_NAME_ENTRY_free(X509_NAME_ENTRY *a)
        {
        if (a == NULL) return;
        ASN1_OBJECT_free(a->object);
-       ASN1_BIT_STRING_free(a->value);
+       M_ASN1_BIT_STRING_free(a->value);
        Free(a);
        }
 
index b0057eb212cdaed648739956f51b34ee67a0acd3..0c81558dc4b2263fbf284b5a43479afb7340bd26 100644 (file)
@@ -112,7 +112,7 @@ X509_PKEY *X509_PKEY_new(void)
        M_ASN1_New_Malloc(ret,X509_PKEY);
        ret->version=0;
        M_ASN1_New(ret->enc_algor,X509_ALGOR_new);
-       M_ASN1_New(ret->enc_pkey,ASN1_OCTET_STRING_new);
+       M_ASN1_New(ret->enc_pkey,M_ASN1_OCTET_STRING_new);
        ret->dec_pkey=NULL;
        ret->key_length=0;
        ret->key_data=NULL;
@@ -144,7 +144,7 @@ void X509_PKEY_free(X509_PKEY *x)
 #endif
 
        if (x->enc_algor != NULL) X509_ALGOR_free(x->enc_algor);
-       if (x->enc_pkey != NULL) ASN1_OCTET_STRING_free(x->enc_pkey);
+       if (x->enc_pkey != NULL) M_ASN1_OCTET_STRING_free(x->enc_pkey);
        if (x->dec_pkey != NULL)EVP_PKEY_free(x->dec_pkey);
        if ((x->key_data != NULL) && (x->key_free)) Free((char *)x->key_data);
        Free((char *)(char *)x);
index 4ac32c59dd73e0ea6e399bfbbf78ba32ccb690b5..8adaeba82ced98f180bf035a85010411a042cb22 100644 (file)
@@ -100,7 +100,7 @@ X509_PUBKEY *X509_PUBKEY_new(void)
 
        M_ASN1_New_Malloc(ret,X509_PUBKEY);
        M_ASN1_New(ret->algor,X509_ALGOR_new);
-       M_ASN1_New(ret->public_key,ASN1_BIT_STRING_new);
+       M_ASN1_New(ret->public_key,M_ASN1_BIT_STRING_new);
        ret->pkey=NULL;
        return(ret);
        M_ASN1_New_Error(ASN1_F_X509_PUBKEY_NEW);
@@ -110,7 +110,7 @@ void X509_PUBKEY_free(X509_PUBKEY *a)
        {
        if (a == NULL) return;
        X509_ALGOR_free(a->algor);
-       ASN1_BIT_STRING_free(a->public_key);
+       M_ASN1_BIT_STRING_free(a->public_key);
        if (a->pkey != NULL) EVP_PKEY_free(a->pkey);
        Free((char *)a);
        }
@@ -176,7 +176,7 @@ int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey)
        if ((s=(unsigned char *)Malloc(i+1)) == NULL) goto err;
        p=s;
        i2d_PublicKey(pkey,&p);
-       if (!ASN1_BIT_STRING_set(pk->public_key,s,i)) goto err;
+       if (!M_ASN1_BIT_STRING_set(pk->public_key,s,i)) goto err;
        /* Set number of unused bits to zero */
        pk->public_key->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07);
        pk->public_key->flags|=ASN1_STRING_FLAG_BITS_LEFT;
index 9b1d6abe640ae384abe4d39e8e9abe9012b7030d..030e4ad846d9742a0851e98d4afeb8db4ff0957b 100644 (file)
@@ -147,7 +147,7 @@ X509_REQ_INFO *X509_REQ_INFO_new(void)
        ASN1_CTX c;
 
        M_ASN1_New_Malloc(ret,X509_REQ_INFO);
-       M_ASN1_New(ret->version,ASN1_INTEGER_new);
+       M_ASN1_New(ret->version,M_ASN1_INTEGER_new);
        M_ASN1_New(ret->subject,X509_NAME_new);
        M_ASN1_New(ret->pubkey,X509_PUBKEY_new);
        M_ASN1_New(ret->attributes,sk_X509_ATTRIBUTE_new_null);
@@ -159,7 +159,7 @@ X509_REQ_INFO *X509_REQ_INFO_new(void)
 void X509_REQ_INFO_free(X509_REQ_INFO *a)
        {
        if (a == NULL) return;
-       ASN1_INTEGER_free(a->version);
+       M_ASN1_INTEGER_free(a->version);
        X509_NAME_free(a->subject);
        X509_PUBKEY_free(a->pubkey);
        sk_X509_ATTRIBUTE_pop_free(a->attributes,X509_ATTRIBUTE_free);
@@ -203,7 +203,7 @@ X509_REQ *X509_REQ_new(void)
        ret->references=1;
        M_ASN1_New(ret->req_info,X509_REQ_INFO_new);
        M_ASN1_New(ret->sig_alg,X509_ALGOR_new);
-       M_ASN1_New(ret->signature,ASN1_BIT_STRING_new);
+       M_ASN1_New(ret->signature,M_ASN1_BIT_STRING_new);
        return(ret);
        M_ASN1_New_Error(ASN1_F_X509_REQ_NEW);
        }
@@ -229,7 +229,7 @@ void X509_REQ_free(X509_REQ *a)
 
        X509_REQ_INFO_free(a->req_info);
        X509_ALGOR_free(a->sig_alg);
-       ASN1_BIT_STRING_free(a->signature);
+       M_ASN1_BIT_STRING_free(a->signature);
        Free((char *)a);
        }
 
index c2782d1b9c087bc8fdfa049384ba687fe7260907..ea6488274cb0909a00f900a7e223935782dcb1ad 100644 (file)
@@ -94,7 +94,7 @@ X509_SIG *X509_SIG_new(void)
 
        M_ASN1_New_Malloc(ret,X509_SIG);
        M_ASN1_New(ret->algor,X509_ALGOR_new);
-       M_ASN1_New(ret->digest,ASN1_OCTET_STRING_new);
+       M_ASN1_New(ret->digest,M_ASN1_OCTET_STRING_new);
        return(ret);
        M_ASN1_New_Error(ASN1_F_X509_SIG_NEW);
        }
@@ -103,7 +103,7 @@ void X509_SIG_free(X509_SIG *a)
        {
        if (a == NULL) return;
        X509_ALGOR_free(a->algor);
-       ASN1_OCTET_STRING_free(a->digest);
+       M_ASN1_OCTET_STRING_free(a->digest);
        Free((char *)a);
        }
 
index 43e0023839ad07de510f03cf0af846a61d32bd62..42493d955ac56c11276273cfea1d8093d7c75dbf 100644 (file)
@@ -99,7 +99,7 @@ NETSCAPE_SPKAC *NETSCAPE_SPKAC_new(void)
 
        M_ASN1_New_Malloc(ret,NETSCAPE_SPKAC);
        M_ASN1_New(ret->pubkey,X509_PUBKEY_new);
-       M_ASN1_New(ret->challenge,ASN1_IA5STRING_new);
+       M_ASN1_New(ret->challenge,M_ASN1_IA5STRING_new);
        return(ret);
        M_ASN1_New_Error(ASN1_F_NETSCAPE_SPKAC_NEW);
        }
@@ -108,7 +108,7 @@ void NETSCAPE_SPKAC_free(NETSCAPE_SPKAC *a)
        {
        if (a == NULL) return;
        X509_PUBKEY_free(a->pubkey);
-       ASN1_IA5STRING_free(a->challenge);
+       M_ASN1_IA5STRING_free(a->challenge);
        Free((char *)a);
        }
 
@@ -150,7 +150,7 @@ NETSCAPE_SPKI *NETSCAPE_SPKI_new(void)
        M_ASN1_New_Malloc(ret,NETSCAPE_SPKI);
        M_ASN1_New(ret->spkac,NETSCAPE_SPKAC_new);
        M_ASN1_New(ret->sig_algor,X509_ALGOR_new);
-       M_ASN1_New(ret->signature,ASN1_BIT_STRING_new);
+       M_ASN1_New(ret->signature,M_ASN1_BIT_STRING_new);
        return(ret);
        M_ASN1_New_Error(ASN1_F_NETSCAPE_SPKI_NEW);
        }
@@ -160,7 +160,7 @@ void NETSCAPE_SPKI_free(NETSCAPE_SPKI *a)
        if (a == NULL) return;
        NETSCAPE_SPKAC_free(a->spkac);
        X509_ALGOR_free(a->sig_algor);
-       ASN1_BIT_STRING_free(a->signature);
+       M_ASN1_BIT_STRING_free(a->signature);
        Free((char *)a);
        }
 
index 84d6f7ca4dfc3f1a3cc6bf462c86f58889cdea76..d0a7ea1cf1a50c3b4c3e9b290efba4662eb2e959 100644 (file)
@@ -93,8 +93,8 @@ X509_VAL *X509_VAL_new(void)
        ASN1_CTX c;
 
        M_ASN1_New_Malloc(ret,X509_VAL);
-       M_ASN1_New(ret->notBefore,ASN1_TIME_new);
-       M_ASN1_New(ret->notAfter,ASN1_TIME_new);
+       M_ASN1_New(ret->notBefore,M_ASN1_TIME_new);
+       M_ASN1_New(ret->notAfter,M_ASN1_TIME_new);
        return(ret);
        M_ASN1_New_Error(ASN1_F_X509_VAL_NEW);
        }
@@ -102,8 +102,8 @@ X509_VAL *X509_VAL_new(void)
 void X509_VAL_free(X509_VAL *a)
        {
        if (a == NULL) return;
-       ASN1_TIME_free(a->notBefore);
-       ASN1_TIME_free(a->notAfter);
+       M_ASN1_TIME_free(a->notBefore);
+       M_ASN1_TIME_free(a->notAfter);
        Free((char *)a);
        }
 
index 5326debe0046a06c15bf72e8695d9b484940c991..3352c61c60b96ba79f37de2484575f86f8b442a7 100644 (file)
@@ -120,7 +120,7 @@ X509 *X509_new(void)
        ret->name=NULL;
        M_ASN1_New(ret->cert_info,X509_CINF_new);
        M_ASN1_New(ret->sig_alg,X509_ALGOR_new);
-       M_ASN1_New(ret->signature,ASN1_BIT_STRING_new);
+       M_ASN1_New(ret->signature,M_ASN1_BIT_STRING_new);
        CRYPTO_new_ex_data(x509_meth, (char *)ret, &ret->ex_data);
        return(ret);
        M_ASN1_New_Error(ASN1_F_X509_NEW);
@@ -148,7 +148,7 @@ void X509_free(X509 *a)
        CRYPTO_free_ex_data(x509_meth,(char *)a,&a->ex_data);
        X509_CINF_free(a->cert_info);
        X509_ALGOR_free(a->sig_alg);
-       ASN1_BIT_STRING_free(a->signature);
+       M_ASN1_BIT_STRING_free(a->signature);
 
        if (a->name != NULL) Free(a->name);
        Free((char *)a);
index 7523b21654d7bffbe16b3792275b06f462e837fe..c9b32b4db78c5acf4ed5320a7709ab4fca28e0e1 100644 (file)
@@ -83,7 +83,7 @@ DSA_SIG *d2i_DSA_SIG(DSA_SIG **a, unsigned char **pp, long length)
        M_ASN1_D2I_get(bs,d2i_ASN1_INTEGER);
        if ((ret->s=BN_bin2bn(bs->data,bs->length,ret->s)) == NULL)
                goto err_bn;
-       ASN1_BIT_STRING_free(bs);
+       M_ASN1_BIT_STRING_free(bs);
        M_ASN1_D2I_Finish_2(a);
 
 err_bn:
@@ -91,6 +91,6 @@ err_bn:
 err:
        DSAerr(DSA_F_D2I_DSA_SIG,i);
        if ((ret != NULL) && ((a == NULL) || (*a != ret))) DSA_SIG_free(ret);
-       if (bs != NULL) ASN1_BIT_STRING_free(bs);
+       if (bs != NULL) M_ASN1_BIT_STRING_free(bs);
        return(NULL);
 }
index 421e452db11fa8be69c3734c8edc6fac8a5204eb..396862767f3ddb3dd305990ba53a32044772858c 100644 (file)
@@ -254,11 +254,11 @@ PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey)
                if (!ASN1_pack_string((char *)dpkey, i2d_ASN1_INTEGER,
                                         &p8->pkey->value.octet_string)) {
                        EVPerr(EVP_F_EVP_PKEY2PKCS8,ERR_R_MALLOC_FAILURE);
-                       ASN1_INTEGER_free (dpkey);
+                       M_ASN1_INTEGER_free (dpkey);
                        PKCS8_PRIV_KEY_INFO_free (p8);
                        return NULL;
                }
-               ASN1_INTEGER_free (dpkey);
+               M_ASN1_INTEGER_free (dpkey);
                break;
 #endif
                default:
index 50a7d0ba2524f4e04e7b46ee5a7097c32f24da5b..7ed1c3fea497eab631b7ad3b60d7c6e0a3e149df 100644 (file)
@@ -133,7 +133,7 @@ PKCS7 *PKCS12_pack_p7data (STACK *sk)
                return NULL;
        }
        p7->type = OBJ_nid2obj(NID_pkcs7_data);
-       if (!(p7->d.data = ASN1_OCTET_STRING_new())) {
+       if (!(p7->d.data = M_ASN1_OCTET_STRING_new())) {
                PKCS12err(PKCS12_F_PKCS12_PACK_P7DATA, ERR_R_MALLOC_FAILURE);
                return NULL;
        }
@@ -168,7 +168,7 @@ PKCS7 *PKCS12_pack_p7encdata (int pbe_nid, const char *pass, int passlen,
        }
        X509_ALGOR_free(p7->d.encrypted->enc_data->algorithm);
        p7->d.encrypted->enc_data->algorithm = pbe;
-       ASN1_OCTET_STRING_free(p7->d.encrypted->enc_data->enc_data);
+       M_ASN1_OCTET_STRING_free(p7->d.encrypted->enc_data->enc_data);
        if (!(p7->d.encrypted->enc_data->enc_data =
        PKCS12_i2d_encrypt (pbe, i2d_PKCS12_SAFEBAG, pass, passlen,
                                 (char *)bags, 1))) {
@@ -200,7 +200,7 @@ X509_SIG *PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher,
        }
        X509_ALGOR_free(p8->algor);
        p8->algor = pbe;
-       ASN1_OCTET_STRING_free(p8->digest);
+       M_ASN1_OCTET_STRING_free(p8->digest);
        if (!(p8->digest = 
        PKCS12_i2d_encrypt (pbe, i2d_PKCS8_PRIV_KEY_INFO, pass, passlen,
                                                 (char *)p8inf, 0))) {
index 31c9782b77568e0148950eb639be284d7d3e08de..f559351d1834a47f762af8c9b6c57dc8743f7512 100644 (file)
@@ -73,11 +73,11 @@ int PKCS12_add_localkeyid (PKCS12_SAFEBAG *bag, unsigned char *name,
                return 0;
        }
        keyid->type = V_ASN1_OCTET_STRING;
-       if (!(oct = ASN1_OCTET_STRING_new())) {
+       if (!(oct = M_ASN1_OCTET_STRING_new())) {
                PKCS12err(PKCS12_F_PKCS12_ADD_LOCALKEYID, ERR_R_MALLOC_FAILURE);
                return 0;
        }
-       if (!ASN1_OCTET_STRING_set(oct, name, namelen)) {
+       if (!M_ASN1_OCTET_STRING_set(oct, name, namelen)) {
                PKCS12err(PKCS12_F_PKCS12_ADD_LOCALKEYID, ERR_R_MALLOC_FAILURE);
                return 0;
        }
@@ -115,11 +115,11 @@ int PKCS8_add_keyusage (PKCS8_PRIV_KEY_INFO *p8, int usage)
                return 0;
        }
        keyid->type = V_ASN1_BIT_STRING;
-       if (!(bstr = ASN1_BIT_STRING_new())) {
+       if (!(bstr = M_ASN1_BIT_STRING_new())) {
                PKCS12err(PKCS12_F_PKCS8_ADD_KEYUSAGE, ERR_R_MALLOC_FAILURE);
                return 0;
        }
-       if (!ASN1_BIT_STRING_set(bstr, &us_val, 1)) {
+       if (!M_ASN1_BIT_STRING_set(bstr, &us_val, 1)) {
                PKCS12err(PKCS12_F_PKCS8_ADD_KEYUSAGE, ERR_R_MALLOC_FAILURE);
                return 0;
        }
@@ -176,7 +176,7 @@ int PKCS12_add_friendlyname_uni (PKCS12_SAFEBAG *bag,
                return 0;
        }
        fname->type = V_ASN1_BMPSTRING;
-       if (!(bmp = ASN1_BMPSTRING_new())) {
+       if (!(bmp = M_ASN1_BMPSTRING_new())) {
                PKCS12err(PKCS12_F_PKCS12_ADD_FRIENDLYNAME_UNI,
                                                        ERR_R_MALLOC_FAILURE);
                return 0;
index d6eab92c83307da941294a9343be867150b2bf56..5a0abd6bae80eb078bf7ddb669a76cfcfea1d95f 100644 (file)
@@ -171,15 +171,15 @@ void PKCS12_BAGS_free (PKCS12_BAGS *a)
        switch (OBJ_obj2nid(a->type)) {
 
                case NID_x509Certificate:
-                       ASN1_OCTET_STRING_free (a->value.x509cert);
+                       M_ASN1_OCTET_STRING_free (a->value.x509cert);
                break;
 
                case NID_x509Crl:
-                       ASN1_OCTET_STRING_free (a->value.x509crl);
+                       M_ASN1_OCTET_STRING_free (a->value.x509crl);
                break;
 
                case NID_sdsiCertificate:
-                       ASN1_IA5STRING_free (a->value.sdsicert);
+                       M_ASN1_IA5STRING_free (a->value.sdsicert);
                break;
 
                default:
index d3d288e1874ee475d0320475a34bfa7d3f42c49a..4be44eac50601b41cfa65283acd747a961708d87 100644 (file)
@@ -155,7 +155,7 @@ ASN1_OCTET_STRING *PKCS12_i2d_encrypt (X509_ALGOR *algor, int (*i2d)(),
        ASN1_OCTET_STRING *oct;
        unsigned char *in, *p;
        int inlen;
-       if (!(oct = ASN1_OCTET_STRING_new ())) {
+       if (!(oct = M_ASN1_OCTET_STRING_new ())) {
                PKCS12err(PKCS12_F_PKCS12_I2D_ENCRYPT,ERR_R_MALLOC_FAILURE);
                return NULL;
        }
index dc6ab41db88a93b77e143a465c45e9e829aca682..d5d4884c82018d264bf38c4e6bddd4b107bd2320 100644 (file)
@@ -69,11 +69,11 @@ PKCS12 *PKCS12_init (int mode)
                PKCS12err(PKCS12_F_PKCS12_INIT,ERR_R_MALLOC_FAILURE);
                return NULL;
        }
-       if (!(pkcs12->version = ASN1_INTEGER_new ())) {
+       if (!(pkcs12->version = M_ASN1_INTEGER_new ())) {
                PKCS12err(PKCS12_F_PKCS12_INIT,ERR_R_MALLOC_FAILURE);
                return NULL;
        }
-       ASN1_INTEGER_set (pkcs12->version, 3);
+       ASN1_INTEGER_set(pkcs12->version, 3);
        if (!(pkcs12->authsafes = PKCS7_new())) {
                PKCS12err(PKCS12_F_PKCS12_INIT,ERR_R_MALLOC_FAILURE);
                return NULL;
@@ -82,7 +82,7 @@ PKCS12 *PKCS12_init (int mode)
        switch (mode) {
                case NID_pkcs7_data:
                        if (!(pkcs12->authsafes->d.data =
-                                ASN1_OCTET_STRING_new())) {
+                                M_ASN1_OCTET_STRING_new())) {
                        PKCS12err(PKCS12_F_PKCS12_INIT,ERR_R_MALLOC_FAILURE);
                        return NULL;
                }
index 767e1303da90eaf991509a58f4f1abbf07f7c05d..08a60556e090f58528bac38c9a9b453cb64e4d50 100644 (file)
@@ -139,16 +139,16 @@ static int parse_pk12 (PKCS12 *p12, const char *pass, int passlen,
                        sk_pop_free (asafes, PKCS7_free);
                        return 0;
                }
-               if (!parse_bags (bags, pass, passlen, pkey, cert, ca,
+               if (!parse_bags(bags, pass, passlen, pkey, cert, ca,
                                                         &keyid, &keymatch)) {
-                       sk_pop_free (bags, PKCS12_SAFEBAG_free);
-                       sk_pop_free (asafes, PKCS7_free);
+                       sk_pop_free(bags, PKCS12_SAFEBAG_free);
+                       sk_pop_free(asafes, PKCS7_free);
                        return 0;
                }
-               sk_pop_free (bags, PKCS12_SAFEBAG_free);
+               sk_pop_free(bags, PKCS12_SAFEBAG_free);
        }
-       sk_pop_free (asafes, PKCS7_free);
-       if (keyid) ASN1_OCTET_STRING_free (keyid);
+       sk_pop_free(asafes, PKCS7_free);
+       if (keyid) M_ASN1_OCTET_STRING_free(keyid);
        return 1;
 }
 
@@ -158,8 +158,8 @@ static int parse_bags (STACK *bags, const char *pass, int passlen,
                       ASN1_OCTET_STRING **keyid, char *keymatch)
 {
        int i;
-       for (i = 0; i < sk_num (bags); i++) {
-               if (!parse_bag ((PKCS12_SAFEBAG *)sk_value (bags, i),
+       for (i = 0; i < sk_num(bags); i++) {
+               if (!parse_bag((PKCS12_SAFEBAG *)sk_value (bags, i),
                         pass, passlen, pkey, cert, ca, keyid,
                                                         keymatch)) return 0;
        }
@@ -170,7 +170,7 @@ static int parse_bags (STACK *bags, const char *pass, int passlen,
 #define MATCH_CERT 0x2
 #define MATCH_ALL  0x3
 
-static int parse_bag (PKCS12_SAFEBAG *bag, const char *pass, int passlen,
+static int parse_bag(PKCS12_SAFEBAG *bag, const char *pass, int passlen,
                      EVP_PKEY **pkey, X509 **cert, STACK **ca,
                      ASN1_OCTET_STRING **keyid,
             char *keymatch)
@@ -187,9 +187,9 @@ static int parse_bag (PKCS12_SAFEBAG *bag, const char *pass, int passlen,
        /* Check for any local key id matching (if needed) */
        if (lkey && ((*keymatch & MATCH_ALL) != MATCH_ALL)) {
                if (*keyid) {
-                       if (ASN1_OCTET_STRING_cmp (*keyid, lkey)) lkey = NULL;
+                       if (M_ASN1_OCTET_STRING_cmp(*keyid, lkey)) lkey = NULL;
                } else {
-                       if (!(*keyid = ASN1_OCTET_STRING_dup (lkey))) {
+                       if (!(*keyid = M_ASN1_OCTET_STRING_dup(lkey))) {
                                PKCS12err(PKCS12_F_PARSE_BAGS,ERR_R_MALLOC_FAILURE);
                                return 0;
                    }
@@ -200,16 +200,16 @@ static int parse_bag (PKCS12_SAFEBAG *bag, const char *pass, int passlen,
        {
        case NID_keyBag:
                if (!lkey || !pkey) return 1;   
-               if (!(*pkey = EVP_PKCS82PKEY (bag->value.keybag))) return 0;
+               if (!(*pkey = EVP_PKCS82PKEY(bag->value.keybag))) return 0;
                *keymatch |= MATCH_KEY;
        break;
 
        case NID_pkcs8ShroudedKeyBag:
                if (!lkey || !pkey) return 1;   
-               if (!(p8 = M_PKCS12_decrypt_skey (bag, pass, passlen)))
+               if (!(p8 = M_PKCS12_decrypt_skey(bag, pass, passlen)))
                                return 0;
-               *pkey = EVP_PKCS82PKEY (p8);
-               PKCS8_PRIV_KEY_INFO_free (p8);
+               *pkey = EVP_PKCS82PKEY(p8);
+               PKCS8_PRIV_KEY_INFO_free(p8);
                if (!(*pkey)) return 0;
                *keymatch |= MATCH_KEY;
        break;
index 00a6695d9b71311e1f2a2981ca8e2a83294d42b7..014cb525a01ae0d3572a0a83e0cefdd2e7fa4232 100644 (file)
@@ -104,7 +104,7 @@ PKCS12 *PKCS12_new(void)
 void PKCS12_free (PKCS12 *a)
 {
        if (a == NULL) return;
-       ASN1_INTEGER_free (a->version);
+       M_ASN1_INTEGER_free(a->version);
        PKCS12_MAC_DATA_free (a->mac);
        PKCS7_free (a->authsafes);
        Free ((char *)a);
index f163d4cfaa856663accd3c8451d066fea407b96a..a427df105c692dcf0ebac3990304cb8c2eccac4c 100644 (file)
@@ -82,9 +82,9 @@ PKCS12_MAC_DATA *PKCS12_MAC_DATA_new(void)
        ASN1_CTX c;
        M_ASN1_New_Malloc(ret, PKCS12_MAC_DATA);
        ret->dinfo = X509_SIG_new();
-       ret->salt = ASN1_OCTET_STRING_new();
+       ret->salt = M_ASN1_OCTET_STRING_new();
        ret->iter = NULL;
-       return (ret);
+       return(ret);
        M_ASN1_New_Error(ASN1_F_PKCS12_MAC_DATA_NEW);
 }
 
@@ -94,9 +94,9 @@ PKCS12_MAC_DATA *d2i_PKCS12_MAC_DATA(PKCS12_MAC_DATA **a, unsigned char **pp,
        M_ASN1_D2I_vars(a,PKCS12_MAC_DATA *,PKCS12_MAC_DATA_new);
        M_ASN1_D2I_Init();
        M_ASN1_D2I_start_sequence();
-       M_ASN1_D2I_get (ret->dinfo, d2i_X509_SIG);
-       M_ASN1_D2I_get (ret->salt, d2i_ASN1_OCTET_STRING);
-       M_ASN1_D2I_get_opt (ret->iter, d2i_ASN1_INTEGER, V_ASN1_INTEGER);
+       M_ASN1_D2I_get(ret->dinfo, d2i_X509_SIG);
+       M_ASN1_D2I_get(ret->salt, d2i_ASN1_OCTET_STRING);
+       M_ASN1_D2I_get_opt(ret->iter, d2i_ASN1_INTEGER, V_ASN1_INTEGER);
        M_ASN1_D2I_Finish(a, PKCS12_MAC_DATA_free, ASN1_F_D2I_PKCS12_MAC_DATA);
 }
 
@@ -104,7 +104,7 @@ void PKCS12_MAC_DATA_free (PKCS12_MAC_DATA *a)
 {
        if (a == NULL) return;
        X509_SIG_free (a->dinfo);
-       ASN1_OCTET_STRING_free (a->salt);
-       ASN1_INTEGER_free (a->iter);
+       M_ASN1_OCTET_STRING_free(a->salt);
+       M_ASN1_INTEGER_free(a->iter);
        Free ((char *)a);
 }
index bac558d6b9a49a18fc9ea4a9da2cdf683c8e0a2b..3cb782fa6092c05a90766a969c48da69a358bae8 100644 (file)
@@ -131,7 +131,7 @@ int PKCS12_set_mac (PKCS12 *p12, const char *pass, int passlen,
                PKCS12err(PKCS12_F_PKCS12_SET_MAC,PKCS12_R_MAC_GENERATION_ERROR);
                return 0;
        }
-       if (!(ASN1_OCTET_STRING_set (p12->mac->dinfo->digest, mac, maclen))) {
+       if (!(M_ASN1_OCTET_STRING_set (p12->mac->dinfo->digest, mac, maclen))) {
                PKCS12err(PKCS12_F_PKCS12_SET_MAC,PKCS12_R_MAC_STRING_SET_ERROR);
                                                return 0;
        }
@@ -142,13 +142,13 @@ int PKCS12_set_mac (PKCS12 *p12, const char *pass, int passlen,
 int PKCS12_setup_mac (PKCS12 *p12, int iter, unsigned char *salt, int saltlen,
             EVP_MD *md_type)
 {
-       if (!(p12->mac = PKCS12_MAC_DATA_new ())) return PKCS12_ERROR;
+       if (!(p12->mac = PKCS12_MAC_DATA_new())) return PKCS12_ERROR;
        if (iter > 1) {
-               if(!(p12->mac->iter = ASN1_INTEGER_new())) {
+               if(!(p12->mac->iter = M_ASN1_INTEGER_new())) {
                        PKCS12err(PKCS12_F_PKCS12_SETUP_MAC, ERR_R_MALLOC_FAILURE);
                        return 0;
                }
-               ASN1_INTEGER_set (p12->mac->iter, iter);
+               ASN1_INTEGER_set(p12->mac->iter, iter);
        }
        if (!saltlen) saltlen = PKCS12_SALT_LEN;
        p12->mac->salt->length = saltlen;
index af66511ebacec7f7e94bbeb3bfe1801ab898514c..a4cf9b4021df1209064f12571d9a0b7b8dc8884b 100644 (file)
@@ -204,7 +204,7 @@ BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio)
                                Free(tmp);
                                goto err;
                                }
-                       ASN1_OCTET_STRING_set(ri->enc_key,tmp,jj);
+                       M_ASN1_OCTET_STRING_set(ri->enc_key,tmp,jj);
                        }
                Free(tmp);
                memset(key, 0, keylen);
@@ -364,7 +364,7 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
                        ri=sk_PKCS7_RECIP_INFO_value(rsk,i);
                        if(!X509_NAME_cmp(ri->issuer_and_serial->issuer,
                                        pcert->cert_info->issuer) &&
-                            !ASN1_INTEGER_cmp(pcert->cert_info->serialNumber,
+                            !M_ASN1_INTEGER_cmp(pcert->cert_info->serialNumber,
                                        ri->issuer_and_serial->serial)) break;
                        ri=NULL;
                }
@@ -383,8 +383,8 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
                        }
 
                jj=EVP_PKEY_decrypt((unsigned char *)tmp,
-                       ASN1_STRING_data(ri->enc_key),
-                       ASN1_STRING_length(ri->enc_key),
+                       M_ASN1_STRING_data(ri->enc_key),
+                       M_ASN1_STRING_length(ri->enc_key),
                        pkey);
                if (jj <= 0)
                        {
@@ -480,12 +480,12 @@ int PKCS7_dataFinal(PKCS7 *p7, BIO *bio)
        case NID_pkcs7_signedAndEnveloped:
                /* XXXXXXXXXXXXXXXX */
                si_sk=p7->d.signed_and_enveloped->signer_info;
-               os=ASN1_OCTET_STRING_new();
+               os=M_ASN1_OCTET_STRING_new();
                p7->d.signed_and_enveloped->enc_data->enc_data=os;
                break;
        case NID_pkcs7_enveloped:
                /* XXXXXXXXXXXXXXXX */
-               os=ASN1_OCTET_STRING_new();
+               os=M_ASN1_OCTET_STRING_new();
                p7->d.enveloped->enc_data->enc_data=os;
                break;
        case NID_pkcs7_signed:
@@ -493,7 +493,7 @@ int PKCS7_dataFinal(PKCS7 *p7, BIO *bio)
                os=p7->d.sign->contents->d.data;
                /* If detached data then the content is excluded */
                if(p7->detached) {
-                       ASN1_OCTET_STRING_free(os);
+                       M_ASN1_OCTET_STRING_free(os);
                        p7->d.sign->contents->d.data = NULL;
                }
                break;
@@ -564,8 +564,8 @@ int PKCS7_dataFinal(PKCS7 *p7, BIO *bio)
                                /* Add digest */
                                md_tmp=EVP_MD_CTX_type(&ctx_tmp);
                                EVP_DigestFinal(&ctx_tmp,md_data,&md_len);
-                               digest=ASN1_OCTET_STRING_new();
-                               ASN1_OCTET_STRING_set(digest,md_data,md_len);
+                               digest=M_ASN1_OCTET_STRING_new();
+                               M_ASN1_OCTET_STRING_set(digest,md_data,md_len);
                                PKCS7_add_signed_attribute(si,
                                        NID_pkcs9_messageDigest,
                                        V_ASN1_OCTET_STRING,digest);
@@ -620,7 +620,7 @@ int PKCS7_dataFinal(PKCS7 *p7, BIO *bio)
                os->data = (unsigned char *)buf_mem->data;
                os->length = buf_mem->length;
 #if 0
-               ASN1_OCTET_STRING_set(os,
+               M_ASN1_OCTET_STRING_set(os,
                        (unsigned char *)buf_mem->data,buf_mem->length);
 #endif
                }
index 22cbb174f8236b19a1fa68f7929318fa58106da7..312a5ed064b9dd71e9435576a5b2323377fc7e8c 100644 (file)
@@ -157,7 +157,7 @@ int PKCS7_set_type(PKCS7 *p7, int type)
                break;
        case NID_pkcs7_data:
                p7->type=obj;
-               if ((p7->d.data=ASN1_OCTET_STRING_new()) == NULL)
+               if ((p7->d.data=M_ASN1_OCTET_STRING_new()) == NULL)
                        goto err;
                break;
        case NID_pkcs7_signedAndEnveloped:
@@ -299,9 +299,9 @@ int PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey,
 
        /* because ASN1_INTEGER_set is used to set a 'long' we will do
         * things the ugly way. */
-       ASN1_INTEGER_free(p7i->issuer_and_serial->serial);
+       M_ASN1_INTEGER_free(p7i->issuer_and_serial->serial);
        p7i->issuer_and_serial->serial=
-               ASN1_INTEGER_dup(X509_get_serialNumber(x509));
+               M_ASN1_INTEGER_dup(X509_get_serialNumber(x509));
 
        /* lets keep the pkey around for a while */
        CRYPTO_add(&pkey->references,1,CRYPTO_LOCK_EVP_PKEY);
@@ -400,9 +400,9 @@ int PKCS7_RECIP_INFO_set(PKCS7_RECIP_INFO *p7i, X509 *x509)
        X509_NAME_set(&p7i->issuer_and_serial->issuer,
                X509_get_issuer_name(x509));
 
-       ASN1_INTEGER_free(p7i->issuer_and_serial->serial);
+       M_ASN1_INTEGER_free(p7i->issuer_and_serial->serial);
        p7i->issuer_and_serial->serial=
-               ASN1_INTEGER_dup(X509_get_serialNumber(x509));
+               M_ASN1_INTEGER_dup(X509_get_serialNumber(x509));
 
        X509_ALGOR_free(p7i->key_enc_algor);
        p7i->key_enc_algor=(X509_ALGOR *)ASN1_dup(i2d_X509_ALGOR,
index 73b8b0c7ad69c9ca37a371d48a1e7a97c8811897..61efb0b00fd71153f5a16375333dd4a48a09a3cb 100644 (file)
@@ -136,7 +136,7 @@ int RSA_verify_ASN1_OCTET_STRING(int dtype, unsigned char *m,
        else
                ret=1;
 err:
-       if (sig != NULL) ASN1_OCTET_STRING_free(sig);
+       if (sig != NULL) M_ASN1_OCTET_STRING_free(sig);
        memset(s,0,(unsigned int)siglen);
        Free(s);
        return(ret);
index 6213ec2f8d90acc7a66b80285fbb4032d6c02a28..0b0f1605da0d3abf54670c7bb1d930904ab815ab 100644 (file)
@@ -69,7 +69,7 @@ int X509_issuer_and_serial_cmp(X509 *a, X509 *b)
 
        ai=a->cert_info;
        bi=b->cert_info;
-       i=ASN1_INTEGER_cmp(ai->serialNumber,bi->serialNumber);
+       i=M_ASN1_INTEGER_cmp(ai->serialNumber,bi->serialNumber);
        if (i) return(i);
        return(X509_NAME_cmp(ai->issuer,bi->issuer));
        }
index bb4697ae60d43d95d490ad3b8b038c4e70174488..db051033d9bfc80708db635a92bcad43362a5b88 100644 (file)
@@ -82,7 +82,7 @@ X509 *X509_REQ_to_X509(X509_REQ *r, int days, EVP_PKEY *pkey)
 
        if (sk_X509_ATTRIBUTE_num(r->req_info->attributes) != 0)
                {
-               if ((xi->version=ASN1_INTEGER_new()) == NULL) goto err;
+               if ((xi->version=M_ASN1_INTEGER_new()) == NULL) goto err;
                if (!ASN1_INTEGER_set(xi->version,2)) goto err;
 /*             xi->extensions=ri->attributes; <- bad, should not ever be done
                ri->attributes=NULL; */
index 5a6f7b414f448f7cdd2e99ba0421e91681e0eea2..add842d17a94b4902f6f74fe31e6def0dfb6f526 100644 (file)
@@ -68,7 +68,7 @@ int X509_set_version(X509 *x, long version)
        if (x == NULL) return(0);
        if (x->cert_info->version == NULL)
                {
-               if ((x->cert_info->version=ASN1_INTEGER_new()) == NULL)
+               if ((x->cert_info->version=M_ASN1_INTEGER_new()) == NULL)
                        return(0);
                }
        return(ASN1_INTEGER_set(x->cert_info->version,version));
@@ -82,10 +82,10 @@ int X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial)
        in=x->cert_info->serialNumber;
        if (in != serial)
                {
-               in=ASN1_INTEGER_dup(serial);
+               in=M_ASN1_INTEGER_dup(serial);
                if (in != NULL)
                        {
-                       ASN1_INTEGER_free(x->cert_info->serialNumber);
+                       M_ASN1_INTEGER_free(x->cert_info->serialNumber);
                        x->cert_info->serialNumber=in;
                        }
                }
@@ -112,10 +112,10 @@ int X509_set_notBefore(X509 *x, ASN1_UTCTIME *tm)
        in=x->cert_info->validity->notBefore;
        if (in != tm)
                {
-               in=ASN1_UTCTIME_dup(tm);
+               in=M_ASN1_UTCTIME_dup(tm);
                if (in != NULL)
                        {
-                       ASN1_UTCTIME_free(x->cert_info->validity->notBefore);
+                       M_ASN1_UTCTIME_free(x->cert_info->validity->notBefore);
                        x->cert_info->validity->notBefore=in;
                        }
                }
@@ -130,10 +130,10 @@ int X509_set_notAfter(X509 *x, ASN1_UTCTIME *tm)
        in=x->cert_info->validity->notAfter;
        if (in != tm)
                {
-               in=ASN1_UTCTIME_dup(tm);
+               in=M_ASN1_UTCTIME_dup(tm);
                if (in != NULL)
                        {
-                       ASN1_UTCTIME_free(x->cert_info->validity->notAfter);
+                       M_ASN1_UTCTIME_free(x->cert_info->validity->notAfter);
                        x->cert_info->validity->notAfter=in;
                        }
                }
index dd2f9f1b177d8a20fb800220574ccfef54a81eb9..5721f78510f4dc61533cf08a8f4db5e5e17dc43c 100644 (file)
@@ -242,7 +242,7 @@ int X509_EXTENSION_set_data(X509_EXTENSION *ex, ASN1_OCTET_STRING *data)
        int i;
 
        if (ex == NULL) return(0);
-       i=ASN1_OCTET_STRING_set(ex->value,data->data,data->length);
+       i=M_ASN1_OCTET_STRING_set(ex->value,data->data,data->length);
        if (!i) return(0);
        return(1);
        }
index bb22bee92f37ae18f23c2cf8096f10e2a8f5a0dd..a19e59615e9c80b81deddb49f48b3454990c0f1b 100644 (file)
@@ -358,6 +358,24 @@ v3_prn.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
 v3_prn.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 v3_prn.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
 v3_prn.o: ../../include/openssl/x509v3.h ../cryptlib.h
+v3_purp.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
+v3_purp.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
+v3_purp.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
+v3_purp.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
+v3_purp.o: ../../include/openssl/des.h ../../include/openssl/dh.h
+v3_purp.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
+v3_purp.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
+v3_purp.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
+v3_purp.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
+v3_purp.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
+v3_purp.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
+v3_purp.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
+v3_purp.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
+v3_purp.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
+v3_purp.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
+v3_purp.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
+v3_purp.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
+v3_purp.o: ../../include/openssl/x509v3.h ../cryptlib.h
 v3_skey.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
 v3_skey.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
 v3_skey.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
diff --git a/crypto/x509v3/README b/crypto/x509v3/README
deleted file mode 100644 (file)
index 3b2cc04..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
-
-This is ***VERY*** new experimental code and is likely to change
-considerably or vanish altogether.
index 4099e6019e3ca53189d4ef8cfef70ee7efa6d294..de2a577ac10244aa21626b138bf8f48f48cc5e80 100644 (file)
@@ -129,9 +129,9 @@ AUTHORITY_KEYID *d2i_AUTHORITY_KEYID(AUTHORITY_KEYID **a, unsigned char **pp,
 void AUTHORITY_KEYID_free(AUTHORITY_KEYID *a)
 {
        if (a == NULL) return;
-       ASN1_OCTET_STRING_free(a->keyid);
+       M_ASN1_OCTET_STRING_free(a->keyid);
        sk_GENERAL_NAME_pop_free(a->issuer, GENERAL_NAME_free);
-       ASN1_INTEGER_free (a->serial);
+       M_ASN1_INTEGER_free (a->serial);
        Free ((char *)a);
 }
 
@@ -214,7 +214,7 @@ if(keyid) {
 
 if((issuer && !ikeyid) || (issuer == 2)) {
        isname = X509_NAME_dup(X509_get_issuer_name(cert));
-       serial = ASN1_INTEGER_dup(X509_get_serialNumber(cert));
+       serial = M_ASN1_INTEGER_dup(X509_get_serialNumber(cert));
        if(!isname || !serial) {
                X509V3err(X509V3_F_V2I_AUTHORITY_KEYID,X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS);
                goto err;
@@ -241,8 +241,8 @@ return akeyid;
 
 err:
 X509_NAME_free(isname);
-ASN1_INTEGER_free(serial);
-ASN1_OCTET_STRING_free(ikeyid);
+M_ASN1_INTEGER_free(serial);
+M_ASN1_OCTET_STRING_free(ikeyid);
 return NULL;
 
 }
index b5e1f8af960059fc45d69492a4172cc8993115a0..a530be2165b9bb02499832957b5e55e4f1d652c8 100644 (file)
@@ -273,7 +273,7 @@ static int copy_email(X509V3_CTX *ctx, STACK_OF(GENERAL_NAME) *gens)
        while((i = X509_NAME_get_index_by_NID(nm,
                                         NID_pkcs9_emailAddress, i)) > 0) {
                ne = X509_NAME_get_entry(nm, i);
-               email = ASN1_IA5STRING_dup(X509_NAME_ENTRY_get_data(ne));
+               email = M_ASN1_IA5STRING_dup(X509_NAME_ENTRY_get_data(ne));
                if(!email || !(gen = GENERAL_NAME_new())) {
                        X509V3err(X509V3_F_COPY_EMAIL,ERR_R_MALLOC_FAILURE);
                        goto err;
@@ -293,7 +293,7 @@ static int copy_email(X509V3_CTX *ctx, STACK_OF(GENERAL_NAME) *gens)
                
        err:
        GENERAL_NAME_free(gen);
-       ASN1_IA5STRING_free(email);
+       M_ASN1_IA5STRING_free(email);
        return 0;
        
 }
@@ -371,7 +371,7 @@ if(!name_cmp(name, "email")) {
                goto err;
        }
        ip[0] = i1; ip[1] = i2 ; ip[2] = i3 ; ip[3] = i4;
-       if(!(gen->d.ip = ASN1_OCTET_STRING_new()) ||
+       if(!(gen->d.ip = M_ASN1_OCTET_STRING_new()) ||
                !ASN1_STRING_set(gen->d.ip, ip, 4)) {
                        X509V3err(X509V3_F_V2I_GENERAL_NAME,ERR_R_MALLOC_FAILURE);
                        goto err;
@@ -384,7 +384,7 @@ if(!name_cmp(name, "email")) {
 }
 
 if(is_string) {
-       if(!(gen->d.ia5 = ASN1_IA5STRING_new()) ||
+       if(!(gen->d.ia5 = M_ASN1_IA5STRING_new()) ||
                      !ASN1_STRING_set(gen->d.ia5, (unsigned char*)value,
                                       strlen(value))) {
                X509V3err(X509V3_F_V2I_GENERAL_NAME,ERR_R_MALLOC_FAILURE);
index de2f855c35f652e570bf21c3cf51a86c66c44073..9aada0d8808206a01ce36c740c60280efdcee8d6 100644 (file)
@@ -122,7 +122,7 @@ BASIC_CONSTRAINTS *d2i_BASIC_CONSTRAINTS(BASIC_CONSTRAINTS **a,
 void BASIC_CONSTRAINTS_free(BASIC_CONSTRAINTS *a)
 {
        if (a == NULL) return;
-       ASN1_INTEGER_free (a->pathlen);
+       M_ASN1_INTEGER_free (a->pathlen);
        Free ((char *)a);
 }
 
index 9828ba15b3d3f815ed409e89666455a331e46347..0e1167d05cd236de11350e11196f08eb52dcb904 100644 (file)
@@ -61,7 +61,6 @@
 #include <openssl/conf.h>
 #include <openssl/x509v3.h>
 
-static ASN1_BIT_STRING *asn1_bit_string_new(void);
 static ASN1_BIT_STRING *v2i_ASN1_BIT_STRING(X509V3_EXT_METHOD *method,
                                X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval);
 static STACK_OF(CONF_VALUE) *i2v_ASN1_BIT_STRING(X509V3_EXT_METHOD *method,
@@ -97,11 +96,6 @@ static BIT_STRING_BITNAME key_usage_type_table[] = {
 X509V3_EXT_METHOD v3_nscert = EXT_BITSTRING(NID_netscape_cert_type, ns_cert_type_table);
 X509V3_EXT_METHOD v3_key_usage = EXT_BITSTRING(NID_key_usage, key_usage_type_table);
 
-static ASN1_BIT_STRING *asn1_bit_string_new(void)
-{
-       return ASN1_BIT_STRING_new();
-}
-
 static STACK_OF(CONF_VALUE) *i2v_ASN1_BIT_STRING(X509V3_EXT_METHOD *method,
             ASN1_BIT_STRING *bits, STACK_OF(CONF_VALUE) *ret)
 {
@@ -120,7 +114,7 @@ static ASN1_BIT_STRING *v2i_ASN1_BIT_STRING(X509V3_EXT_METHOD *method,
        ASN1_BIT_STRING *bs;
        int i;
        BIT_STRING_BITNAME *bnam;
-       if(!(bs = ASN1_BIT_STRING_new())) {
+       if(!(bs = M_ASN1_BIT_STRING_new())) {
                X509V3err(X509V3_F_V2I_ASN1_BIT_STRING,ERR_R_MALLOC_FAILURE);
                return NULL;
        }
@@ -137,7 +131,7 @@ static ASN1_BIT_STRING *v2i_ASN1_BIT_STRING(X509V3_EXT_METHOD *method,
                        X509V3err(X509V3_F_V2I_ASN1_BIT_STRING,
                                        X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT);
                        X509V3_conf_err(val);
-                       ASN1_BIT_STRING_free(bs);
+                       M_ASN1_BIT_STRING_free(bs);
                        return NULL;
                }
        }
index d092fe99fe7f49c4c792e0c318a464478be724b2..b2f03010cce7f7bc7d3fa9d5e28693f099f3667c 100644 (file)
@@ -170,13 +170,13 @@ static X509_EXTENSION *do_ext_i2d(X509V3_EXT_METHOD *method, int ext_nid,
        if(!(ext_der = Malloc(ext_len))) goto merr;
        p = ext_der;
        method->i2d(ext_struc, &p);
-       if(!(ext_oct = ASN1_OCTET_STRING_new())) goto merr;
+       if(!(ext_oct = M_ASN1_OCTET_STRING_new())) goto merr;
        ext_oct->data = ext_der;
        ext_oct->length = ext_len;
        
        ext = X509_EXTENSION_create_by_NID(NULL, ext_nid, crit, ext_oct);
        if(!ext) goto merr;
-       ASN1_OCTET_STRING_free(ext_oct);
+       M_ASN1_OCTET_STRING_free(ext_oct);
 
        return ext;
 
@@ -241,7 +241,7 @@ if(!(ext_der = string_to_hex(value, &ext_len))) {
        goto err;
 }
 
-if(!(oct = ASN1_OCTET_STRING_new())) {
+if(!(oct = M_ASN1_OCTET_STRING_new())) {
        X509V3err(X509V3_F_V3_GENERIC_EXTENSION,ERR_R_MALLOC_FAILURE);
        goto err;
 }
@@ -254,7 +254,7 @@ extension = X509_EXTENSION_create_by_OBJ(NULL, obj, crit, oct);
 
 err:
 ASN1_OBJECT_free(obj);
-ASN1_OCTET_STRING_free(oct);
+M_ASN1_OCTET_STRING_free(oct);
 if(ext_der) Free(ext_der);
 return extension;
 }
index b4d4883545182380e275d258e1f1e7a014509ef3..466713b50d91340be3e11fa385b73b8d600e3fa2 100644 (file)
@@ -169,7 +169,7 @@ static POLICYINFO *policy_section(X509V3_CTX *ctx,
                        if(!sk_POLICYQUALINFO_push(pol->qualifiers, qual))
                                                                 goto merr;
                        qual->pqualid = OBJ_nid2obj(NID_id_qt_cps);
-                       qual->d.cpsuri = ASN1_IA5STRING_new();
+                       qual->d.cpsuri = M_ASN1_IA5STRING_new();
                        if(!ASN1_STRING_set(qual->d.cpsuri, cnf->value,
                                                 strlen(cnf->value))) goto merr;
                } else if(!name_cmp(cnf->name, "userNotice")) {
@@ -229,7 +229,7 @@ static POLICYQUALINFO *notice_section(X509V3_CTX *ctx,
        for(i = 0; i < sk_CONF_VALUE_num(unot); i++) {
                cnf = sk_CONF_VALUE_value(unot, i);
                if(!strcmp(cnf->name, "explicitText")) {
-                       not->exptext = ASN1_VISIBLESTRING_new();
+                       not->exptext = M_ASN1_VISIBLESTRING_new();
                        if(!ASN1_STRING_set(not->exptext, cnf->value,
                                                 strlen(cnf->value))) goto merr;
                } else if(!strcmp(cnf->name, "organization")) {
@@ -238,8 +238,8 @@ static POLICYQUALINFO *notice_section(X509V3_CTX *ctx,
                                if(!(nref = NOTICEREF_new())) goto merr;
                                not->noticeref = nref;
                        } else nref = not->noticeref;
-                       if(ia5org) nref->organization = ASN1_IA5STRING_new();
-                       else nref->organization = ASN1_VISIBLESTRING_new();
+                       if(ia5org) nref->organization = M_ASN1_IA5STRING_new();
+                       else nref->organization = M_ASN1_VISIBLESTRING_new();
                        if(!ASN1_STRING_set(nref->organization, cnf->value,
                                                 strlen(cnf->value))) goto merr;
                } else if(!strcmp(cnf->name, "noticeNumbers")) {
@@ -538,7 +538,7 @@ void POLICYQUALINFO_free(POLICYQUALINFO *a)
        if (a == NULL) return;
        switch(OBJ_obj2nid(a->pqualid)) {
                case NID_id_qt_cps:
-               ASN1_IA5STRING_free(a->d.cpsuri);
+               M_ASN1_IA5STRING_free(a->d.cpsuri);
                break;
 
                case NID_id_qt_unotice:
@@ -596,7 +596,7 @@ void USERNOTICE_free(USERNOTICE *a)
 {
        if (a == NULL) return;
        NOTICEREF_free(a->noticeref);
-       DISPLAYTEXT_free(a->exptext);
+       M_DISPLAYTEXT_free(a->exptext);
        Free (a);
 }
 
@@ -646,7 +646,7 @@ NOTICEREF *d2i_NOTICEREF(NOTICEREF **a, unsigned char **pp,long length)
 void NOTICEREF_free(NOTICEREF *a)
 {
        if (a == NULL) return;
-       DISPLAYTEXT_free(a->organization);
+       M_DISPLAYTEXT_free(a->organization);
        sk_pop_free(a->noticenos, ASN1_STRING_free);
        Free (a);
 }
index 897ffb63e4abd81dfa0358d2d1e6cc616bf7435c..d0cbb949fa561db55055b2487a040e473c2adde9 100644 (file)
@@ -211,7 +211,7 @@ void DIST_POINT_free(DIST_POINT *a)
 {
        if (a == NULL) return;
        DIST_POINT_NAME_free(a->distpoint);
-       ASN1_BIT_STRING_free(a->reasons);
+       M_ASN1_BIT_STRING_free(a->reasons);
        sk_GENERAL_NAME_pop_free(a->CRLissuer, GENERAL_NAME_free);
        Free ((char *)a);
 }
index db423548ff0c17a2a13ea5c687d7291894a2ead2..f927110e15f14fb1f77474dc04df535b044cd503 100644 (file)
@@ -60,8 +60,6 @@
 #include "cryptlib.h"
 #include <openssl/x509v3.h>
 
-static ASN1_ENUMERATED *asn1_enumerated_new(void);
-
 static ENUMERATED_NAMES crl_reasons[] = {
 {0, "Unspecified", "unspecified"},
 {1, "Key Compromise", "keyCompromise"},
@@ -76,8 +74,8 @@ static ENUMERATED_NAMES crl_reasons[] = {
 
 X509V3_EXT_METHOD v3_crl_reason = { 
 NID_crl_reason, 0,
-(X509V3_EXT_NEW)asn1_enumerated_new,
-(X509V3_EXT_FREE)ASN1_STRING_free,
+(X509V3_EXT_NEW)ASN1_ENUMERATED_new,
+(X509V3_EXT_FREE)ASN1_ENUMERATED_free,
 (X509V3_EXT_D2I)d2i_ASN1_ENUMERATED,
 (X509V3_EXT_I2D)i2d_ASN1_ENUMERATED,
 (X509V3_EXT_I2S)i2s_ASN1_ENUMERATED_TABLE,
@@ -85,11 +83,6 @@ NID_crl_reason, 0,
 NULL, NULL, NULL, NULL, crl_reasons};
 
 
-static ASN1_ENUMERATED *asn1_enumerated_new(void)
-{
-       return ASN1_ENUMERATED_new();
-}
-
 char *i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *method,
             ASN1_ENUMERATED *e)
 {
index af716232f8bb0fc038fa7d6eefc8d950f17c7502..5e580e5d5e7a44141009c5abaceeb770e0bba93d 100644 (file)
@@ -186,7 +186,7 @@ void GENERAL_NAME_free(GENERAL_NAME *a)
                case GEN_DNS:
                case GEN_URI:
 
-               ASN1_IA5STRING_free(a->d.ia5);
+               M_ASN1_IA5STRING_free(a->d.ia5);
                break;
 
                case GEN_DIRNAME:
@@ -194,7 +194,7 @@ void GENERAL_NAME_free(GENERAL_NAME *a)
                break;
 
                case GEN_IPADD:
-               ASN1_OCTET_STRING_free(a->d.ip);
+               M_ASN1_OCTET_STRING_free(a->d.ip);
                break;
        
                case GEN_RID:
index 3446c5cd6a60442999cbbcf2b08f91503b4ff6a6..43dfd04f783b90f0c57d4ea18737bd32f4396a27 100644 (file)
@@ -63,7 +63,6 @@
 #include <openssl/conf.h>
 #include <openssl/x509v3.h>
 
-static ASN1_IA5STRING *ia5string_new(void);
 static char *i2s_ASN1_IA5STRING(X509V3_EXT_METHOD *method, ASN1_IA5STRING *ia5);
 static ASN1_IA5STRING *s2i_ASN1_IA5STRING(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, char *str);
 X509V3_EXT_METHOD v3_ns_ia5_list[] = { 
@@ -78,11 +77,6 @@ EXT_END
 };
 
 
-static ASN1_IA5STRING *ia5string_new(void)
-{
-       return ASN1_IA5STRING_new();
-}
-
 static char *i2s_ASN1_IA5STRING(X509V3_EXT_METHOD *method,
             ASN1_IA5STRING *ia5)
 {
@@ -102,10 +96,10 @@ static ASN1_IA5STRING *s2i_ASN1_IA5STRING(X509V3_EXT_METHOD *method,
                X509V3err(X509V3_F_S2I_ASN1_IA5STRING,X509V3_R_INVALID_NULL_ARGUMENT);
                return NULL;
        }
-       if(!(ia5 = ASN1_IA5STRING_new())) goto err;
+       if(!(ia5 = M_ASN1_IA5STRING_new())) goto err;
        if(!ASN1_STRING_set((ASN1_STRING *)ia5, (unsigned char*)str,
                            strlen(str))) {
-               ASN1_IA5STRING_free(ia5);
+               M_ASN1_IA5STRING_free(ia5);
                goto err;
        }
        return ia5;
index 637dd5e1288bfc7fd1a50e6e6bc306845aaf427d..a2edfe5463906045378f4d44596ee241a6a20095 100644 (file)
 #include "cryptlib.h"
 #include <openssl/x509v3.h>
 
-static ASN1_INTEGER *asn1_integer_new(void);
-
 X509V3_EXT_METHOD v3_crl_num = { 
 NID_crl_number, 0,
-(X509V3_EXT_NEW)asn1_integer_new,
-(X509V3_EXT_FREE)ASN1_STRING_free,
+(X509V3_EXT_NEW)ASN1_INTEGER_new,
+(X509V3_EXT_FREE)ASN1_INTEGER_free,
 (X509V3_EXT_D2I)d2i_ASN1_INTEGER,
 (X509V3_EXT_I2D)i2d_ASN1_INTEGER,
 (X509V3_EXT_I2S)i2s_ASN1_INTEGER,
 (X509V3_EXT_S2I)NULL,
 NULL, NULL, NULL, NULL, NULL};
 
-
-static ASN1_INTEGER *asn1_integer_new(void)
-{
-       return ASN1_INTEGER_new();
-}
index c13e7d8f45bd3882a579b084c572ba75a9a87dfa..6b61e61a1404e34c8795369772482767dc78481b 100644 (file)
@@ -119,8 +119,8 @@ PKEY_USAGE_PERIOD *d2i_PKEY_USAGE_PERIOD(PKEY_USAGE_PERIOD **a,
 void PKEY_USAGE_PERIOD_free(PKEY_USAGE_PERIOD *a)
 {
        if (a == NULL) return;
-       ASN1_GENERALIZEDTIME_free(a->notBefore);
-       ASN1_GENERALIZEDTIME_free(a->notAfter);
+       M_ASN1_GENERALIZEDTIME_free(a->notBefore);
+       M_ASN1_GENERALIZEDTIME_free(a->notAfter);
        Free ((char *)a);
 }
 
index fb3e36014d673c06c77c5b6b3a8ec0fb692034d6..939845fa8f8dcea82d68a04165eeb3dfc65f3c45 100644 (file)
 #include "cryptlib.h"
 #include <openssl/x509v3.h>
 
-static ASN1_OCTET_STRING *octet_string_new(void);
 static ASN1_OCTET_STRING *s2i_skey_id(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, char *str);
 X509V3_EXT_METHOD v3_skey_id = { 
 NID_subject_key_identifier, 0,
-(X509V3_EXT_NEW)octet_string_new,
-(X509V3_EXT_FREE)ASN1_STRING_free,
+(X509V3_EXT_NEW)ASN1_OCTET_STRING_new,
+(X509V3_EXT_FREE)ASN1_OCTET_STRING_free,
 (X509V3_EXT_D2I)d2i_ASN1_OCTET_STRING,
 (X509V3_EXT_I2D)i2d_ASN1_OCTET_STRING,
 (X509V3_EXT_I2S)i2s_ASN1_OCTET_STRING,
 (X509V3_EXT_S2I)s2i_skey_id,
 NULL, NULL, NULL, NULL, NULL};
 
-
-static ASN1_OCTET_STRING *octet_string_new(void)
-{
-       return ASN1_OCTET_STRING_new();
-}
-
 char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method,
             ASN1_OCTET_STRING *oct)
 {
@@ -91,13 +84,13 @@ ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method,
        ASN1_OCTET_STRING *oct;
        long length;
 
-       if(!(oct = ASN1_OCTET_STRING_new())) {
+       if(!(oct = M_ASN1_OCTET_STRING_new())) {
                X509V3err(X509V3_F_S2I_ASN1_OCTET_STRING,ERR_R_MALLOC_FAILURE);
                return NULL;
        }
 
        if(!(oct->data = string_to_hex(str, &length))) {
-               ASN1_OCTET_STRING_free(oct);
+               M_ASN1_OCTET_STRING_free(oct);
                return NULL;
        }
 
@@ -118,7 +111,7 @@ static ASN1_OCTET_STRING *s2i_skey_id(X509V3_EXT_METHOD *method,
 
        if(strcmp(str, "hash")) return s2i_ASN1_OCTET_STRING(method, ctx, str);
 
-       if(!(oct = ASN1_OCTET_STRING_new())) {
+       if(!(oct = M_ASN1_OCTET_STRING_new())) {
                X509V3err(X509V3_F_S2I_S2I_SKEY_ID,ERR_R_MALLOC_FAILURE);
                return NULL;
        }
@@ -143,7 +136,7 @@ static ASN1_OCTET_STRING *s2i_skey_id(X509V3_EXT_METHOD *method,
        EVP_DigestUpdate(&md, pk->data, pk->length);
        EVP_DigestFinal(&md, pkey_dig, &diglen);
 
-       if(!ASN1_OCTET_STRING_set(oct, pkey_dig, diglen)) {
+       if(!M_ASN1_OCTET_STRING_set(oct, pkey_dig, diglen)) {
                X509V3err(X509V3_F_S2I_S2I_SKEY_ID,ERR_R_MALLOC_FAILURE);
                goto err;
        }
@@ -151,6 +144,6 @@ static ASN1_OCTET_STRING *s2i_skey_id(X509V3_EXT_METHOD *method,
        return oct;
        
        err:
-       ASN1_OCTET_STRING_free(oct);
+       M_ASN1_OCTET_STRING_free(oct);
        return NULL;
 }
index 0687bb4e3d0f7d6814dbb3094cc4511fe03766b2..20ba8ac8d6bbca145008576bfe216bf4c858acee 100644 (file)
@@ -111,7 +111,7 @@ SXNET *SXNET_new(void)
        SXNET *ret=NULL;
        ASN1_CTX c;
        M_ASN1_New_Malloc(ret, SXNET);
-       M_ASN1_New(ret->version,ASN1_INTEGER_new);
+       M_ASN1_New(ret->version,M_ASN1_INTEGER_new);
        M_ASN1_New(ret->ids,sk_SXNETID_new_null);
        return (ret);
        M_ASN1_New_Error(ASN1_F_SXNET_NEW);
@@ -130,7 +130,7 @@ SXNET *d2i_SXNET(SXNET **a, unsigned char **pp, long length)
 void SXNET_free(SXNET *a)
 {
        if (a == NULL) return;
-       ASN1_INTEGER_free(a->version);
+       M_ASN1_INTEGER_free(a->version);
        sk_SXNETID_pop_free(a->ids, SXNETID_free);
        Free (a);
 }
@@ -156,7 +156,7 @@ SXNETID *SXNETID_new(void)
        ASN1_CTX c;
        M_ASN1_New_Malloc(ret, SXNETID);
        ret->zone = NULL;
-       M_ASN1_New(ret->user,ASN1_OCTET_STRING_new);
+       M_ASN1_New(ret->user,M_ASN1_OCTET_STRING_new);
        return (ret);
        M_ASN1_New_Error(ASN1_F_SXNETID_NEW);
 }
@@ -174,8 +174,8 @@ SXNETID *d2i_SXNETID(SXNETID **a, unsigned char **pp, long length)
 void SXNETID_free(SXNETID *a)
 {
        if (a == NULL) return;
-       ASN1_INTEGER_free(a->zone);
-       ASN1_OCTET_STRING_free(a->user);
+       M_ASN1_INTEGER_free(a->zone);
+       M_ASN1_OCTET_STRING_free(a->user);
        Free (a);
 }
 
@@ -193,7 +193,7 @@ static int sxnet_i2r(X509V3_EXT_METHOD *method, SXNET *sx, BIO *out,
                tmp = i2s_ASN1_INTEGER(NULL, id->zone);
                BIO_printf(out, "\n%*sZone: %s, User: ", indent, "", tmp);
                Free(tmp);
-               ASN1_OCTET_STRING_print(out, id->user);
+               M_ASN1_OCTET_STRING_print(out, id->user);
        }
        return 1;
 }
@@ -244,9 +244,9 @@ int SXNET_add_id_ulong(SXNET **psx, unsigned long lzone, char *user,
             int userlen)
 {
        ASN1_INTEGER *izone = NULL;
-       if(!(izone = ASN1_INTEGER_new()) || !ASN1_INTEGER_set(izone, lzone)) {
+       if(!(izone = M_ASN1_INTEGER_new()) || !ASN1_INTEGER_set(izone, lzone)) {
                X509V3err(X509V3_F_SXNET_ADD_ID_ULONG,ERR_R_MALLOC_FAILURE);
-               ASN1_INTEGER_free(izone);
+               M_ASN1_INTEGER_free(izone);
                return 0;
        }
        return SXNET_add_id_INTEGER(psx, izone, user, userlen);
@@ -285,7 +285,7 @@ int SXNET_add_id_INTEGER(SXNET **psx, ASN1_INTEGER *zone, char *user,
        if(!(id = SXNETID_new())) goto err;
        if(userlen == -1) userlen = strlen(user);
                
-       if(!ASN1_OCTET_STRING_set(id->user, user, userlen)) goto err;
+       if(!M_ASN1_OCTET_STRING_set(id->user, user, userlen)) goto err;
        if(!sk_SXNETID_push(sx->ids, id)) goto err;
        id->zone = zone;
        return 1;
@@ -307,7 +307,7 @@ ASN1_OCTET_STRING *SXNET_get_id_asc(SXNET *sx, char *zone)
                return NULL;
        }
        oct = SXNET_get_id_INTEGER(sx, izone);
-       ASN1_INTEGER_free(izone);
+       M_ASN1_INTEGER_free(izone);
        return oct;
 }
 
@@ -315,13 +315,13 @@ ASN1_OCTET_STRING *SXNET_get_id_ulong(SXNET *sx, unsigned long lzone)
 {
        ASN1_INTEGER *izone = NULL;
        ASN1_OCTET_STRING *oct;
-       if(!(izone = ASN1_INTEGER_new()) || !ASN1_INTEGER_set(izone, lzone)) {
+       if(!(izone = M_ASN1_INTEGER_new()) || !ASN1_INTEGER_set(izone, lzone)) {
                X509V3err(X509V3_F_SXNET_GET_ID_ULONG,ERR_R_MALLOC_FAILURE);
-               ASN1_INTEGER_free(izone);
+               M_ASN1_INTEGER_free(izone);
                return NULL;
        }
        oct = SXNET_get_id_INTEGER(sx, izone);
-       ASN1_INTEGER_free(izone);
+       M_ASN1_INTEGER_free(izone);
        return oct;
 }
 
@@ -331,7 +331,7 @@ ASN1_OCTET_STRING *SXNET_get_id_INTEGER(SXNET *sx, ASN1_INTEGER *zone)
        int i;
        for(i = 0; i < sk_SXNETID_num(sx->ids); i++) {
                id = sk_SXNETID_value(sx->ids, i);
-               if(!ASN1_INTEGER_cmp(id->zone, zone)) return id->user;
+               if(!M_ASN1_INTEGER_cmp(id->zone, zone)) return id->user;
        }
        return NULL;
 }
index c44ea0596500eab95a8cf6f2fe5f1ee336729633..7915307ce1d833a8b9323555be5aa00a934cff4c 100644 (file)
@@ -255,8 +255,8 @@ DECLARE_ASN1_SET_OF(POLICYINFO)
 #define X509V3_set_ctx_nodb(ctx) ctx->db = NULL;
 
 #define EXT_BITSTRING(nid, table) { nid, 0, \
-                       (X509V3_EXT_NEW)asn1_bit_string_new, \
-                       (X509V3_EXT_FREE)ASN1_STRING_free, \
+                       (X509V3_EXT_NEW)ASN1_BIT_STRING_new, \
+                       (X509V3_EXT_FREE)ASN1_BIT_STRING_free, \
                        (X509V3_EXT_D2I)d2i_ASN1_BIT_STRING, \
                        (X509V3_EXT_I2D)i2d_ASN1_BIT_STRING, \
                        NULL, NULL, \
@@ -266,8 +266,8 @@ DECLARE_ASN1_SET_OF(POLICYINFO)
                        (char *)table}
 
 #define EXT_IA5STRING(nid) { nid, 0, \
-                       (X509V3_EXT_NEW)ia5string_new, \
-                       (X509V3_EXT_FREE)ASN1_STRING_free, \
+                       (X509V3_EXT_NEW)ASN1_IA5STRING_new, \
+                       (X509V3_EXT_FREE)ASN1_IA5STRING_free, \
                        (X509V3_EXT_D2I)d2i_ASN1_IA5STRING, \
                        (X509V3_EXT_I2D)i2d_ASN1_IA5STRING, \
                        (X509V3_EXT_I2S)i2s_ASN1_IA5STRING, \
index 00a46f7f0fab768a00d5def94579efbe5c6352ef..eb9946fd6cfcc6c58bac90818eb3f13a70f349db 100755 (executable)
@@ -1879,3 +1879,86 @@ UTF8_getc                               1903
 RSA_null_method                         1904
 ASN1_tag2str                            1905
 BIO_ctrl_reset_read_request             1906
+DISPLAYTEXT_new                         1907
+ASN1_GENERALIZEDTIME_free               1908
+X509V3_REVOKED_get_d2i                  1909
+X509_set_ex_data                        1910
+X509_PURPOSE_add_standard               1911
+sk_X509_PURPOSE_value                   1912
+sk_X509_PURPOSE_zero                    1913
+ASN1_VISIBLESTRING_new                  1914
+ASN1_PRINTABLESTRING_free               1915
+ASN1_BMPSTRING_new                      1916
+ASN1_UTF8STRING_new                     1917
+sk_X509_PURPOSE_pop                     1918
+DSA_get_default_method                  1919
+sk_X509_PURPOSE_push                    1920
+sk_X509_PURPOSE_delete                  1921
+sk_X509_PURPOSE_num                     1922
+PEM_read_DSAPublicKey                   1923
+ASN1_T61STRING_free                     1924
+d2i_DSAPublicKey_fp                     1925
+DSA_set_method                          1926
+X509_get_ex_data                        1927
+ASN1_STRING_type                        1928
+sk_X509_PURPOSE_find                    1929
+ASN1_TIME_free                          1930
+ASN1_OCTET_STRING_cmp                   1931
+ASN1_BIT_STRING_new                     1932
+X509V3_X509_get_d2i                     1933
+ASN1_INTEGER_cmp                        1934
+ASN1_TIME_new                           1935
+d2i_DSAPublicKey_bio                    1936
+sk_X509_PURPOSE_new_null                1937
+ASN1_UTCTIME_free                       1938
+DSA_set_default_method                  1939
+sk_X509_PURPOSE_set_cmp_func            1940
+PEM_write_bio_DSAPublicKey              1941
+X509_PURPOSE_get_id                     1942
+DISPLAYTEXT_free                        1943
+X509V3_CRL_get_d2i                      1944
+ASN1_OCTET_STRING_free                  1945
+X509_get_ex_new_index                   1946
+ASN1_STRING_length                      1947
+ASN1_PRINTABLESTRING_new                1948
+X509V3_get_d2i                          1949
+ASN1_ENUMERATED_free                    1950
+sk_X509_PURPOSE_unshift                 1951
+sk_X509_PURPOSE_set                     1952
+sk_X509_PURPOSE_sort                    1953
+DIRECTORYSTRING_free                    1954
+ASN1_OCTET_STRING_set                   1955
+ASN1_IA5STRING_new                      1956
+X509_check_purpose                      1957
+ASN1_ENUMERATED_new                     1958
+PEM_write_DSAPublicKey                  1959
+ASN1_BMPSTRING_free                     1960
+ASN1_T61STRING_new                      1961
+ASN1_UTCTIME_new                        1962
+ASN1_IA5STRING_free                     1963
+ASN1_STRING_data                        1964
+X509_PURPOSE_get_name                   1965
+sk_X509_PURPOSE_delete_ptr              1966
+ASN1_BIT_STRING_free                    1967
+X509_PURPOSE_add                        1968
+ASN1_UTF8STRING_free                    1969
+X509_PURPOSE_enum                       1970
+sk_X509_PURPOSE_pop_free                1971
+i2d_DSAPublicKey_fp                     1972
+sk_X509_PURPOSE_free                    1973
+sk_X509_PURPOSE_dup                     1974
+ASN1_OCTET_STRING_dup                   1975
+ASN1_BIT_STRING_set                     1976
+ASN1_INTEGER_free                       1977
+ASN1_INTEGER_dup                        1978
+ASN1_VISIBLESTRING_free                 1979
+sk_X509_PURPOSE_shift                   1980
+sk_X509_PURPOSE_new                     1981
+sk_X509_PURPOSE_insert                  1982
+ASN1_GENERALIZEDTIME_new                1983
+PEM_read_bio_DSAPublicKey               1984
+ASN1_OCTET_STRING_new                   1985
+ASN1_INTEGER_new                        1986
+i2d_DSAPublicKey_bio                    1987
+ASN1_STRING_length_set                  1988
+DIRECTORYSTRING_new                     1989