Stack.
[openssl.git] / crypto / asn1 / p7_signd.c
index f7a15a3..75ceb96 100644 (file)
@@ -70,7 +70,8 @@ int i2d_PKCS7_SIGNED(PKCS7_SIGNED *a, unsigned char **pp)
        M_ASN1_I2D_len(a->contents,i2d_PKCS7);
        M_ASN1_I2D_len_IMP_SEQUENCE_opt_type(X509,a->cert,i2d_X509,0);
        M_ASN1_I2D_len_IMP_SET_opt_type(X509_CRL,a->crl,i2d_X509_CRL,1);
-       M_ASN1_I2D_len_SET(a->signer_info,i2d_PKCS7_SIGNER_INFO);
+       M_ASN1_I2D_len_SET_type(PKCS7_SIGNER_INFO,a->signer_info,
+                               i2d_PKCS7_SIGNER_INFO);
 
        M_ASN1_I2D_seq_total();
 
@@ -79,7 +80,8 @@ int i2d_PKCS7_SIGNED(PKCS7_SIGNED *a, unsigned char **pp)
        M_ASN1_I2D_put(a->contents,i2d_PKCS7);
        M_ASN1_I2D_put_IMP_SEQUENCE_opt_type(X509,a->cert,i2d_X509,0);
        M_ASN1_I2D_put_IMP_SET_opt_type(X509_CRL,a->crl,i2d_X509_CRL,1);
-       M_ASN1_I2D_put_SET(a->signer_info,i2d_PKCS7_SIGNER_INFO);
+       M_ASN1_I2D_put_SET_type(PKCS7_SIGNER_INFO,a->signer_info,
+                               i2d_PKCS7_SIGNER_INFO);
 
        M_ASN1_I2D_finish();
        }
@@ -98,8 +100,8 @@ PKCS7_SIGNED *d2i_PKCS7_SIGNED(PKCS7_SIGNED **a, unsigned char **pp,
        M_ASN1_D2I_get_IMP_set_opt_type(X509,ret->cert,d2i_X509,X509_free,0);
        M_ASN1_D2I_get_IMP_set_opt_type(X509_CRL,ret->crl,d2i_X509_CRL,
                                        X509_CRL_free,1);
-       M_ASN1_D2I_get_set(ret->signer_info,d2i_PKCS7_SIGNER_INFO,
-               PKCS7_SIGNER_INFO_free);
+       M_ASN1_D2I_get_set_type(PKCS7_SIGNER_INFO,ret->signer_info,
+                               d2i_PKCS7_SIGNER_INFO,PKCS7_SIGNER_INFO_free);
 
        M_ASN1_D2I_Finish(a,PKCS7_SIGNED_free,ASN1_F_D2I_PKCS7_SIGNED);
        }
@@ -115,7 +117,7 @@ PKCS7_SIGNED *PKCS7_SIGNED_new(void)
        M_ASN1_New(ret->contents,PKCS7_new);
        ret->cert=NULL;
        ret->crl=NULL;
-       M_ASN1_New(ret->signer_info,sk_new_null);
+       M_ASN1_New(ret->signer_info,sk_PKCS7_SIGNER_INFO_new_null);
        return(ret);
        M_ASN1_New_Error(ASN1_F_PKCS7_SIGNED_NEW);
        }
@@ -128,11 +130,13 @@ void PKCS7_SIGNED_free(PKCS7_SIGNED *a)
        PKCS7_free(a->contents);
        sk_X509_pop_free(a->cert,X509_free);
        sk_X509_CRL_pop_free(a->crl,X509_CRL_free);
-       sk_pop_free(a->signer_info,PKCS7_SIGNER_INFO_free);
-       Free((char *)a);
+       sk_PKCS7_SIGNER_INFO_pop_free(a->signer_info,PKCS7_SIGNER_INFO_free);
+       Free(a);
        }
 
 IMPLEMENT_STACK_OF(X509_ALGOR)
 IMPLEMENT_ASN1_SET_OF(X509_ALGOR)
 IMPLEMENT_STACK_OF(X509_CRL)
 IMPLEMENT_ASN1_SET_OF(X509_CRL)
+IMPLEMENT_STACK_OF(PKCS7_SIGNER_INFO)
+IMPLEMENT_ASN1_SET_OF(PKCS7_SIGNER_INFO)