Re: Convert ASN1_OCTET_STRING contents to ASN1 Sequence

2011-09-22 Thread Chang Lee
Nice tip. I'll look into that. On Thu, Sep 22, 2011 at 4:19 AM, Frank Morgner wrote: > On Thursday, September 22 at 08:41AM, Dominik Oepen wrote: > > > > Am 21.09.2011 23:27, schrieb Chang Lee: > > > Does anyone know of a way to take an ASN1_OCTET_STRING that contains a > > > DER encoded Seque

Re: Convert ASN1_OCTET_STRING contents to ASN1 Sequence

2011-09-22 Thread Frank Morgner
On Thursday, September 22 at 08:41AM, Dominik Oepen wrote: > > Am 21.09.2011 23:27, schrieb Chang Lee: > > Does anyone know of a way to take an ASN1_OCTET_STRING that contains a > > DER encoded Sequence and extract the contents of the Sequence as an > > ASN1_STRING. Essentially, I want to constru

Re: Convert ASN1_OCTET_STRING contents to ASN1 Sequence

2011-09-22 Thread Chang Lee
ASN1_get_object() got the job done. Thanks. On Thu, Sep 22, 2011 at 1:34 PM, Dr. Stephen Henson wrote: > On Thu, Sep 22, 2011, Chang Lee wrote: > > > Thanks for the info. I'll try to get it to work using ASN1_get_object(). > > Just for my edification, was my approach using the templates and mac

Re: Convert ASN1_OCTET_STRING contents to ASN1 Sequence

2011-09-22 Thread Dr. Stephen Henson
On Thu, Sep 22, 2011, Chang Lee wrote: > Thanks for the info. I'll try to get it to work using ASN1_get_object(). > Just for my edification, was my approach using the templates and macros not > a viable option? > Well it would work but you'd have to parse the whole structure which isn't necessar

Re: Convert ASN1_OCTET_STRING contents to ASN1 Sequence

2011-09-22 Thread Chang Lee
Thanks for the info. I'll try to get it to work using ASN1_get_object(). Just for my edification, was my approach using the templates and macros not a viable option? On Thu, Sep 22, 2011 at 12:22 PM, Dr. Stephen Henson wrote: > On Thu, Sep 22, 2011, Chang Lee wrote: > > > I'm trying to parse the

Re: Convert ASN1_OCTET_STRING contents to ASN1 Sequence

2011-09-22 Thread Dr. Stephen Henson
On Thu, Sep 22, 2011, Chang Lee wrote: > I'm trying to parse the content of an ASN1_OCTET_STRING, which I know/expect > to be a DER encoded SEQUENCE, into an object. I need to do this because I'm > trying to verify an Authenticode signature. I need to generate a digest of > the contents of the s

Re: Convert ASN1_OCTET_STRING contents to ASN1 Sequence

2011-09-22 Thread Chang Lee
I'm trying to parse the content of an ASN1_OCTET_STRING, which I know/expect to be a DER encoded SEQUENCE, into an object. I need to do this because I'm trying to verify an Authenticode signature. I need to generate a digest of the contents of the signedData sans the type & length bytes. Now gene

Re: Convert ASN1_OCTET_STRING contents to ASN1 Sequence

2011-09-22 Thread Michael S. Zick
On Thu September 22 2011, Chang Lee wrote: > Thanks Dominik for the tip. Actually, I have been poring over the OpenSSL > code, though we're using the 0.9.8 branch, hoping to find a built-in > primitive SEQUENCE to use but to no avail. As you say, there are templates > for primitives and I looked

Re: Convert ASN1_OCTET_STRING contents to ASN1 Sequence

2011-09-22 Thread Dr. Stephen Henson
On Thu, Sep 22, 2011, Chang Lee wrote: > Thanks Dominik for the tip. Actually, I have been poring over the OpenSSL > code, though we're using the 0.9.8 branch, hoping to find a built-in > primitive SEQUENCE to use but to no avail. As you say, there are templates > for primitives and I looked at

Re: Convert ASN1_OCTET_STRING contents to ASN1 Sequence

2011-09-22 Thread Dr. Stephen Henson
On Thu, Sep 22, 2011, Dominik Oepen wrote: > > However, I'm not exactly sure whether or not the ASN1 subsystem is meant > to be used outside of OpenSSL. I couldn't find a lot of documentation > about it and learned how to use it by reading the source. Maybe one of > the OpenSSL developers could c

Re: Convert ASN1_OCTET_STRING contents to ASN1 Sequence

2011-09-22 Thread Chang Lee
Thanks Dominik for the tip. Actually, I have been poring over the OpenSSL code, though we're using the 0.9.8 branch, hoping to find a built-in primitive SEQUENCE to use but to no avail. As you say, there are templates for primitives and I looked at how the PKCS7 was composed from those primitives

Re: Convert ASN1_OCTET_STRING contents to ASN1 Sequence

2011-09-21 Thread Dominik Oepen
Am 21.09.2011 23:27, schrieb Chang Lee: > Does anyone know of a way to take an ASN1_OCTET_STRING that contains a > DER encoded Sequence and extract the contents of the Sequence as an > ASN1_STRING. Essentially, I want to construct an ASN1 object of the > Sequence. I guess I could manually parse t

Convert ASN1_OCTET_STRING contents to ASN1 Sequence

2011-09-21 Thread Chang Lee
Does anyone know of a way to take an ASN1_OCTET_STRING that contains a DER encoded Sequence and extract the contents of the Sequence as an ASN1_STRING. Essentially, I want to construct an ASN1 object of the Sequence. I guess I could manually parse the Sequence (and deal with the different types o