migration from openssl 1.0.2n to 1.1.1

Matt Caswell matt at openssl.org
Mon Apr 8 13:42:15 UTC 2019



On 08/04/2019 08:26, Chethan Kumar wrote:
> Dear all,
> 
>  
> 
> We did openssl version upgrade from 1.0.2n to 1.1.1. While compiling some
> package dependent on openssl, getting errors related to M_ASN1_ D2I AND I2D
> functions.
> 
> Digging deeper got to know that, in latest openssl asn1_mac.h header is deprecated.
> 
> Can someone please help me out in knowing what are changes to be done to make it
> work.?

It looks like you are using the very old ASN1 macros. These were replaced with
the current ASN1 code in 2002 - and then removed completely in 1.1.0.

Are you reading/writing custom ASN.1 structures? If so then you'll need to
update to use the new code. To see some examples take a look at the many ASN.1
structures defined in x509v3.h with matching "DECLARE_ASN1_FUNCTIONS" macro
calls to declare the i2d/d2i function to write/read them. Internally to OpenSSL
there are matching IMPLEMENT_ASN1_FUNCTIONS calls to provide the implementations
for these.

For example see this definition of an ASN.1 structure in the OpenSSL code:

https://github.com/openssl/openssl/blob/e9cfa192019574a75fbeca4811c10635a9049381/crypto/x509/x_x509a.c#L26-L34


The IMPLEMENT_ASN1_FUNCTIONS macro shown there results in the functions
described on this page being available:

https://www.openssl.org/docs/man1.1.1/man3/d2i_X509_CERT_AUX.html


Hope that helps,

Matt


More information about the openssl-users mailing list