<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
h3
        {mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:13.5pt;
        font-family:"Times New Roman";
        font-weight:bold;}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
pre
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
tt
        {font-family:"Courier New";}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:Arial;
        color:navy;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple style='word-wrap: break-word;
-khtml-nbsp-mode: space;-khtml-line-break: after-white-space'>

<div class=Section1>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Rob,<o:p></o:p></span></font></p>

<p style='margin:0in;margin-bottom:.0001pt'><font size=2 face=Verdana><span
style='font-size:10.0pt;font-family:Verdana'><a
href="http://www.columbia.edu/~ariel/ssleay/layman.html">http://www.columbia.edu/~ariel/ssleay/layman.html</a><o:p></o:p></span></font></p>

<h3><b><font size=4 face="Times New Roman"><span style='font-size:13.5pt'>6.2.4
RelativeDistinguishedName<o:p></o:p></span></font></b></h3>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>The three </span></font><tt><font size=2 face="Courier New"><span
style='font-size:10.0pt'>RelativeDistinguishedName</span></font></tt> values
are <tt><font size=2 face="Courier New"><span style='font-size:10.0pt'>SET OF</span></font></tt>
values, so their DER encodings follow the <b><span style='font-weight:bold'>constructed,
definite-length method:</span></b> <o:p></o:p></p>

<pre><font size=2 face="Courier New"><span style='font-size:10.0pt'>31 0b<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>&nbsp;&nbsp; 30 09 ... 55 53<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>31 1d<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>&nbsp;&nbsp; 30 1b ... 6f 6e<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>31 14<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>&nbsp;&nbsp; 30 12 ... 20 31<o:p></o:p></span></font></pre>

<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>The
identifier octets follow the low-tag-number form, since the tag for </span></font><tt><font
size=2 face="Courier New"><span style='font-size:10.0pt'>SET OF</span></font></tt>,
17 (decimal), is between 0 and 30. Bits 8 and 7 have value &quot;0&quot; since <tt><font
size=2 face="Courier New"><span style='font-size:10.0pt'>SET OF</span></font></tt>
is in the universal class <b><span style='font-weight:bold'>Bit 6 has value
&quot;1&quot; since the encoding is constructed.</span></b> The lengths octets follow
the short form, and the contents octets are the DER encodings of the respective
<tt><font size=2 face="Courier New"><span style='font-size:10.0pt'>AttributeValueAssertion
values</span></font></tt>, since there is only one value in each set. <o:p></o:p></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>What do you think?&nbsp; Does changing 160
to ANS1ExplicitContextValueConstructed fix things? &nbsp;I suppose that we
could also, if it makes sense, extend the ECV functionality to include handling
multiple values if bit 6 = 1 and eliminate some duplication of code (i.e. isPrimitive,
but does isPrimitive make sense for ECVC?)<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Ron<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
cryptography-bounces@lists.squeakfoundation.org
[mailto:cryptography-bounces@lists.squeakfoundation.org] <b><span
style='font-weight:bold'>On Behalf Of </span></b>Ron Teitelbaum<br>
<b><span style='font-weight:bold'>Sent:</span></b> Wednesday, March 21, 2007
12:59 PM<br>
<b><span style='font-weight:bold'>To:</span></b> 'Cryptography Team Development
List'; 'Robert Withers'<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [Cryptography Team]
Debugging SSL on Linux</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Rob,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I think what we have is a <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p style='margin:0in;margin-bottom:.0001pt'><font size=2 face=Verdana><span
style='font-size:10.0pt;font-family:Verdana'>3.2 Constructed, definite-length
method<o:p></o:p></span></font></p>

<p style='margin:0in;margin-bottom:.0001pt'><font size=2 face=Verdana><span
style='font-size:10.0pt;font-family:Verdana'>This method applies to simple string
types, structured types, types derived<o:p></o:p></span></font></p>

<p style='margin:0in;margin-bottom:.0001pt'><font size=2 face=Verdana><span
style='font-size:10.0pt;font-family:Verdana'>simple string types and structured
types by implicit tagging, and types derived<o:p></o:p></span></font></p>

<p style='margin:0in;margin-bottom:.0001pt'><font size=2 face=Verdana><span
style='font-size:10.0pt;font-family:Verdana'>from anything by explicit tagging.
It requires that the length of the value be<o:p></o:p></span></font></p>

<p style='margin:0in;margin-bottom:.0001pt'><font size=2 face=Verdana><span
style='font-size:10.0pt;font-family:Verdana'>known in advance. The parts of the
BER encoding are as follows:<o:p></o:p></span></font></p>

<p style='margin:0in;margin-bottom:.0001pt'><font size=2 face=Verdana><span
style='font-size:10.0pt;font-family:Verdana'>Identifier octets. As described in
Section 3.1, except that bit 6 has value &quot;1,&quot;<o:p></o:p></span></font></p>

<p style='margin:0in;margin-bottom:.0001pt'><font size=2 face=Verdana><span
style='font-size:10.0pt;font-family:Verdana'>indicating that the encoding is
constructed.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>The value 160 (1 in bit 6) should be
considered a Constructed, Definite-length field. &nbsp;I&#8217;m still
researching it but it would seem to me that this is how you define a user
object within a value.&nbsp; Instead of having a primitive data type within an explicit
context value you have a constructed data type (in our world an object with
ivars).<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I&#8217;m still reading but I think that
we may be able to replace 160 with ASN1ExplicitContextValueConstructed that has
a definite length and holds the values in a sequence.&nbsp; Do you have the
actual ANS.1 definition for this extension?&nbsp; I&#8217;d be interested if it
says that it&#8217;s explicit constructed.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Ron<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
cryptography-bounces@lists.squeakfoundation.org
[mailto:cryptography-bounces@lists.squeakfoundation.org] <b><span
style='font-weight:bold'>On Behalf Of </span></b>Robert Withers<br>
<b><span style='font-weight:bold'>Sent:</span></b> Tuesday, March 20, 2007 9:22
PM<br>
<b><span style='font-weight:bold'>To:</span></b> Ron@USMedRec.com<br>
<b><span style='font-weight:bold'>Cc:</span></b> 'Cryptography Team Development
List'; 'Norbert Hartl'<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [Cryptography Team]
Debugging SSL on Linux</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Ron,<o:p></o:p></span></font></p>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>I just want to reiterate that by not preserving the original bytes when
decoding, we are forced to re-encode to check signatures.&nbsp; With that
comment out of the way...<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>First, I turned off CertificateExtension decoding and republished, so
the latest code should now work.&nbsp; I couldn't get it to work...<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Second, this is long in the tooth...&nbsp;&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>I am referring to the ASN1 book by Olivier Dubuisson, which you had
referred me to at one point so I think you have access to this pdf.<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Per Figure 18.2 on page 396, we are using the ASN1ExplicitContextValue
to wrap APPLICATION {01cttttt}, Context-specific {10cttttt} and PRIVATE
{11cttttt} values - tags 6 and 7.&nbsp; They can be Primitive (Implicit) or
Constructed (Explicit) - tag 5.&nbsp; This specific example is using Explicit
Context-specific [0] (see page 409, section 18.2.16 Tagged value, where the
value of the Explicit triplet is itself one triplet).<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Now, this section just named refers to page 216, which is the chapter
on Constructed values.&nbsp; I just scanned it and it
seems&nbsp;necessary&nbsp;to define structures as a SEQUENCE, with no
&quot;implicit&quot; structures - i.e. they don't seem to define a
Context-specific type that can hold more than one Triplet without embedding it
in a SEQUENCE.<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>So, here is the type definition for an Extension:<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Extension&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; ::=&nbsp;&nbsp; SEQUENCE {<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;&nbsp; extnId&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
EXTENSION.&amp;id ({ExtensionSet}),<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;&nbsp; critical&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; BOOLEAN DEFAULT
FALSE,<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;&nbsp; extnValue&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; OCTET STRING }<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -- contains a
DER encoding of a value of type<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>and the problem we are having is by trying to DER decode the extnValue field.&nbsp;
Here is the full data for that field, both raw and parsed with hex values:<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>#(48 50 130 16 104 111 109 101 46 115 101 108 102 105 115 104 46 111
114 103 160 30 6 8 43 6 1 5 5 7 8 5 160 18 12 16 104 111 109 101 46 115 101 108
102 105 115 104 46 111 114 103) asByteArray<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>SEQUENCE = T(30) L(32) V( <o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><span class=apple-tab-span><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></font></span>Implicit&nbsp;[2] =&nbsp;T(82) L(10) V(68 6F 6D 65 2E 73
65 6C 66 69 73 68 2E 6F 72 67) <o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span class=apple-tab-span><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></font></span>Explicit&nbsp;[0] =&nbsp;T(A0) L(1E) V(<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span class=apple-tab-span><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></font></span>OID =&nbsp;T(06) L(08) V(2B 06 01 05 05 07 08 05) <o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span class=apple-tab-span><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></font></span>Explicit [0] =&nbsp;T(A0) L(12) V(<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span class=apple-tab-span><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></font></span>String = T(0C) L(10) V(68 6F 6D 65 2E 73 65 6C 66 69 73 68
2E 6F 72 67))))<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>The outer is a SEQUENCE and is ok.&nbsp; Inside, at the value of the
first Explicit [0] Triplet, it is not a SEQUENCE, but it has 2 Triplets inside
of it.&nbsp; Looking at its Length (1E), it thinks it should be holding both
Triplets.<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>The&nbsp;code is only grabbing the first Triplet when decoding an
Explicit [0], and then the outer Sequence is decoding the second inner Triplet,
so I actually get:<o:p></o:p></span></font></p>

</div>

<div style='min-height: 14px'>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Sequence (<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><span class=apple-tab-span><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></font></span>Implicit [2]<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span class=apple-tab-span><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></font></span>Explicit [0] (OID)<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span class=apple-tab-span><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></font></span>Explicit [0] (String))<o:p></o:p></p>

</div>

<div style='min-height: 14px'>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>instead of:<o:p></o:p></span></font></p>

</div>

<div style='min-height: 14px'>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Sequence (<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><span class=apple-tab-span><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></font></span>Implicit [2]<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span class=apple-tab-span><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></font></span>Explicit [0] (<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span class=apple-tab-span><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></font></span>OID<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span class=apple-tab-span><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></font></span>Explicit [0]))<o:p></o:p></p>

</div>

<div style='min-height: 14px'>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>the corresponding length is messed up when I re-encode it.<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>That's funny, as we agree.&nbsp; I'll post to the ASN1 list...<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>later,<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Rob<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>On Mar 20, 2007, at 4:30 PM, Ron Teitelbaum wrote:<o:p></o:p></span></font></p>

</div>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
class=apple-style-span><span style='border-spacing: 0px 0px;text-align:auto;
-khtml-text-decorations-in-effect: none;-apple-text-size-adjust: auto;
orphans: 2;widows: 2;word-spacing:0px'><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'>So it&#8217;s an explicit
cv holding onto an explicit cv and another value.&nbsp; Notice the problem goes
back even further and happens twice for this extension.&nbsp; So assuming that
this problem matches with the asn rules then can we say that we encode, for
size only, the content of an explicit contenxt value as a collection when the
element size doesn&#8217;t match the first size.&nbsp; &nbsp;</span></span></font><font
color=black><span style='color:black'><o:p></o:p></span></font></span></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
class=apple-style-span><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'>So encode is</span></font></span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
class=apple-style-span><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
checkValueSize against next item and set value to collection if necessary, then
decode until size is reached.</span></font></span><font color=black><span
style='color:black'><o:p></o:p></span></font></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
class=apple-style-span><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'>And decode is</span></font></span><font
color=black><span style='color:black'><o:p></o:p></span></font></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
class=apple-style-span><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
If value is collection then encode items in collection and then set size from
encoded values.</span></font></span><font color=black><span style='color:black'><o:p></o:p></span></font></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
class=apple-style-span><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'>I still want to check the
docs but I&#8217;m guessing that I just missed this possibility.&nbsp;</span></font></span><font
color=black><span style='color:black'><o:p></o:p></span></font></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
class=apple-style-span><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'>Since the ECV is just a
wrapper for the tag number, (and your isPrimitive flag), would this cause any
other problems?</span></font></span><font color=black><span style='color:black'><o:p></o:p></span></font></p>

</div>

</div>

</div>

</div>

</div>

</div>

</body>

</html>