#include <stdio.h>
#include "cryptlib.h"
-#include "asn1_mac.h"
-#include "x509.h"
+#include <openssl/asn1_mac.h>
+#include <openssl/x509.h>
-/*
- * ASN1err(ASN1_F_PKCS7_ENVELOPE_NEW,ASN1_R_LENGTH_MISMATCH);
- * ASN1err(ASN1_F_D2I_PKCS7_ENVELOPE,ASN1_R_LENGTH_MISMATCH);
- */
-
-int i2d_PKCS7_ENVELOPE(a,pp)
-PKCS7_ENVELOPE *a;
-unsigned char **pp;
+int i2d_PKCS7_ENVELOPE(PKCS7_ENVELOPE *a, unsigned char **pp)
{
M_ASN1_I2D_vars(a);
M_ASN1_I2D_finish();
}
-PKCS7_ENVELOPE *d2i_PKCS7_ENVELOPE(a,pp,length)
-PKCS7_ENVELOPE **a;
-unsigned char **pp;
-long length;
+PKCS7_ENVELOPE *d2i_PKCS7_ENVELOPE(PKCS7_ENVELOPE **a, unsigned char **pp,
+ long length)
{
M_ASN1_D2I_vars(a,PKCS7_ENVELOPE *,PKCS7_ENVELOPE_new);
M_ASN1_D2I_Init();
M_ASN1_D2I_start_sequence();
M_ASN1_D2I_get(ret->version,d2i_ASN1_INTEGER);
- M_ASN1_D2I_get_set(ret->recipientinfo,d2i_PKCS7_RECIP_INFO);
+ M_ASN1_D2I_get_set(ret->recipientinfo,d2i_PKCS7_RECIP_INFO,
+ PKCS7_RECIP_INFO_free);
M_ASN1_D2I_get(ret->enc_data,d2i_PKCS7_ENC_CONTENT);
M_ASN1_D2I_Finish(a,PKCS7_ENVELOPE_free,ASN1_F_D2I_PKCS7_ENVELOPE);
}
-PKCS7_ENVELOPE *PKCS7_ENVELOPE_new()
+PKCS7_ENVELOPE *PKCS7_ENVELOPE_new(void)
{
PKCS7_ENVELOPE *ret=NULL;
+ ASN1_CTX c;
M_ASN1_New_Malloc(ret,PKCS7_ENVELOPE);
M_ASN1_New(ret->version,ASN1_INTEGER_new);
M_ASN1_New_Error(ASN1_F_PKCS7_ENVELOPE_NEW);
}
-void PKCS7_ENVELOPE_free(a)
-PKCS7_ENVELOPE *a;
+void PKCS7_ENVELOPE_free(PKCS7_ENVELOPE *a)
{
if (a == NULL) return;
ASN1_INTEGER_free(a->version);