tolerated in certificates.
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
#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;
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);
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);
}
#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,
* 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;
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
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);
}
int len,j;
if (ai == NULL)
- ret=ASN1_ENUMERATED_new();
+ ret=M_ASN1_ENUMERATED_new();
else
ret=ai;
if (ret == NULL)
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);
}
#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
return(ret);
err:
if ((ret != NULL) && ((a == NULL) || (*a != ret)))
- ASN1_GENERALIZEDTIME_free(ret);
+ M_ASN1_GENERALIZEDTIME_free(ret);
return(NULL);
}
#endif
if (s == NULL)
- s=ASN1_GENERALIZEDTIME_new();
+ s=M_ASN1_GENERALIZEDTIME_new();
if (s == NULL)
return(NULL);
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);
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);
#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
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
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);
}
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
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);
}
int len,j;
if (ai == NULL)
- ret=ASN1_INTEGER_new();
+ ret=M_ASN1_INTEGER_new();
else
ret=ai;
if (ret == NULL)
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);
}
#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)
#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)); }
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,
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)); }
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)); }
#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
#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
return(ret);
err:
if ((ret != NULL) && ((a == NULL) || (*a != ret)))
- ASN1_UTCTIME_free(ret);
+ M_ASN1_UTCTIME_free(ret);
return(NULL);
}
#endif
if (s == NULL)
- s=ASN1_UTCTIME_new();
+ s=M_ASN1_UTCTIME_new();
if (s == NULL)
return(NULL);
#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,
#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,
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) \
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) \
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) \
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)
(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)
(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,\
(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)
(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)
(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)
(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)
(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)
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 );
/* 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);
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);
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);
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);
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); }
os->length) <= 0)
goto end;
}
- ASN1_OCTET_STRING_free(os);
+ M_ASN1_OCTET_STRING_free(os);
os=NULL;
}
}
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)
{
if (BIO_write(bp,"BAD ENUMERATED",11) <= 0)
goto end;
}
- ASN1_ENUMERATED_free(bs);
+ M_ASN1_ENUMERATED_free(bs);
}
if (!nl)
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);
}
ret->length=(int)v;
}
- ASN1_BIT_STRING_free(bs);
+ M_ASN1_BIT_STRING_free(bs);
M_ASN1_D2I_Finish_2(a);
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
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);
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
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:
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
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);
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
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:
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
ret->write_params=1;
}
- ASN1_INTEGER_free(bs);
+ M_ASN1_INTEGER_free(bs);
bs=NULL;
M_ASN1_D2I_Finish_2(a);
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
{
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);
}
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
/* 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);
{
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;
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);
}
(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);
*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);
}
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);
}
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);
}
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);
}
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);
}
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);
{
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);
}
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;
/* 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;
}
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);
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);
}
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);
}
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);
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);
}
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);
}
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);
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);
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);
}
{
if (a == NULL) return;
X509_NAME_free(a->issuer);
- ASN1_INTEGER_free(a->serial);
+ M_ASN1_INTEGER_free(a->serial);
Free((char *)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);
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);
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);
}
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);
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);
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;
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);
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);
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);
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;
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)
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);
}
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;
}
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;
}
{
if (ret->version != NULL)
{
- ASN1_INTEGER_free(ret->version);
+ M_ASN1_INTEGER_free(ret->version);
ret->version=NULL;
}
}
{
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,
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);
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);
}
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);
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);
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);
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);
}
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);
}
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);
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);
}
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);
{
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);
}
{
if (a == NULL) return;
ASN1_OBJECT_free(a->object);
- ASN1_BIT_STRING_free(a->value);
+ M_ASN1_BIT_STRING_free(a->value);
Free(a);
}
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;
#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);
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);
{
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);
}
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;
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);
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);
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);
}
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);
}
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);
}
{
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);
}
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);
}
{
if (a == NULL) return;
X509_PUBKEY_free(a->pubkey);
- ASN1_IA5STRING_free(a->challenge);
+ M_ASN1_IA5STRING_free(a->challenge);
Free((char *)a);
}
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);
}
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);
}
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);
}
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);
}
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);
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);
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:
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);
}
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:
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;
}
}
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))) {
}
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))) {
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;
}
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;
}
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;
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:
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;
}
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;
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;
}
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;
}
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;
}
#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)
/* 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;
}
{
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;
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);
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);
}
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);
}
{
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);
}
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;
}
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;
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);
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;
}
}
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)
{
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:
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;
/* 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);
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
}
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:
/* 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);
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,
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);
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));
}
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; */
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));
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;
}
}
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;
}
}
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;
}
}
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);
}
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
+++ /dev/null
-WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
-
-This is ***VERY*** new experimental code and is likely to change
-considerably or vanish altogether.
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);
}
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;
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;
}
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;
err:
GENERAL_NAME_free(gen);
- ASN1_IA5STRING_free(email);
+ M_ASN1_IA5STRING_free(email);
return 0;
}
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;
}
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);
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);
}
#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,
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)
{
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;
}
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;
}
}
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;
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;
}
err:
ASN1_OBJECT_free(obj);
-ASN1_OCTET_STRING_free(oct);
+M_ASN1_OCTET_STRING_free(oct);
if(ext_der) Free(ext_der);
return extension;
}
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")) {
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")) {
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")) {
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:
{
if (a == NULL) return;
NOTICEREF_free(a->noticeref);
- DISPLAYTEXT_free(a->exptext);
+ M_DISPLAYTEXT_free(a->exptext);
Free (a);
}
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);
}
{
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);
}
#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"},
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,
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)
{
case GEN_DNS:
case GEN_URI:
- ASN1_IA5STRING_free(a->d.ia5);
+ M_ASN1_IA5STRING_free(a->d.ia5);
break;
case GEN_DIRNAME:
break;
case GEN_IPADD:
- ASN1_OCTET_STRING_free(a->d.ip);
+ M_ASN1_OCTET_STRING_free(a->d.ip);
break;
case GEN_RID:
#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[] = {
};
-static ASN1_IA5STRING *ia5string_new(void)
-{
- return ASN1_IA5STRING_new();
-}
-
static char *i2s_ASN1_IA5STRING(X509V3_EXT_METHOD *method,
ASN1_IA5STRING *ia5)
{
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;
#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();
-}
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);
}
#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)
{
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;
}
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;
}
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;
}
return oct;
err:
- ASN1_OCTET_STRING_free(oct);
+ M_ASN1_OCTET_STRING_free(oct);
return NULL;
}
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);
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);
}
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);
}
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);
}
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;
}
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);
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;
return NULL;
}
oct = SXNET_get_id_INTEGER(sx, izone);
- ASN1_INTEGER_free(izone);
+ M_ASN1_INTEGER_free(izone);
return oct;
}
{
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;
}
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;
}
#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, \
(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, \
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