Re: [openssl-users] openssl 1.1.1 opaque structures

2018-12-01 Thread Richard Levitte
Did you ever get an answer to that? There is a call BN_num_bytes(), so the fix should be this: *var = rc_vmalloc(BN_num_bytes(bn)); (*var)->l = BN_bn2bin(bn, (unsigned char *)(*var)->v); Cheers, Richard ( you should probably study include/openssl/bn.h in depth ) In message on Mon, 26

Re: [openssl-users] openssl 1.1.1 opaque structures

2018-11-26 Thread Salz, Rich via openssl-users
* I am unable to get the API to access bn->top value or any bn members in openssl 1.1.1 . Can you help me with the pointers to those APIs ? They do not exist. This is the first time someone has asked for them. You will need to open an issue on GitHub, and explain *why* you need access.

Re: [openssl-users] openssl 1.1.1 opaque structures

2018-11-26 Thread Viktor Dukhovni
> On Nov 26, 2018, at 12:45 AM, priya p wrote: > > I am trying to fix this part of code: > > int Func1 (var, bn) { > *var = rc_vmalloc(bn->top * BN_BYTES); --> Trying to fix > this. Error it throws is " error: dereferencing pointer to incomplete type". > > (*var)->l = BN_bn2b

Re: [openssl-users] openssl 1.1.1 opaque structures

2018-11-25 Thread priya p
I am trying to fix this part of code: int Func1 (var, bn) { *var = rc_vmalloc(bn->top * BN_BYTES); --> Trying to fix this. Error it throws is " error: dereferencing pointer to incomplete type". (*var)->l = BN_bn2bin(bn, (unsigned char *)(*var)->v); . . } Thanks, Priya On Mon,

Re: [openssl-users] openssl 1.1.1 opaque structures

2018-11-25 Thread Viktor Dukhovni
> On Nov 26, 2018, at 12:14 AM, priya p wrote: > > I am unable to get the API to access bn->top value or any bn members in > openssl 1.1.1 . > Can you help me with the pointers to those APIs ? What actual problem are you trying to solve? Accessing bn->top is a goal in itself. -- Vik

Re: [openssl-users] openssl 1.1.1 opaque structures

2018-11-25 Thread priya p
Hi Richard, I am unable to get the API to access bn->top value or any bn members in openssl 1.1.1 . Can you help me with the pointers to those APIs ? And I dont see "lh_OPENSSL_CSTRING_new " function in "include/openssl/safestack.h" ? Please correct me if I am wrong . Thanks, Priya On Sun, 2

Re: [openssl-users] openssl 1.1.1 opaque structures

2018-11-24 Thread Richard Levitte
(that was Rich responding, not Matt ;-)) There are penty of functions to assign values properly to BIGNUMs without having to resort to accessing the structure members. If you still have reasons to do so, that sounds like you want to modify the API somehow, and since you do have access to the Open

Re: [openssl-users] openssl 1.1.1 opaque structures

2018-11-24 Thread priya p
Hi Matt, I want to get/set BIGNUM structure members using API like DH getter/setter ? Thanks, Priya On Sun, Nov 25, 2018, 9:32 AM Salz, Rich via openssl-users < openssl-users@openssl.org wrote: > >- BIGNUM structure also has been made opaque. How to refer the members >of BIGNUM structur

Re: [openssl-users] openssl 1.1.1 opaque structures

2018-11-24 Thread Salz, Rich via openssl-users
* BIGNUM structure also has been made opaque. How to refer the members of BIGNUM structure like bn->top ? You cannot. That is the definition of “opaque structure.” :) Why do you need to access “top” ? * And I don't see this API implementation ""lh_OPENSSL_CSTRING_new" in openssl-1.1.

Re: [openssl-users] openssl 1.1.1 opaque structures

2018-11-24 Thread priya p
Thanks Matt and Richard. BIGNUM structure also has been made opaque. How to refer the members of BIGNUM structure like bn->top ? And I don't see this API implementation ""lh_OPENSSL_CSTRING_new" in openssl-1.1.1 ? Is it removed ? Thanks, Priya On Fri, 23 Nov 2018 at 16:59, Richard Levitte wrot

Re: [openssl-users] openssl 1.1.1 opaque structures

2018-11-23 Thread Richard Levitte
In message on Fri, 23 Nov 2018 10:33:48 +, openssl-users-requ...@openssl.org said: > Hi, > > In this snippet, > >DH *dh; > if ((dh->g = BN_new()) == NULL)-> 1 > goto end; > if (!BN_set_word(dh->g, g)) -

Re: [openssl-users] openssl 1.1.1 opaque structures

2018-11-23 Thread Matt Caswell
On 23/11/2018 10:33, priya p wrote: > 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; >

Re: [openssl-users] openssl 1.1.1 opaque structures

2018-11-23 Thread priya p
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; Here as we can't reference dh structure members directly, how can

Re: [openssl-users] openssl 1.1.1 opaque structures

2018-11-20 Thread priya p
Thanks Matt and Michael. On Tue, 20 Nov 2018 at 20:59, Matt Caswell wrote: > > > On 20/11/2018 15:27, Michael Richardson wrote: > > priya p wrote: > > > In openssl-1.1.1, few structures have been made opaque like > HMAC_CTX, > > > EVP_CIPHER_CTX etc., > > > > > There are new API to

Re: [openssl-users] openssl 1.1.1 opaque structures

2018-11-20 Thread Matt Caswell
On 20/11/2018 15:27, Michael Richardson wrote: > priya p wrote: > > In openssl-1.1.1, few structures have been made opaque like HMAC_CTX, > > EVP_CIPHER_CTX etc., > > > There are new API to get and set those structure members. But to > > zeroize those structure members in place

Re: [openssl-users] openssl 1.1.1 opaque structures

2018-11-20 Thread Michael Richardson
priya p wrote: > In openssl-1.1.1, few structures have been made opaque like HMAC_CTX, > EVP_CIPHER_CTX etc., > There are new API to get and set those structure members. But to > zeroize those structure members in place, I dont see any API. "in place", do you mean because you've

Re: [openssl-users] openssl 1.1.1 opaque structures

2018-11-20 Thread Matt Caswell
On 20/11/2018 06:49, priya p wrote: > Hi, > > In openssl-1.1.1, few structures have been made opaque like HMAC_CTX, > EVP_CIPHER_CTX etc., > There are new API to get and set those structure members. But to zeroize those > structure members in place, I dont see any API. > Eg : DH strcuture has m