save the plain constructed-, sequence- or set-data details

This commit is contained in:
Steffen Jaeckel 2015-09-10 22:38:39 +02:00
parent 0a400f465f
commit 7ddce245b8
2 changed files with 10 additions and 3 deletions

View File

@ -348,6 +348,15 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc
l->type = LTC_ASN1_SET;
}
if ((l->data = XMALLOC(len)) == NULL) {
err = CRYPT_MEM;
goto error;
}
XMEMCPY(l->data, in, len);
l->size = len;
/* jump to the start of the data */
in += data_offset;
*inlen -= data_offset;

View File

@ -46,9 +46,7 @@ void der_sequence_free(ltc_asn1_list *in)
}
switch (in->type) {
case LTC_ASN1_SET:
case LTC_ASN1_SETOF:
case LTC_ASN1_SEQUENCE: break;
case LTC_ASN1_SETOF: break;
case LTC_ASN1_INTEGER : if (in->data != NULL) { mp_clear(in->data); } break;
default : if (in->data != NULL) { XFREE(in->data); }
}