[openssl-users] M_ASN1_D2I_* replacement in OpenSSL 1.1.0

Dr. Stephen Henson steve at openssl.org
Thu Sep 8 19:23:56 UTC 2016

On Thu, Sep 08, 2016, Aleksandr Konstantinov wrote:

> Hello all,
> I'm in process of porting our project to OpenSSL 1.1.0. We have part of
> code which heavily uses M_ASN1_D2I_* and M_ASN1_I2D_* for defining d2i_*
> and i2d_* methods for new extension. For example code uses M_ASN1_D2I_vars,
> M_ASN1_D2I_Init and M_ASN1_D2I_start_sequence to start reading sequence of
> items and then proceeds with M_ASN1_D2I_get_* for content of the
> sequence. Could please anybody advise what would be proper replacement for
> those macros in OpenSSL 1.1.0? Is there any new API for such things? Or
> shall one do raw byte banging?

Those old macros were updated way back in OpenSSL 0.9.7 and finally retired in
OpenSSL 1.1.0.

You need to write an appropriate ASN.1 module to encode and decode your
structure. There are many examples of this such as in crypto/cms/cms_asn1.c
and some much simpler ones in crypto/x509v3 which are perhaps better suited to
you needs.

They use macros which start with ASN1_SEQUENCE*

Is it possible to look at your old code? Then I could give some more specific

Dr Stephen N. Henson. OpenSSL project core developer.
Commercial tech support now available see: http://www.openssl.org

More information about the openssl-users mailing list