Hi ,<br> Thanks a lot for your great help.<br><br>>The DN "C=CH, O=strongswan, CN=iss" in proper encoding<br><br>Is there any OpenSSL API to encode/convert DN in ASCII string to DN in DER format to verify the same?<br>
<br>Regards,<br>Saravanan N<br><br><div class="gmail_quote">On Fri, Nov 2, 2012 at 7:38 AM, Tobias Brunner <span dir="ltr"><<a href="mailto:tobias@strongswan.org" target="_blank">tobias@strongswan.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
Thanks for the keys.<br>
<div class="im"><br>
> It's sending a valid IDi payload with<br>
</div>> proper identification data.<br>
<br>
It isn't. The encoding of the IDi payload looks like this:<br>
<br>
0000 25 00 00 22 09 00 00 00 43 3d 43 48 2c 20 4f 3d %.."....C=CH, O=<br>
0010 73 74 72 6f 6e 67 73 77 61 6e 2c 20 43 4e 3d 69 strongswan, CN=i<br>
0020 73 73 ss<br>
<br>
The type of the payload is ID_DER_ASN1_DN (0x09) but the encoding that<br>
follows starting with 0x43 is not a DER encoded ASN.1 DN but simply an<br>
ASCII string. The DN "C=CH, O=strongswan, CN=iss" in proper encoding<br>
would look like this:<br>
<br>
0: 30 30 31 0B 30 09 06 03 55 04 06 13 02 43 48 31 001.0...U....CH1<br>
16: 13 30 11 06 03 55 04 0A 13 0A 73 74 72 6F 6E 67 .0...U....strong<br>
32: 73 77 61 6E 31 0C 30 0A 06 03 55 04 03 13 03 69 swan1.0...U....i<br>
48: 73 73 ss<br>
<br>
Regards,<br>
Tobias<br>
<br>
</blockquote></div><br>