added OID_EC_PUBLIC_KEY algorithmIdentifier
authorAndreas Steffen <andreas.steffen@strongswan.org>
Thu, 27 Aug 2009 14:07:59 +0000 (16:07 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Thu, 27 Aug 2009 14:07:59 +0000 (16:07 +0200)
src/libstrongswan/asn1/asn1.c

index df922c5..0a585dc 100644 (file)
@@ -43,23 +43,24 @@ const chunk_t ASN1_INTEGER_2 = chunk_from_buf(ASN1_INTEGER_2_str);
  */
 chunk_t asn1_algorithmIdentifier(int oid)
 {
-       chunk_t null;
+       chunk_t parameters;
        
-       /* some algorithmIdentifiers have an appended NULL */
+       /* some algorithmIdentifiers have a NULL parameters field and some do not */
        switch (oid)
        {
+               case OID_EC_PUBLICKEY:
                case OID_ECDSA_WITH_SHA1:
                case OID_ECDSA_WITH_SHA224:
                case OID_ECDSA_WITH_SHA256:
                case OID_ECDSA_WITH_SHA384:
                case OID_ECDSA_WITH_SHA512:
-                       null = chunk_empty;
+                       parameters = chunk_empty;
                        break;
                default:
-                       null = asn1_wrap(ASN1_NULL, "");;
+                       parameters = asn1_simple_object(ASN1_NULL, chunk_empty);
                        break;
        }
-       return asn1_wrap(ASN1_SEQUENCE, "mm", asn1_build_known_oid(oid), null);
+       return asn1_wrap(ASN1_SEQUENCE, "mm", asn1_build_known_oid(oid), parameters);
 }
 
 /*