=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/openssl/pkcs12.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- src/usr.bin/openssl/pkcs12.c 2023/03/06 14:32:06 1.25 +++ src/usr.bin/openssl/pkcs12.c 2023/11/19 09:29:11 1.26 @@ -1,4 +1,4 @@ -/* $OpenBSD: pkcs12.c,v 1.25 2023/03/06 14:32:06 tb Exp $ */ +/* $OpenBSD: pkcs12.c,v 1.26 2023/11/19 09:29:11 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project. */ @@ -1010,15 +1010,18 @@ static int alg_print(BIO *x, const X509_ALGOR *alg) { - PBEPARAM *pbe; - const unsigned char *p; + PBEPARAM *pbe = NULL; + const ASN1_OBJECT *aobj; + int param_type; + const void *param; - p = alg->parameter->value.sequence->data; - pbe = d2i_PBEPARAM(NULL, &p, alg->parameter->value.sequence->length); + X509_ALGOR_get0(&aobj, ¶m_type, ¶m, alg); + if (param_type == V_ASN1_SEQUENCE) + pbe = ASN1_item_unpack(param, &PBEPARAM_it); if (pbe == NULL) return 1; BIO_printf(bio_err, "%s, Iteration %ld\n", - OBJ_nid2ln(OBJ_obj2nid(alg->algorithm)), + OBJ_nid2ln(OBJ_obj2nid(aobj)), ASN1_INTEGER_get(pbe->iter)); PBEPARAM_free(pbe); return 1;