## Application accessing 'ex_kusage' ##

Narayana, Sunil Kumar sanarayana at rbbn.com
Fri Nov 13 19:10:28 UTC 2020


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 'ex_kusage' pointed by X509
But there are no set utilities available to access this variable. Only  X509_get_key_usage Is available.

Our code for 1.0.1 is as below. Please suggest the right way to achieve this.

    ASN1_BIT_STRING *usage;
662     x509->ex_kusage = 0;
663
664     if((usage=(ASN1_BIT_STRING *)X509_get_ext_d2i(x509, NID_key_usage, NULL, NULL)))
665     {
666         if(usage->length > 0)
667         {
668             x509->ex_kusage = usage->data[0];
669             if(usage->length > 1)
670                 x509->ex_kusage |= usage->data[1] << 8;
671         }
672         else
673             x509->ex_kusage = 0;
674         ASN1_BIT_STRING_free(usage);
675     }

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/20201113/26ac67c9/attachment.html>


More information about the openssl-users mailing list