Browse Source

Replace the macros in asn1.h with function equivalents. Also make UTF8Strings

tolerated in certificates.
master
Dr. Stephen Henson 23 years ago
parent
commit
08e9c1af6c
87 changed files with 595 additions and 388 deletions
  1. +6
    -0
      CHANGES
  2. +11
    -2
      crypto/asn1/a_bitstr.c
  3. +6
    -0
      crypto/asn1/a_bmp.c
  4. +10
    -4
      crypto/asn1/a_enum.c
  5. +8
    -2
      crypto/asn1/a_gentm.c
  6. +2
    -2
      crypto/asn1/a_hdr.c
  7. +18
    -6
      crypto/asn1/a_int.c
  8. +16
    -4
      crypto/asn1/a_octet.c
  9. +29
    -0
      crypto/asn1/a_print.c
  10. +6
    -0
      crypto/asn1/a_time.c
  11. +8
    -2
      crypto/asn1/a_utctm.c
  12. +6
    -0
      crypto/asn1/a_utf8.c
  13. +6
    -0
      crypto/asn1/a_vis.c
  14. +102
    -81
      crypto/asn1/asn1.h
  15. +11
    -0
      crypto/asn1/asn1_lib.c
  16. +4
    -4
      crypto/asn1/asn1_par.c
  17. +2
    -2
      crypto/asn1/d2i_dhp.c
  18. +2
    -2
      crypto/asn1/d2i_dsap.c
  19. +3
    -2
      crypto/asn1/d2i_r_pr.c
  20. +2
    -2
      crypto/asn1/d2i_r_pu.c
  21. +2
    -2
      crypto/asn1/d2i_s_pr.c
  22. +2
    -2
      crypto/asn1/d2i_s_pu.c
  23. +12
    -12
      crypto/asn1/evp_asn1.c
  24. +7
    -7
      crypto/asn1/n_pkey.c
  25. +4
    -4
      crypto/asn1/p5_pbe.c
  26. +6
    -6
      crypto/asn1/p5_pbev2.c
  27. +4
    -4
      crypto/asn1/p7_dgst.c
  28. +2
    -2
      crypto/asn1/p7_enc.c
  29. +1
    -1
      crypto/asn1/p7_enc_c.c
  30. +2
    -2
      crypto/asn1/p7_evp.c
  31. +2
    -2
      crypto/asn1/p7_i_s.c
  32. +1
    -1
      crypto/asn1/p7_lib.c
  33. +4
    -4
      crypto/asn1/p7_recip.c
  34. +2
    -2
      crypto/asn1/p7_s_e.c
  35. +2
    -2
      crypto/asn1/p7_signd.c
  36. +4
    -4
      crypto/asn1/p7_signi.c
  37. +2
    -2
      crypto/asn1/p8_pkey.c
  38. +1
    -1
      crypto/asn1/t_crl.c
  39. +1
    -1
      crypto/asn1/t_req.c
  40. +1
    -1
      crypto/asn1/t_x509.c
  41. +8
    -8
      crypto/asn1/x_cinf.c
  42. +11
    -11
      crypto/asn1/x_crl.c
  43. +2
    -2
      crypto/asn1/x_exten.c
  44. +1
    -1
      crypto/asn1/x_name.c
  45. +2
    -2
      crypto/asn1/x_pkey.c
  46. +3
    -3
      crypto/asn1/x_pubkey.c
  47. +4
    -4
      crypto/asn1/x_req.c
  48. +2
    -2
      crypto/asn1/x_sig.c
  49. +4
    -4
      crypto/asn1/x_spki.c
  50. +4
    -4
      crypto/asn1/x_val.c
  51. +2
    -2
      crypto/asn1/x_x509.c
  52. +2
    -2
      crypto/dsa/dsa_asn1.c
  53. +2
    -2
      crypto/evp/evp_pkey.c
  54. +3
    -3
      crypto/pkcs12/p12_add.c
  55. +5
    -5
      crypto/pkcs12/p12_attr.c
  56. +3
    -3
      crypto/pkcs12/p12_bags.c
  57. +1
    -1
      crypto/pkcs12/p12_decr.c
  58. +3
    -3
      crypto/pkcs12/p12_init.c
  59. +15
    -15
      crypto/pkcs12/p12_kiss.c
  60. +1
    -1
      crypto/pkcs12/p12_lib.c
  61. +7
    -7
      crypto/pkcs12/p12_mac.c
  62. +4
    -4
      crypto/pkcs12/p12_mutl.c
  63. +10
    -10
      crypto/pkcs7/pk7_doit.c
  64. +5
    -5
      crypto/pkcs7/pk7_lib.c
  65. +1
    -1
      crypto/rsa/rsa_saos.c
  66. +1
    -1
      crypto/x509/x509_cmp.c
  67. +1
    -1
      crypto/x509/x509_r2x.c
  68. +7
    -7
      crypto/x509/x509_set.c
  69. +1
    -1
      crypto/x509/x509_v3.c
  70. +18
    -0
      crypto/x509v3/Makefile.ssl
  71. +0
    -4
      crypto/x509v3/README
  72. +5
    -5
      crypto/x509v3/v3_akey.c
  73. +4
    -4
      crypto/x509v3/v3_alt.c
  74. +1
    -1
      crypto/x509v3/v3_bcons.c
  75. +2
    -8
      crypto/x509v3/v3_bitst.c
  76. +4
    -4
      crypto/x509v3/v3_conf.c
  77. +7
    -7
      crypto/x509v3/v3_cpols.c
  78. +1
    -1
      crypto/x509v3/v3_crld.c
  79. +2
    -9
      crypto/x509v3/v3_enum.c
  80. +2
    -2
      crypto/x509v3/v3_genn.c
  81. +2
    -8
      crypto/x509v3/v3_ia5.c
  82. +2
    -9
      crypto/x509v3/v3_int.c
  83. +2
    -2
      crypto/x509v3/v3_pku.c
  84. +7
    -14
      crypto/x509v3/v3_skey.c
  85. +14
    -14
      crypto/x509v3/v3_sxnet.c
  86. +4
    -4
      crypto/x509v3/x509v3.h
  87. +83
    -0
      util/libeay.num

+ 6
- 0
CHANGES View File

@ -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


+ 11
- 2
crypto/asn1/a_bitstr.c View File

@ -60,6 +60,15 @@
#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);
}


+ 6
- 0
crypto/asn1/a_bmp.c View File

@ -60,6 +60,12 @@
#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,


+ 10
- 4
crypto/asn1/a_enum.c View File

@ -65,6 +65,12 @@
* 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);
}


+ 8
- 2
crypto/asn1/a_gentm.c View File

@ -63,6 +63,12 @@
#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);


+ 2
- 2
crypto/asn1/a_hdr.c View 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);


+ 18
- 6
crypto/asn1/a_int.c View File

@ -60,6 +60,18 @@
#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);
}


+ 16
- 4
crypto/asn1/a_octet.c View File

@ -60,11 +60,23 @@
#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)


+ 29
- 0
crypto/asn1/a_print.c View File

@ -60,6 +60,12 @@
#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)); }


+ 6
- 0
crypto/asn1/a_time.c View File

@ -66,6 +66,12 @@
#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


+ 8
- 2
crypto/asn1/a_utctm.c View File

@ -66,6 +66,12 @@
#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);


+ 6
- 0
crypto/asn1/a_utf8.c View File

@ -60,6 +60,12 @@
#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,


+ 6
- 0
crypto/asn1/a_vis.c View File

@ -60,6 +60,12 @@
#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,


+ 102
- 81
crypto/asn1/asn1.h View 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);


+ 11
- 0
crypto/asn1/asn1_lib.c View 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); }

+ 4
- 4
crypto/asn1/asn1_par.c View 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);
}


+ 2
- 2
crypto/asn1/d2i_dhp.c View 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

+ 2
- 2
crypto/asn1/d2i_dsap.c View 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

+ 3
- 2
crypto/asn1/d2i_r_pr.c View 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

+ 2
- 2
crypto/asn1/d2i_r_pu.c View 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

+ 2
- 2
crypto/asn1/d2i_s_pr.c View 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

+ 2
- 2
crypto/asn1/d2i_s_pu.c View 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

+ 12
- 12
crypto/asn1/evp_asn1.c View 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);
}

+ 7
- 7
crypto/asn1/n_pkey.c View 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);
}


+ 4
- 4
crypto/asn1/p5_pbe.c View 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);
}


+ 6
- 6
crypto/asn1/p5_pbev2.c View 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);


+ 4
- 4
crypto/asn1/p7_dgst.c View 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);
}

+ 2
- 2
crypto/asn1/p7_enc.c View 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);
}


+ 1
- 1
crypto/asn1/p7_enc_c.c View 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);
}

+ 2
- 2
crypto/asn1/p7_evp.c View 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);


+ 2
- 2
crypto/asn1/p7_i_s.c View 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);
}

+ 1
- 1
crypto/asn1/p7_lib.c View 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);


+ 4
- 4
crypto/asn1/p7_recip.c View 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);
}


+ 2
- 2
crypto/asn1/p7_s_e.c View 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);