On 15 Jul 2013, at 4:24 PM, jimits10 wrote:
> i have a custom extension with test oid 1.2.3.4.5. I try to extract the oid
> data in the following manner:
[....]
> On investigating i found that ASN1 String was encoded in the form that it
> had 04 at the start to denote ASN1 coding followed by the length of the
> bytes and later my json string. However ASN!_get_object was taking 04 to be
> a tag value and stripping it off but was not stripping off the length which
> gave me a .@ extra at the start. How do i solve this problem? Is it
> necessary that ASN1 String has to have to a tag? Am I decoding the extension
> value correctly?

As I understand it, ASN1_get_object just reads the header of an arbitrary 
object, and doesn't parse the inside at all. You'd need to look at the tag to 
know how to interpret the stuff in octet_str_data. Presumably if the data is 
what you expect, it's one of the string types. I'm not sure what the easiest 
way to parse it is, maybe ASN1_item_d2i().


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to