New ASN.1 embed macro.
authorDr. Stephen Henson <steve@openssl.org>
Tue, 15 Sep 2015 14:54:19 +0000 (15:54 +0100)
committerDr. Stephen Henson <steve@openssl.org>
Wed, 16 Sep 2015 21:17:39 +0000 (22:17 +0100)
commitde17bd5d7f8286d8b1f0a04a3f8f5782033f5ebd
tree5fab90b0d760d271e1fe90cde99271f2407f96ed
parent05e97f1d4f940c765e5c93771fe20820acca4438
New ASN.1 embed macro.

New ASN.1 macro ASN1_EMBED. This is the same as ASN1_SIMPLE except the
structure is not allocated: it is part of the parent. That is instead of

FOO *x;

it must be:

FOO x;

This reduces memory fragmentation and make it impossible to accidentally
set a mandatory field to NULL.

This currently only works for SEQUENCE and since it is equivalent to
ASN1_SIMPLE it cannot be tagged, OPTIONAL, SET OF or SEQUENCE OF.

Reviewed-by: Rich Salz <rsalz@openssl.org>
crypto/asn1/asn1_err.c
crypto/asn1/tasn_dec.c
crypto/asn1/tasn_enc.c
crypto/asn1/tasn_fre.c
crypto/asn1/tasn_new.c
include/openssl/asn1.h
include/openssl/asn1t.h