RE: set/get utilities are not available to access variable 'num' of structure bio_st (Matt Caswell)

2020-11-24 Thread Narayana, Sunil Kumar
Hi Matt,
Thanks for the reply.. we would implement as you suggested.


From: Matt Caswell 
Sent: 23 November 2020 17:12
To: Narayana, Sunil Kumar ; openssl-users@openssl.org
Subject: Re: set/get utilities are not available to access variable 'num' of 
structure bio_st (Matt Caswell)


NOTICE: This email was received from an EXTERNAL sender




On 23/11/2020 11:28, Narayana, Sunil Kumar wrote:
> Hi Matt,
>We are using  MEM type BIO. similar to the openssl
> library ‘BIO_TYPE_MEM ‘ we have an internal type defined like ex:-
> ‘BIO_TYPE_XYZ_MEM’  and all other mem utilities are internally defined.
>
> Like XYZ_mem_new/XYZ_mem_read … etc  these utilities are accessing the
> bio_st variable ‘*num’*.
>
> please suggest set/get utilities to handle this scenario.

If I understand correctly you want to store an "int" value internally to
a custom BIO.

Custom BIOs can associate an arbitrary data structure with the BIO
object and store whatever they like in it using the BIO_get_data() and
BIO_set_data() functions.

For example:

typedef struct {
int num;
} XYZ_PRIVATE_DATA;

static int XYZ_mem_new(BIO *bio)
{
XYZ_PRIVATE_DATA *data = OPENSSL_zalloc(sizeof(*data));

if (data == NULL)
return 0;

/* Store whatever you like in num */
data->num = 5;
BIO_set_data(bio, data);
}

static int XYZ_mem_free(BIO *bio)
{
XYZ_PRIVATE_DATA *data = BIO_get_data(bio);

OPENSSL_free(data);
BIO_set_data(bio, NULL);
}

static int XYZ_mem_read(BIO *bio, char *out, int outl)
{
XYZ_PRIVATE_DATA *data = BIO_get_data(bio);

/* Do the read operation and use data->num as required */
}


Matt

>
>
> Regards,
>
> Sunil
>
> *From:*openssl-users 
> mailto:openssl-users-boun...@openssl.org>> 
> *On Behalf Of
> *openssl-users-requ...@openssl.org<mailto:*openssl-users-requ...@openssl.org>
> *Sent:* 20 November 2020 23:34
> *To:* openssl-users@openssl.org<mailto:openssl-users@openssl.org>
> *Subject:* openssl-users Digest, Vol 72, Issue 19
>
>
>
> 
>
> NOTICE: This email was received from an EXTERNAL sender
>
> 
>
>
> Send openssl-users mailing list submissions to
> openssl-users@openssl.org<mailto:openssl-users@openssl.org> 
> <mailto:openssl-users@openssl.org>
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://mta.openssl.org/mailman/listinfo/openssl-users<https://mta.openssl.org/mailman/listinfo/openssl-users>
> or, via email, send a message with subject or body 'help' to
> openssl-users-requ...@openssl.org<mailto:openssl-users-requ...@openssl.org> 
> <mailto:openssl-users-requ...@openssl.org>
>
> You can reach the person managing the list at
> openssl-users-ow...@openssl.org<mailto:openssl-users-ow...@openssl.org> 
> <mailto:openssl-users-ow...@openssl.org>
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of openssl-users digest..."
>
>
> Today's Topics:
>
> 1. set/get utilities are not available to access variable
> 'num' of structure bio_st (Narayana, Sunil Kumar)
> 2. Re: set/get utilities are not available to access variable
> 'num' of structure bio_st (Matt Caswell)
> 3. EC curve preferences (Skip Carter)
> 4. RE: EC curve preferences (Michael Wojcik)
>
>
> --
>
> Message: 1
> Date: Fri, 20 Nov 2020 13:46:00 +
> From: "Narayana, Sunil Kumar" mailto:sanaray...@rbbn.com%0b>> <mailto:sanaray...@rbbn.com>>
> To: "openssl-users@openssl.org 
> <mailto:openssl-users@openssl.org><mailto:openssl-users@openssl.org%20%3cmailto:openssl-users@openssl.org%3e>"
>  <mailto:openssl-users@openssl.org<mailto:openssl-users@openssl.org%20%3cmailto:openssl-users@openssl.org>>>
> Subject: set/get utilities are not available to access variable
> 'num' of structure bio_st
> Message-ID:
> mailto:sn6pr03mb4061a9ff473de74b064a1d8db0...@sn6pr03mb4061.namprd03.prod.outlook.com%0b>>
 
<mailto:sn6pr03mb4061a9ff473de74b064a1d8db0...@sn6pr03mb4061.namprd03.prod.outlook.com>>
>
> Content-Type: text/plain; charset="utf-8"
>
> Hi ,
> We are porting our Application from openssl 1.0.1 to openssl 3.0. In
> related to this activity we require to access the variable 'num' of
> structure bio_st.
> In older versions the variable was accessed to set and get value using
> pointer operator (bi->num ).
> Since this is not allowed in 3.0 we ar

Re: set/get utilities are not available to access variable 'num' of structure bio_st (Matt Caswell)

2020-11-23 Thread Matt Caswell



On 23/11/2020 11:28, Narayana, Sunil Kumar wrote:
> Hi Matt,
>    We are using  MEM type BIO. similar to the openssl
> library ‘BIO_TYPE_MEM ‘ we have an internal type defined like ex:-
> ‘BIO_TYPE_XYZ_MEM’  and all other mem utilities are internally defined.
> 
> Like XYZ_mem_new/XYZ_mem_read … etc  these utilities are accessing the
> bio_st variable ‘*num’*.
> 
> please suggest set/get utilities to handle this scenario.

If I understand correctly you want to store an "int" value internally to
a custom BIO.

Custom BIOs can associate an arbitrary data structure with the BIO
object and store whatever they like in it using the BIO_get_data() and
BIO_set_data() functions.

For example:

typedef struct {
int num;
} XYZ_PRIVATE_DATA;

static int XYZ_mem_new(BIO *bio)
{
XYZ_PRIVATE_DATA *data = OPENSSL_zalloc(sizeof(*data));

if (data == NULL)
return 0;

/* Store whatever you like in num */
data->num = 5;
BIO_set_data(bio, data);
}

static int XYZ_mem_free(BIO *bio)
{
XYZ_PRIVATE_DATA *data = BIO_get_data(bio);

OPENSSL_free(data);
BIO_set_data(bio, NULL);
}

static int XYZ_mem_read(BIO *bio, char *out, int outl)
{
XYZ_PRIVATE_DATA *data = BIO_get_data(bio);

/* Do the read operation and use data->num as required */
}


Matt

> 
> 
> Regards,
> 
> Sunil
> 
> *From:*openssl-users  *On Behalf Of
> *openssl-users-requ...@openssl.org
> *Sent:* 20 November 2020 23:34
> *To:* openssl-users@openssl.org
> *Subject:* openssl-users Digest, Vol 72, Issue 19
> 
>  
> 
> 
> 
> NOTICE: This email was received from an EXTERNAL sender
> 
> 
> 
> 
> Send openssl-users mailing list submissions to
> openssl-users@openssl.org <mailto:openssl-users@openssl.org>
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> https://mta.openssl.org/mailman/listinfo/openssl-users
> or, via email, send a message with subject or body 'help' to
> openssl-users-requ...@openssl.org <mailto:openssl-users-requ...@openssl.org>
> 
> You can reach the person managing the list at
> openssl-users-ow...@openssl.org <mailto:openssl-users-ow...@openssl.org>
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of openssl-users digest..."
> 
> 
> Today's Topics:
> 
> 1. set/get utilities are not available to access variable
> 'num' of structure bio_st (Narayana, Sunil Kumar)
> 2. Re: set/get utilities are not available to access variable
> 'num' of structure bio_st (Matt Caswell)
> 3. EC curve preferences (Skip Carter)
> 4. RE: EC curve preferences (Michael Wojcik)
> 
> 
> --
> 
> Message: 1
> Date: Fri, 20 Nov 2020 13:46:00 +
> From: "Narayana, Sunil Kumar"  <mailto:sanaray...@rbbn.com>>
> To: "openssl-users@openssl.org <mailto:openssl-users@openssl.org>"
> mailto:openssl-users@openssl.org>>
> Subject: set/get utilities are not available to access variable
> 'num' of structure bio_st
> Message-ID:
>  <mailto:sn6pr03mb4061a9ff473de74b064a1d8db0...@sn6pr03mb4061.namprd03.prod.outlook.com>>
> 
> Content-Type: text/plain; charset="utf-8"
> 
> Hi ,
> We are porting our Application from openssl 1.0.1 to openssl 3.0. In
> related to this activity we require to access the variable 'num' of
> structure bio_st.
> In older versions the variable was accessed to set and get value using
> pointer operator (bi->num ).
> Since this is not allowed in 3.0 we are looking for the Get/Set
> utilities similar to other member (BIO_set_flags/ BIO_get_flags)
> 
> Is this not supported in 3.0 ? If yes, Please guide the proper alternatives.
> 
> Regards,
> Sunil
> 
> 
> ---
> Notice: This e-mail together with any attachments may contain
> information of Ribbon Communications Inc. that
> is confidential and/or proprietary for the sole use of the intended
> recipient. Any review, disclosure, reliance or
> distribution by others or forwarding without express permission is
> strictly prohibited. If you are not the intended
> recipient, please notify the sender immediately and then delete all
> copies, including any attachments.
> ---
> -- next part --
> An HTML att

Re: set/get utilities are not available to access variable 'num' of structure bio_st (Matt Caswell)

2020-11-23 Thread Narayana, Sunil Kumar
Hi Matt,
   We are using  MEM type BIO. similar to the openssl library 
‘BIO_TYPE_MEM ‘ we have an internal type defined like ex:- ‘BIO_TYPE_XYZ_MEM’  
and all other mem utilities are internally defined.
Like XYZ_mem_new/XYZ_mem_read … etc  these utilities are accessing the bio_st 
variable ‘num’.
please suggest set/get utilities to handle this scenario.

Regards,
Sunil
From: openssl-users  On Behalf Of 
openssl-users-requ...@openssl.org
Sent: 20 November 2020 23:34
To: openssl-users@openssl.org
Subject: openssl-users Digest, Vol 72, Issue 19


NOTICE: This email was received from an EXTERNAL sender


Send openssl-users mailing list submissions to
openssl-users@openssl.org<mailto:openssl-users@openssl.org>

To subscribe or unsubscribe via the World Wide Web, visit
https://mta.openssl.org/mailman/listinfo/openssl-users<https://mta.openssl.org/mailman/listinfo/openssl-users>
or, via email, send a message with subject or body 'help' to
openssl-users-requ...@openssl.org<mailto:openssl-users-requ...@openssl.org>

You can reach the person managing the list at
openssl-users-ow...@openssl.org<mailto:openssl-users-ow...@openssl.org>

When replying, please edit your Subject line so it is more specific
than "Re: Contents of openssl-users digest..."


Today's Topics:

1. set/get utilities are not available to access variable
'num' of structure bio_st (Narayana, Sunil Kumar)
2. Re: set/get utilities are not available to access variable
'num' of structure bio_st (Matt Caswell)
3. EC curve preferences (Skip Carter)
4. RE: EC curve preferences (Michael Wojcik)


--

Message: 1
Date: Fri, 20 Nov 2020 13:46:00 +
From: "Narayana, Sunil Kumar" mailto:sanaray...@rbbn.com>>
To: "openssl-users@openssl.org<mailto:openssl-users@openssl.org>" 
mailto:openssl-users@openssl.org>>
Subject: set/get utilities are not available to access variable
'num' of structure bio_st
Message-ID:
mailto:sn6pr03mb4061a9ff473de74b064a1d8db0...@sn6pr03mb4061.namprd03.prod.outlook.com>>

Content-Type: text/plain; charset="utf-8"

Hi ,
We are porting our Application from openssl 1.0.1 to openssl 3.0. In related to 
this activity we require to access the variable 'num' of structure bio_st.
In older versions the variable was accessed to set and get value using pointer 
operator (bi->num ).
Since this is not allowed in 3.0 we are looking for the Get/Set utilities 
similar to other member (BIO_set_flags/ BIO_get_flags)

Is this not supported in 3.0 ? If yes, Please guide the proper alternatives.

Regards,
Sunil


---
Notice: This e-mail together with any attachments may contain information of 
Ribbon Communications Inc. that
is confidential and/or proprietary for the sole use of the intended recipient. 
Any review, disclosure, reliance or
distribution by others or forwarding without express permission is strictly 
prohibited. If you are not the intended
recipient, please notify the sender immediately and then delete all copies, 
including any attachments.
---
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://mta.openssl.org/pipermail/openssl-users/attachments/20201120/f84c547a/attachment-0001.html<https://mta.openssl.org/pipermail/openssl-users/attachments/20201120/f84c547a/attachment-0001.html>>

--

Message: 2
Date: Fri, 20 Nov 2020 13:55:34 +
From: Matt Caswell mailto:m...@openssl.org>>
To: openssl-users@openssl.org<mailto:openssl-users@openssl.org>
Subject: Re: set/get utilities are not available to access variable
'num' of structure bio_st
Message-ID: 
<53108b39-21f8-dea0-c3c3-fe5517a56...@openssl.org<mailto:53108b39-21f8-dea0-c3c3-fe5517a56...@openssl.org>>
Content-Type: text/plain; charset=utf-8



On 20/11/2020 13:46, Narayana, Sunil Kumar wrote:
> Hi ,
>
> ??? We are porting our Application from ?openssl 1.0.1 to
> openssl 3.0. In related to this activity we require to access the
> variable ?*num*? of structure *bio_st. *
>
> In older versions the variable was accessed to set and get value using
> pointer operator (bi->num ).
>
> Since this is not allowed in 3.0 we are looking for the Get/Set
> utilities similar to other member*(BIO_set_flags/ BIO_get_flags) *
>
> ?
>
> Is this not supported in 3.0 ? If yes, Please guide the proper alternatives.

What kind of BIO are you using? Different BIOs may provide different
mechanisms to get hold of this value. For e