Provide t2i_ASN1_OBJECT_internal() and use it for OBJ_txt2obj()
authorjsing <jsing@openbsd.org>
Sat, 19 Mar 2022 17:49:32 +0000 (17:49 +0000)
committerjsing <jsing@openbsd.org>
Sat, 19 Mar 2022 17:49:32 +0000 (17:49 +0000)
commitcb5f613c45fb279f240bf621710bf7f211bfba1c
treeaa3890c3ec164517253f27bfe60a253cb0862027
parentd612c80bf52444f67876d2edeeb1c91a88996032
Provide t2i_ASN1_OBJECT_internal() and use it for OBJ_txt2obj()

The current OBJ_txt2obj() implementation converts the text to ASN.1
object content octets, builds a full DER encoding from it, then feeds
the entire thing back through the DER to ASN.1 object conversion. Rather
than doing this crazy dance, provide an t2i_ASN1_OBJECT_internal() function
that converts the text to ASN.1 object content octets, then creates a new
ASN1_OBJECT and attaches the content octets to it.

ok inoguchi@ tb@
lib/libcrypto/asn1/a_object.c
lib/libcrypto/asn1/asn1_locl.h
lib/libcrypto/objects/obj_dat.c