M_ASN1_D2I_* replacement in OpenSSL 1.1.0

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

 



Hello,


Thanks. Your answer helped a lot and I'm progressing now. Could You please
also give me a hint what M_ASN1_BIT_STRING_dup/ASN1_BIT_STRING_dup could be
replaced with?


Best regards,


A.K.


On Fri, Sep 9, 2016 at 2:44 PM, Dr. Stephen Henson <steve at openssl.org>
wrote:

> On Fri, Sep 09, 2016, Aleksandr Konstantinov wrote:
>
> > Hello,
> >
> > Thanks for your answer. Here is one of d2i functions simplified:
> >
> > MYEXT * d2i_MYEXT(MYEXT ** myext, unsigned char ** pp, long length) {
> >   M_ASN1_D2I_vars(myext, MYEXT *, MYEXT_new);
> >   M_ASN1_D2I_Init();
> >   M_ASN1_D2I_start_sequence();
> >   M_ASN1_D2I_get_EXP_opt(ret->intmember, d2i_ASN1_INTEGER, 1);
> >   M_ASN1_D2I_get_opt(ret->intmember, d2i_ASN1_INTEGER, V_ASN1_INTEGER);
> >   M_ASN1_D2I_Finish(myext, MYEXT_free, ASN1_F_D2I_MYEXT);
> > }
> >
> >
>
> Presumably the two fields aren't the same? I'll call one intmember2 for
> this example.
>
> The above would translate to something like:
>
> ASN1_SEQUENCE(MYEXT) = {
>         ASN1_EXP_OPT(MYEXT, intmember, ASN1_INTEGER, 1),
>         ASN1_OPT(MYEXT, intmember2, ASN1_INTEGER)
> } ASN1_SEQUENCE_END(MYEXT)
>
> IMPLEMENT_ASN1_FUNCTIONS(MYEXT)
>
> Then you include:
>
> DECLARE_ASN1_FUNCTIONS(MYEXT)
>
> in a header file.
>
> That generates four functions MYEXT_new(), MYEXT_free(), d2i_MYEXT() and
> i2d_MYEXT().
>
> Steve.
> --
> Dr Stephen N. Henson. OpenSSL project core developer.
> Commercial tech support now available see: http://www.openssl.org
> --
> openssl-users mailing list
> To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mta.openssl.org/pipermail/openssl-users/attachments/20160919/084a7ea5/attachment.html>


[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