structure reference counter read-only access

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

structure reference counter read-only access

Ales Stibal
Hello list,
how one can access OpenSSL structure reference counter
using new API, please?

My intention is not to change it, I am interested
in reading that value only, for debugging purposes.

For example,|I am looking for something like this:||||

const||int X509_get_ref(X509 *a);

... which returns current reference counter of 'a'.

Maybe I am missing something.

Thanks,
Ales|

||

|
|


Reply | Threaded
Open this post in threaded view
|

Re: structure reference counter read-only access

Matt Caswell-2


On 12/08/2019 10:01, Astib wrote:

> Hello list,
> how one can access OpenSSL structure reference counter
> using new API, please?
>
> My intention is not to change it, I am interested
> in reading that value only, for debugging purposes.
>
> For example,|I am looking for something like this:||||
>
> const||int X509_get_ref(X509 *a);
>
> ... which returns current reference counter of 'a'.
>
> Maybe I am missing something.

This counter is considered internal data and is therefore not accessible via the
API.

Matt

Reply | Threaded
Open this post in threaded view
|

Re: structure reference counter read-only access

Ales Stibal
Hi Matt,
thank you for response. I understand it's internal data.
This is why I was looking for function which returns its value,
without really exposing it outside.

In my case it helped me many times to see reference counter to
troubleshoot leaks and features of my project.
Compared to enabling traces and other debugs, reference counters
stats are cheap way to see if there is something happening or not.

Maybe ... could you please consider to expose this integer via API?
If so, I am prepared to help and contribute a patch for that.

Thanks,
Ales

On 12. 08. 19 12:09, Matt Caswell wrote:

>
>
> On 12/08/2019 10:01, Astib wrote:
>> Hello list,
>> how one can access OpenSSL structure reference counter
>> using new API, please?
>>
>> My intention is not to change it, I am interested
>> in reading that value only, for debugging purposes.
>>
>> For example,|I am looking for something like this:||||
>>
>> const||int X509_get_ref(X509 *a);
>>
>> ... which returns current reference counter of 'a'.
>>
>> Maybe I am missing something.
>
> This counter is considered internal data and is therefore not accessible via the
> API.
>
> Matt
>