]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Add.
authorSimon Josefsson <simon@josefsson.org>
Wed, 8 Feb 2006 18:29:43 +0000 (18:29 +0000)
committerSimon Josefsson <simon@josefsson.org>
Wed, 8 Feb 2006 18:29:43 +0000 (18:29 +0000)
tests/certder.c

index a2acc36c84d02a43d125bbba8453093b5676ae1c..8487248a7bb91823624ced51c8f3c19b63d0114f 100644 (file)
@@ -164,7 +164,39 @@ doit (void)
     0x48, 0x1b, 0x51, 0x87, 0xe6, 0x85, 0xf0, 0x1e,
     0xbd, 0x99, 0x0d, 0xd3, 0x98, 0xd0, 0xab, 0xd8,
     0x30, 0x2a, 0xd5, 0x74 };
-  gnutls_datum_t derCert = { der, 1044 };
+  /* Triggers crash in _asn1_get_objectid_der. */
+  unsigned char der2[] = {
+    0x30, 0x82, 0x04, 0x10, 0x30, 0x82, 0x03, 0x79,
+    0xa0, 0x3, 0x2, 0x1, 0x2, 0x2, 0x1, 0x0, 0x30,
+    0x11, 0x6, 0x84, 0x10, 0x0, 0x0, 0x0, 0x2a,
+    0x86, 0x48, 0x86, 0xf7, 0xd, 0x1, 0x1, 0x4,
+    0x5, 0x0, 0x30, 0x81, 0xbb, 0x31, 0xb, 0x30,
+    0x9, 0x6, 0x3, 0x55, 0x4, 0x6, 0x13, 0x2,
+    0x2d, 0x2d, 0x31, 0x12, 0x30, 0x10, 0x6,
+    0x3, 0x55, 0x4, 0x8, 0x13, 0x9, 0x53,
+    0x6f, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x74,
+    0x65, 0x31, 0x11, 0x30, 0xf, 0x6, 0x3,
+    0x55, 0x4, 0x7, 0x13, 0x8, 0x53, 0x6f,
+    0x6d, 0x65, 0x43, 0x69, 0x74, 0x79,
+    0x31, 0x19, 0x30, 0x17, 0x6, 0x3, 0x55,
+    0x4, 0xa, 0x13, 0x10, 0x53, 0x6f, 0x6d,
+    0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69,
+    0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x31,
+    0x1f, 0x30, 0x1d, 0x6, 0x3, 0x55, 0x4, 0xb,
+    0x13, 0x16, 0x53, 0x6f, 0x6d, 0x65, 0x4f,
+    0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61,
+    0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x55,
+    0x6e, 0x69, 0x74, 0x31, 0x1e, 0x30, 0x1c,
+    0x6, 0x3, 0x55, 0x4, 0x3, 0x13, 0x15, 0x6c,
+    0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73,
+    0x74, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c,
+    0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x31,
+    0x29, 0x30, 0x27, 0x6, 0x9, 0x2a, 0x86,
+    0x48, 0x86, 0xf7, 0xd, 0x1, 0x9, 0x1, 0x16,
+    0x1a, 0x72 };
+
+  gnutls_datum_t derCert = { der, sizeof (der) };
+  gnutls_datum_t der2Cert = { der2, sizeof (der2) };
   gnutls_x509_crt_t cert;
 
   ret = gnutls_global_init ();
@@ -179,6 +211,10 @@ doit (void)
   if (ret != GNUTLS_E_ASN1_DER_ERROR)
     fail ("crt_import %d\n", ret);
 
+  ret = gnutls_x509_crt_import (cert, &der2Cert, GNUTLS_X509_FMT_DER);
+  if (ret != GNUTLS_E_ASN1_DER_ERROR)
+    fail ("crt2_import %d\n", ret);
+
   success ("done");
 
   gnutls_x509_crt_deinit (cert);