M_ASN1_I2D_len(a->enc_data,i2d_PKCS7_ENC_CONTENT);
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();
M_ASN1_I2D_put(a->enc_data,i2d_PKCS7_ENC_CONTENT);
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();
}
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_SIGN_ENVELOPE_free,
ASN1_F_D2I_PKCS7_SIGN_ENVELOPE);
M_ASN1_New(ret->enc_data,PKCS7_ENC_CONTENT_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_SIGN_ENVELOPE_NEW);
}
PKCS7_ENC_CONTENT_free(a->enc_data);
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);
+ sk_PKCS7_SIGNER_INFO_pop_free(a->signer_info,PKCS7_SIGNER_INFO_free);
Free((char *)a);
}
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();
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();
}
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);
}
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);
}
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)
PKCS7_SIGNER_INFO *si;
EVP_MD_CTX *mdc,ctx_tmp;
STACK_OF(X509_ATTRIBUTE) *sk;
- STACK *si_sk=NULL;
+ STACK_OF(PKCS7_SIGNER_INFO) *si_sk=NULL;
unsigned char *p,*pp=NULL;
int x;
ASN1_OCTET_STRING *os=NULL;
PKCS7err(PKCS7_F_PKCS7_DATASIGN,ERR_R_BIO_LIB);
goto err;
}
- for (i=0; i<sk_num(si_sk); i++)
+ for (i=0; i<sk_PKCS7_SIGNER_INFO_num(si_sk); i++)
{
- si=(PKCS7_SIGNER_INFO *)
- sk_value(si_sk,i);
+ si=sk_PKCS7_SIGNER_INFO_value(si_sk,i);
if (si->pkey == NULL) continue;
j=OBJ_obj2nid(si->digest_alg->algorithm);
{
int i,j,nid;
X509_ALGOR *alg;
- STACK *signer_sk;
+ STACK_OF(PKCS7_SIGNER_INFO) *signer_sk;
STACK_OF(X509_ALGOR) *md_sk;
i=OBJ_obj2nid(p7->type);
sk_X509_ALGOR_push(md_sk,alg);
}
- sk_push(signer_sk,(char *)psi);
+ sk_PKCS7_SIGNER_INFO_push(signer_sk,psi);
return(1);
}
return(NULL);
}
-STACK *PKCS7_get_signer_info(PKCS7 *p7)
+STACK_OF(PKCS7_SIGNER_INFO) *PKCS7_get_signer_info(PKCS7 *p7)
{
if (PKCS7_type_is_signed(p7))
{
EVP_PKEY *pkey;
} PKCS7_SIGNER_INFO;
+DECLARE_STACK_OF(PKCS7_SIGNER_INFO)
+DECLARE_ASN1_SET_OF(PKCS7_SIGNER_INFO)
+
typedef struct pkcs7_recip_info_st
{
ASN1_INTEGER *version; /* version 0 */
STACK_OF(X509_ALGOR) *md_algs; /* md used */
STACK_OF(X509) *cert; /* [ 0 ] */
STACK_OF(X509_CRL) *crl; /* [ 1 ] */
- STACK /* PKCS7_SIGNER_INFO */ *signer_info;
+ STACK_OF(PKCS7_SIGNER_INFO) *signer_info;
struct pkcs7_st *contents;
} PKCS7_SIGNED;
STACK_OF(X509_ALGOR) *md_algs; /* md used */
STACK_OF(X509) *cert; /* [ 0 ] */
STACK_OF(X509_CRL) *crl; /* [ 1 ] */
- STACK /* PKCS7_SIGNER_INFO */ *signer_info;
+ STACK_OF(PKCS7_SIGNER_INFO) *signer_info;
PKCS7_ENC_CONTENT *enc_data;
STACK /* PKCS7_RECIP_INFO */ *recipientinfo;
PKCS7_SIGNER_INFO *PKCS7_add_signature(PKCS7 *p7, X509 *x509,
EVP_PKEY *pkey, EVP_MD *dgst);
X509 *PKCS7_cert_from_signer_info(PKCS7 *p7, PKCS7_SIGNER_INFO *si);
-STACK *PKCS7_get_signer_info(PKCS7 *p7);
+STACK_OF(PKCS7_SIGNER_INFO) *PKCS7_get_signer_info(PKCS7 *p7);
PKCS7_RECIP_INFO *PKCS7_add_recipient(PKCS7 *p7, X509 *x509);
int PKCS7_add_recipient_info(PKCS7 *p7, PKCS7_RECIP_INFO *ri);