Re: openssl 1.1.1 opaque structures

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

 



In message <mailman.6072.1542969228.21411.openssl-users@xxxxxxxxxxx> on Fri, 23 Nov 2018 10:33:48 +0000, openssl-users-request@xxxxxxxxxxx said:

> Hi,
> 
> In this snippet,
> 
>        DH *dh;
>               if ((dh->g = BN_new()) == NULL)-------------> 1
>                      goto end;
>              if (!BN_set_word(dh->g, g)) -----------------------> 2
>                       goto end;

    DH *dh;
    BIGNUM *bn_g;

    if ((bn_g= BN_new()) == NULL)
        goto end;
    if (!BN_set_word(bn_g, g))
        goto end;
    if (!DH_set0_pqg(dh, NULL, NULL, bn_g))
        goto end;

Note that if the p parameter hasn't been set in dh, you must give that
one too, so essentially, this is safer:

    if (!DH_set0_pqg(dh, bn_p, NULL, bn_g))
        goto end;

See the manual pages for DH_set0_pqg and DH_get0_pqg

Cheers,
Richard

-- 
Richard Levitte         levitte@xxxxxxxxxxx
OpenSSL Project         http://www.openssl.org/~levitte/
-- 
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users



[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