Convert asn1_d2i_ex_primitive()/asn1_collect() from BUF_MEM to CBB.
authorjsing <jsing@openbsd.org>
Mon, 13 Dec 2021 17:50:24 +0000 (17:50 +0000)
committerjsing <jsing@openbsd.org>
Mon, 13 Dec 2021 17:50:24 +0000 (17:50 +0000)
commit3f2eca846394060045137a99891e778d1dee7d83
treecc1cbd34116bdc7627e9157a0a83f65236aad410
parent7199b42c3982899c973c524f49dc2ca40c0e9162
Convert asn1_d2i_ex_primitive()/asn1_collect() from BUF_MEM to CBB.

With this we get simpler code, overflow checking and more sensible
memory ownership. Also switch the free_cont case to freezero() since this
could contain secrets.

ok inoguchi@ tb@
lib/libcrypto/asn1/tasn_dec.c