fixed OID encoding
authorMartin Willi <martin@strongswan.org>
Fri, 17 Apr 2009 08:28:53 +0000 (08:28 -0000)
committerMartin Willi <martin@strongswan.org>
Fri, 17 Apr 2009 08:28:53 +0000 (08:28 -0000)
src/libstrongswan/asn1/asn1.c

index d020be0..fa614ef 100644 (file)
@@ -238,7 +238,7 @@ chunk_t asn1_build_known_oid(int n)
        oid = chunk_alloc(2 + i);
        oid.ptr[0] = ASN1_OID;
        oid.ptr[1] = i;
-
+       
        do
        {
                if (oid_names[n].level >= i)
@@ -246,7 +246,7 @@ chunk_t asn1_build_known_oid(int n)
                        n--;
                        continue;
                }
-               oid.ptr[--i] = oid_names[n--].octet;
+               oid.ptr[--i + 2] = oid_names[n--].octet;
        }
        while (i > 0);