#define V_ASN1_REAL 9
#define V_ASN1_ENUMERATED 10
#define V_ASN1_NEG_ENUMERATED (10+0x100)
+#define V_ASN1_UTF8STRING 12
#define V_ASN1_SEQUENCE 16
#define V_ASN1_SET 17
#define V_ASN1_NUMERICSTRING 18 /**/
#define B_ASN1_NUMERICSTRING 0x0001
#define B_ASN1_PRINTABLESTRING 0x0002
#define B_ASN1_T61STRING 0x0004
+#define B_ASN1_TELETEXSTRING 0x0008
#define B_ASN1_VIDEOTEXSTRING 0x0008
#define B_ASN1_IA5STRING 0x0010
#define B_ASN1_GRAPHICSTRING 0x0020
#define B_ASN1_ISO64STRING 0x0040
+#define B_ASN1_VISIBLESTRING 0x0040
#define B_ASN1_GENERALSTRING 0x0080
#define B_ASN1_UNIVERSALSTRING 0x0100
#define B_ASN1_OCTET_STRING 0x0200
#define B_ASN1_BIT_STRING 0x0400
#define B_ASN1_BMPSTRING 0x0800
#define B_ASN1_UNKNOWN 0x1000
+#define B_ASN1_UTF8STRING 0x2000
typedef struct asn1_ctx_st
{
#define ASN1_OBJECT_FLAG_DYNAMIC_DATA 0x08 /* internal use */
typedef struct asn1_object_st
{
- char *sn,*ln;
+ const char *sn,*ln;
int nid;
int length;
unsigned char *data;
#define ASN1_GENERALSTRING ASN1_STRING
#define ASN1_UNIVERSALSTRING ASN1_STRING
#define ASN1_BMPSTRING ASN1_STRING
+#define ASN1_VISIBLESTRING ASN1_STRING
+#define ASN1_UTF8STRING ASN1_STRING
#else
typedef struct asn1_string_st ASN1_INTEGER;
typedef struct asn1_string_st ASN1_ENUMERATED;
typedef struct asn1_string_st ASN1_UTCTIME;
typedef struct asn1_string_st ASN1_TIME;
typedef struct asn1_string_st ASN1_GENERALIZEDTIME;
+typedef struct asn1_string_st ASN1_VISIBLESTRING;
+typedef struct asn1_string_st ASN1_UTF8STRING;
#endif
typedef struct asn1_type_st
ASN1_UNIVERSALSTRING * universalstring;
ASN1_UTCTIME * utctime;
ASN1_GENERALIZEDTIME * generalizedtime;
+ ASN1_VISIBLESTRING * visiblestring;
+ ASN1_UTF8STRING * utf8string;
/* set and sequence are left complete and still
* contain the set or sequence bytes */
ASN1_STRING * set;
B_ASN1_BMPSTRING|\
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_i2d_DIRECTORYSTRING(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\
+ pp,a->type,V_ASN1_UNIVERSAL)
+#define M_d2i_DIRECTORYSTRING(a,pp,l) \
+ d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \
+ B_ASN1_PRINTABLESTRING| \
+ B_ASN1_TELETEXSTRING|\
+ B_ASN1_BMPSTRING|\
+ 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_i2d_DISPLAYTEXT(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\
+ pp,a->type,V_ASN1_UNIVERSAL)
+#define M_d2i_DISPLAYTEXT(a,pp,l) \
+ d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \
+ B_ASN1_VISIBLESTRING| \
+ B_ASN1_BMPSTRING|\
+ B_ASN1_UTF8STRING)
+
#define ASN1_PRINTABLESTRING_new() (ASN1_PRINTABLESTRING *)\
ASN1_STRING_type_new(V_ASN1_PRINTABLESTRING)
#define ASN1_PRINTABLESTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
(ASN1_BMPSTRING *)d2i_ASN1_type_bytes\
((ASN1_STRING **)a,pp,l,B_ASN1_BMPSTRING)
+#define 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_i2d_ASN1_VISIBLESTRING(a,pp) \
+ i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_VISIBLESTRING,\
+ V_ASN1_UNIVERSAL)
+#define M_d2i_ASN1_VISIBLESTRING(a,pp,l) \
+ (ASN1_VISIBLESTRING *)d2i_ASN1_type_bytes\
+ ((ASN1_STRING **)a,pp,l,B_ASN1_VISIBLESTRING)
+
+#define 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_i2d_ASN1_UTF8STRING(a,pp) \
+ i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_UTF8STRING,\
+ V_ASN1_UNIVERSAL)
+#define M_d2i_ASN1_UTF8STRING(a,pp,l) \
+ (ASN1_UTF8STRING *)d2i_ASN1_type_bytes\
+ ((ASN1_STRING **)a,pp,l,B_ASN1_UTF8STRING)
+
/* for the is_set parameter to i2d_ASN1_SET */
#define IS_SEQUENCE 0
#define IS_SET 1
ASN1_OCTET_STRING *d2i_ASN1_OCTET_STRING(ASN1_OCTET_STRING **a,
unsigned char **pp,long length);
+int i2d_ASN1_VISIBLESTRING(ASN1_VISIBLESTRING *a,unsigned char **pp);
+ASN1_VISIBLESTRING *d2i_ASN1_VISIBLESTRING(ASN1_VISIBLESTRING **a,
+ unsigned char **pp,long length);
+
+int i2d_ASN1_UTF8STRING(ASN1_UTF8STRING *a,unsigned char **pp);
+ASN1_UTF8STRING *d2i_ASN1_UTF8STRING(ASN1_UTF8STRING **a,
+ unsigned char **pp,long length);
+
int i2d_ASN1_BMPSTRING(ASN1_BMPSTRING *a, unsigned char **pp);
ASN1_BMPSTRING *d2i_ASN1_BMPSTRING(ASN1_BMPSTRING **a, unsigned char **pp,
long length);
ASN1_PRINTABLESTRING *d2i_ASN1_PRINTABLESTRING(ASN1_PRINTABLESTRING **a,
unsigned char **pp, long l);
+int i2d_DIRECTORYSTRING(ASN1_STRING *a,unsigned char **pp);
+ASN1_STRING *d2i_DIRECTORYSTRING(ASN1_STRING **a, unsigned char **pp,
+ long length);
+
+int i2d_DISPLAYTEXT(ASN1_STRING *a,unsigned char **pp);
+ASN1_STRING *d2i_DISPLAYTEXT(ASN1_STRING **a, unsigned char **pp, long length);
+
ASN1_T61STRING *d2i_ASN1_T61STRING(ASN1_T61STRING **a,
unsigned char **pp, long l);
int i2d_ASN1_IA5STRING(ASN1_IA5STRING *a,unsigned char **pp);
char *(*func)(), void (*free_func)(),
int ex_tag, int ex_class);
+#define DECLARE_ASN1_SET_OF(type) \
+int i2d_ASN1_SET_OF_##type(STACK_OF(type) *a,unsigned char **pp, \
+ int (*func)(type *,unsigned char **), int ex_tag, \
+ int ex_class, int is_set); \
+STACK_OF(type) *d2i_ASN1_SET_OF_##type(STACK_OF(type) **a,unsigned char **pp, \
+ long length, \
+ type *(*func)(type **, \
+ unsigned char **,long), \
+ void (*free_func)(type *), \
+ int ex_tag,int ex_class);
+
+#define IMPLEMENT_ASN1_SET_OF(type) \
+int i2d_ASN1_SET_OF_##type(STACK_OF(type) *a,unsigned char **pp, \
+ int (*func)(type *,unsigned char **), int ex_tag, \
+ int ex_class, int is_set) \
+ { return i2d_ASN1_SET((STACK *)a,pp,func,ex_tag,ex_class,is_set); } \
+STACK_OF(type) *d2i_ASN1_SET_OF_##type(STACK_OF(type) **a,unsigned char **pp, \
+ long length, \
+ type *(*func)(type **, \
+ unsigned char **,long), \
+ void (*free_func)(type *), \
+ int ex_tag,int ex_class) \
+ { return (STACK_OF(type) *)d2i_ASN1_SET((STACK **)a,pp,length, \
+ (char *(*)())func, \
+ (void (*)())free_func, \
+ ex_tag,ex_class); }
+
#ifdef HEADER_BIO_H
int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a);
int a2i_ASN1_INTEGER(BIO *bp,ASN1_INTEGER *bs,char *buf,int size);
#endif
int i2t_ASN1_OBJECT(char *buf,int buf_len,ASN1_OBJECT *a);
-int a2d_ASN1_OBJECT(unsigned char *out,int olen, char *buf, int num);
+int a2d_ASN1_OBJECT(unsigned char *out,int olen, const char *buf, int num);
ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data,int len,
char *sn, char *ln);
int ASN1_GENERALIZEDTIME_set_string();
int i2d_ASN1_OCTET_STRING();
ASN1_OCTET_STRING *d2i_ASN1_OCTET_STRING();
+int i2d_ASN1_VISIBLESTRING();
+ASN1_VISIBLESTRING *d2i_ASN1_VISIBLESTRING();
+int i2d_ASN1_UTF8STRING();
+ASN1_UTF8STRING *d2i_ASN1_UTF8STRING();
int i2d_ASN1_PRINTABLE();
ASN1_STRING *d2i_ASN1_PRINTABLE();
+int i2d_DIRECTORYSTRING();
+ASN1_STRING *d2i_DIRECTORYSTRING();
+int i2d_DISPLAYTEXT();
+ASN1_STRING *d2i_DISPLAYTEXT();
ASN1_PRINTABLESTRING *d2i_ASN1_PRINTABLESTRING();
ASN1_T61STRING *d2i_ASN1_T61STRING();
int i2d_ASN1_IA5STRING();
#define ASN1_F_D2I_ASN1_TYPE 133
#define ASN1_F_D2I_ASN1_TYPE_BYTES 134
#define ASN1_F_D2I_ASN1_UTCTIME 135
+#define ASN1_F_D2I_ASN1_UTF8STRING 266
+#define ASN1_F_D2I_ASN1_VISIBLESTRING 267
#define ASN1_F_D2I_AUTHORITY_KEYID 238
#define ASN1_F_D2I_BASIC_CONSTRAINTS 227
#define ASN1_F_D2I_DHPARAMS 136
#define ASN1_F_D2I_NETSCAPE_RSA_2 142
#define ASN1_F_D2I_NETSCAPE_SPKAC 143
#define ASN1_F_D2I_NETSCAPE_SPKI 144
+#define ASN1_F_D2I_NOTICEREF 268
+#define ASN1_F_D2I_PBE2PARAM 262
#define ASN1_F_D2I_PBEPARAM 249
+#define ASN1_F_D2I_PBKDF2PARAM 263
#define ASN1_F_D2I_PKCS12 254
#define ASN1_F_D2I_PKCS12_BAGS 255
#define ASN1_F_D2I_PKCS12_MAC_DATA 256
#define ASN1_F_D2I_PKCS7_SIGN_ENVELOPE 154
#define ASN1_F_D2I_PKCS8_PRIV_KEY_INFO 250
#define ASN1_F_D2I_PKEY_USAGE_PERIOD 239
+#define ASN1_F_D2I_POLICYINFO 269
+#define ASN1_F_D2I_POLICYQUALINFO 270
#define ASN1_F_D2I_PRIVATEKEY 155
#define ASN1_F_D2I_PUBLICKEY 156
#define ASN1_F_D2I_RSAPRIVATEKEY 157
#define ASN1_F_D2I_RSAPUBLICKEY 158
#define ASN1_F_D2I_SXNET 241
#define ASN1_F_D2I_SXNETID 243
+#define ASN1_F_D2I_USERNOTICE 271
#define ASN1_F_D2I_X509 159
#define ASN1_F_D2I_X509_ALGOR 160
#define ASN1_F_D2I_X509_ATTRIBUTE 161
#define ASN1_F_NETSCAPE_PKEY_NEW 189
#define ASN1_F_NETSCAPE_SPKAC_NEW 190
#define ASN1_F_NETSCAPE_SPKI_NEW 191
+#define ASN1_F_NOTICEREF_NEW 272
+#define ASN1_F_PBE2PARAM_NEW 264
#define ASN1_F_PBEPARAM_NEW 251
+#define ASN1_F_PBKDF2PARAM_NEW 265
#define ASN1_F_PKCS12_BAGS_NEW 258
#define ASN1_F_PKCS12_MAC_DATA_NEW 259
#define ASN1_F_PKCS12_NEW 260
#define ASN1_F_PKCS7_SIGN_ENVELOPE_NEW 201
#define ASN1_F_PKCS8_PRIV_KEY_INFO_NEW 252
#define ASN1_F_PKEY_USAGE_PERIOD_NEW 240
+#define ASN1_F_POLICYINFO_NEW 273
+#define ASN1_F_POLICYQUALINFO_NEW 274
#define ASN1_F_SXNETID_NEW 244
#define ASN1_F_SXNET_NEW 242
+#define ASN1_F_USERNOTICE_NEW 275
#define ASN1_F_X509_ALGOR_NEW 202
#define ASN1_F_X509_ATTRIBUTE_NEW 203
#define ASN1_F_X509_CINF_NEW 204