Re: Error in M_ASN1_New_of function in openssl 1.1.0g

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 19/04/2019 10:38, Swamy J-S wrote:

> After openssl upgradation, i searched alternate function to "M_ASN1_New_Malloc"
> and i changed my code as below
> 
> DECLARE_ASN1_ALLOC_FUNCTIONS(CertInfo)
> 
> CertInfo *Poll = NULL;
> 
> Poll = M_ASN1_New_of(CertInfo)

How have you declared and implemented the CertInfo structure?

E.g. You might declare it like this:

typedef struct CertInfo_st {
    ASN1_OCTET_STRING *whatever;
} CertInfo;
DECLARE_ASN1_FUNCTIONS(CertInfo)

And then implement it something like this:

ASN1_SEQUENCE(CertInfo) = {
    ASN1_SIMPLE(CertInfo, whatever, ASN1_OCTET_STRING)
} ASN1_SEQUENCE_END(CertInfo)
IMPLEMENT_ASN1_FUNCTIONS(CertInfo)


The DECLARE_ASN1_FUNCTIONS macro also uses the DECLARE_ASN1_ALLOC_FUNCTIONS
macro so there is no need to use it separately.

Then in your code you can do something like this:

CertInfo *Poll = NULL;

Poll = CertInfo_new();


Don't use the M_ASN1_New_of macro at all.

Matt



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux