Forgotten in previous commit.

This commit is contained in:
jca 2013-10-24 15:43:57 +00:00
parent 3df624f906
commit 2f973448f4

View File

@ -0,0 +1,75 @@
$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 16:58:22 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",
+ {
+ 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",
+ {
+ 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",
+ {
+ 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",
+ {
+ 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",
+ {
+ 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)
{