[gnutls-devel] [PATCH] don't use gnulib error.h in tests/chainverify.c

Jérémie Courrèges-Anglas jca at wxcvbn.org
Thu Oct 24 17:56:32 CEST 2013


Hi,

the subject says it all.  Patch against the latest (3.2.5) version.
All regress tests succeed on OpenBSD-current/i386, except
tests/mini-deflate.c which fails with EAGAIN.

Please let me know if you commit this.  I'm not suscribed to the list.

$OpenBSD: patch-tests_chainverify_c,v 1.1 2013/10/24 15:43:57 jca Exp $
--- tests/chainverify.c.orig	Thu Oct 24 16:52:57 2013
+++ tests/chainverify.c	Thu Oct 24 17:52:58 2013
@@ -26,7 +26,6 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <error.h>
 #include <string.h>
 
 #include <gnutls/gnutls.h>
@@ -836,8 +835,11 @@ doit (void)
 
           ret = gnutls_x509_crt_init (&certs[j]);
           if (ret < 0)
-            error (EXIT_FAILURE, 0, "gnutls_x509_crt_init[%d,%d]: %s",
-                   (int) i, (int) j, gnutls_strerror (ret));
+	    {
+	      fprintf (stderr, "gnutls_x509_crt_init[%d,%d]: %s",
+		       (int) i, (int) j, gnutls_strerror (ret));
+	      exit (EXIT_FAILURE);
+	    }
 
           tmp.data = (unsigned char *) chains[i].chain[j];
           tmp.size = strlen (chains[i].chain[j]);
@@ -846,8 +848,11 @@ doit (void)
           if (debug > 2)
             printf ("done\n");
           if (ret < 0)
-            error (EXIT_FAILURE, 0, "gnutls_x509_crt_import[%d,%d]: %s",
-                   (int) i, (int) j, gnutls_strerror (ret));
+	    {
+	      fprintf (stderr, "gnutls_x509_crt_import[%d,%d]: %s",
+		       (int) i, (int) j, gnutls_strerror (ret));
+	      exit (EXIT_FAILURE);
+	    }
 
           gnutls_x509_crt_print (certs[j], GNUTLS_CRT_PRINT_ONELINE, &tmp);
           if (debug)
@@ -860,16 +865,22 @@ doit (void)
 
       ret = gnutls_x509_crt_init (&ca);
       if (ret < 0)
-        error (EXIT_FAILURE, 0, "gnutls_x509_crt_init: %s",
-               gnutls_strerror (ret));
+      {
+	fprintf (stderr, "gnutls_x509_crt_init: %s",
+		 gnutls_strerror (ret));
+	exit (EXIT_FAILURE);
+      }
 
       tmp.data = (unsigned char *) *chains[i].ca;
       tmp.size = strlen (*chains[i].ca);
 
       ret = gnutls_x509_crt_import (ca, &tmp, GNUTLS_X509_FMT_PEM);
       if (ret < 0)
-        error (EXIT_FAILURE, 0, "gnutls_x509_crt_import: %s",
-               gnutls_strerror (ret));
+	{
+	  fprintf (stderr, "gnutls_x509_crt_import: %s",
+		   gnutls_strerror (ret));
+	  exit (EXIT_FAILURE);
+	}
 
       if (debug > 2)
         printf ("done\n");
@@ -887,8 +898,11 @@ doit (void)
                                          chains[i].verify_flags,
                                          &verify_status);
       if (ret < 0)
-        error (EXIT_FAILURE, 0, "gnutls_x509_crt_list_verify[%d,%d]: %s",
-               (int) i, (int) j, gnutls_strerror (ret));
+	{
+	  fprintf (stderr, "gnutls_x509_crt_list_verify[%d,%d]: %s",
+		   (int) i, (int) j, gnutls_strerror (ret));
+	  exit (EXIT_FAILURE);
+	}
 
       if (verify_status != chains[i].expected_verify_result)
         {



More information about the Gnutls-devel mailing list