-/* $OpenBSD: tasn_dec.c,v 1.84 2022/11/26 16:08:50 tb Exp $ */
+/* $OpenBSD: tasn_dec.c,v 1.85 2023/04/28 17:59:53 job Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2000.
*/
asn1_item_d2i_sequence(ASN1_VALUE **pval, CBS *cbs, const ASN1_ITEM *it,
int tag_number, int tag_class, int optional, int depth)
{
- CBS cbs_seq, cbs_seq_content, cbs_object;
+ CBS cbs_seq, cbs_seq_content;
int constructed, indefinite, optional_field;
const ASN1_TEMPLATE *errat = NULL;
const ASN1_TEMPLATE *seqat, *at;
ASN1_template_free(pseqval, seqat);
}
- if (!CBS_get_bytes(cbs, &cbs_object, CBS_offset(&cbs_seq)))
+ if (!CBS_skip(cbs, CBS_offset(&cbs_seq)))
goto err;
- if (!asn1_enc_save(&aseq, &cbs_object, it)) {
- ASN1error(ERR_R_MALLOC_FAILURE);
- goto err;
- }
-
if (asn1_cb != NULL && !asn1_cb(ASN1_OP_D2I_POST, &aseq, it, NULL)) {
ASN1error(ASN1_R_AUX_ERROR);
goto err;
-/* $OpenBSD: tasn_enc.c,v 1.29 2023/03/06 12:00:27 tb Exp $ */
+/* $OpenBSD: tasn_enc.c,v 1.30 2023/04/28 17:59:53 job Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2000.
*/
/* fall through */
case ASN1_ITYPE_SEQUENCE:
- i = asn1_enc_restore(&seqcontlen, out, pval, it);
- /* An error occurred */
- if (i < 0)
- return 0;
- /* We have a valid cached encoding... */
- if (i > 0)
- return seqcontlen;
- /* Otherwise carry on */
seqcontlen = 0;
/* If no IMPLICIT tagging set to SEQUENCE, UNIVERSAL */
if (tag == -1) {