summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2008-02-21 12:06:13 +0100
committerSimon Josefsson <simon@josefsson.org>2008-02-21 12:06:13 +0100
commit21788b7ebc85f7ace3806037742386ead382944e (patch)
treeb3d39b8247fb70d1f7e49bdd7438b71e5c8f73c6
parent019060d55c3e60c6d18a6bd20699bd88ce7b71bd (diff)
downloadgnutls-21788b7ebc85f7ace3806037742386ead382944e.tar.gz
Use better names in gnutls_certificate_print_formats_t.
-rw-r--r--NEWS4
-rw-r--r--includes/gnutls/compat.h8
-rw-r--r--includes/gnutls/gnutls.h.in6
-rw-r--r--lib/x509/output.c18
-rw-r--r--src/certtool.c8
-rw-r--r--src/serv.c4
6 files changed, 29 insertions, 19 deletions
diff --git a/NEWS b/NEWS
index 0f767fd207..cbb8050c81 100644
--- a/NEWS
+++ b/NEWS
@@ -82,6 +82,10 @@ gnutls_x509_dn_import: ADDED
gnutls_x509_dn_deinit: ADDED
GNUTLS_E_OPENPGP_SUBKEY_ERROR: ADDED
gnutls_hex2bin: ADDED
+GNUTLS_CRT_PRINT_FULL: ADDED, same as old GNUTLS_X509_CRT_FULL.
+GNUTLS_CRT_PRINT_ONELINE: ADDED, same as old GNUTLS_X509_CRT_ONELINE.
+GNUTLS_CRT_PRINT_UNSIGNED_FULL: ADDED, same as
+ old GNUTLS_X509_CRT_UNSIGNED_FULL.
* Version 2.3.0 (released 2008-01-08)
diff --git a/includes/gnutls/compat.h b/includes/gnutls/compat.h
index a60e8fedc1..baf45a42a9 100644
--- a/includes/gnutls/compat.h
+++ b/includes/gnutls/compat.h
@@ -93,7 +93,13 @@
#define gnutls_openpgp_key_get_id gnutls_openpgp_crt_get_id
#define gnutls_openpgp_key_check_hostname gnutls_openpgp_crt_check_hostname
-/* OpenPGP stuff renamed in 2.2.x. */
+/* OpenPGP stuff renamed in 2.3.x. */
#define gnutls_openpgp_crt_get_id gnutls_openpgp_crt_get_key_id
+/* New better names renamed in 2.3.x, add these for backwards
+ compatibility with old poor names.*/
+#define GNUTLS_X509_CRT_FULL GNUTLS_CRT_PRINT_FULL
+#define GNUTLS_X509_CRT_ONELINE GNUTLS_CRT_PRINT_ONELINE
+#define GNUTLS_X509_CRT_UNSIGNED_FULL GNUTLS_CRT_PRINT_UNSIGNED_FULL
+
#endif /* GCOMPAT_H */
diff --git a/includes/gnutls/gnutls.h.in b/includes/gnutls/gnutls.h.in
index e35c7dc604..d1ce0f1f87 100644
--- a/includes/gnutls/gnutls.h.in
+++ b/includes/gnutls/gnutls.h.in
@@ -282,9 +282,9 @@ extern "C"
typedef enum gnutls_certificate_print_formats
{
- GNUTLS_X509_CRT_FULL,
- GNUTLS_X509_CRT_ONELINE,
- GNUTLS_X509_CRT_UNSIGNED_FULL
+ GNUTLS_CRT_PRINT_FULL,
+ GNUTLS_CRT_PRINT_ONELINE,
+ GNUTLS_CRT_PRINT_UNSIGNED_FULL,
} gnutls_certificate_print_formats_t;
typedef enum
diff --git a/lib/x509/output.c b/lib/x509/output.c
index 4ea4d24c8e..75a1110aaf 100644
--- a/lib/x509/output.c
+++ b/lib/x509/output.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2007 Free Software Foundation
+ * Copyright (C) 2007, 2008 Free Software Foundation
*
* Author: Simon Josefsson
*
@@ -1111,9 +1111,9 @@ print_oneline (gnutls_string * str, gnutls_x509_crt_t cert)
* This function will pretty print a X.509 certificate, suitable for
* display to a human.
*
- * If the format is %GNUTLS_X509_CRT_FULL then all fields of the
+ * If the format is %GNUTLS_CRT_PRINT_FULL then all fields of the
* certificate will be output, on multiple lines. The
- * %GNUTLS_X509_CRT_ONELINE format will generate one line with some
+ * %GNUTLS_CRT_PRINT_ONELINE format will generate one line with some
* selected fields, which is useful for logging purposes.
*
* The output @out needs to be deallocate using gnutls_free().
@@ -1127,24 +1127,24 @@ gnutls_x509_crt_print (gnutls_x509_crt_t cert,
{
gnutls_string str;
- if (format == GNUTLS_X509_CRT_FULL
- || format == GNUTLS_X509_CRT_UNSIGNED_FULL)
+ if (format == GNUTLS_CRT_PRINT_FULL
+ || format == GNUTLS_CRT_PRINT_UNSIGNED_FULL)
{
_gnutls_string_init (&str, gnutls_malloc, gnutls_realloc, gnutls_free);
_gnutls_string_append_str (&str, _("X.509 Certificate Information:\n"));
- print_cert (&str, cert, format == GNUTLS_X509_CRT_UNSIGNED_FULL);
+ print_cert (&str, cert, format == GNUTLS_CRT_PRINT_UNSIGNED_FULL);
_gnutls_string_append_str (&str, _("Other Information:\n"));
- print_other (&str, cert, format == GNUTLS_X509_CRT_UNSIGNED_FULL);
+ print_other (&str, cert, format == GNUTLS_CRT_PRINT_UNSIGNED_FULL);
_gnutls_string_append_data (&str, "\0", 1);
out->data = str.data;
out->size = strlen (str.data);
}
- else if (format == GNUTLS_X509_CRT_ONELINE)
+ else if (format == GNUTLS_CRT_PRINT_ONELINE)
{
_gnutls_string_init (&str, gnutls_malloc, gnutls_realloc, gnutls_free);
@@ -1348,7 +1348,7 @@ gnutls_x509_crl_print (gnutls_x509_crl_t crl,
_gnutls_string_append_str
(&str, _("X.509 Certificate Revocation List Information:\n"));
- print_crl (&str, crl, format == GNUTLS_X509_CRT_UNSIGNED_FULL);
+ print_crl (&str, crl, format == GNUTLS_CRT_PRINT_UNSIGNED_FULL);
_gnutls_string_append_data (&str, "\0", 1);
out->data = str.data;
diff --git a/src/certtool.c b/src/certtool.c
index b1253b0be6..6654db988f 100644
--- a/src/certtool.c
+++ b/src/certtool.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation
+ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation
*
* This file is part of GNUTLS.
*
@@ -1291,10 +1291,10 @@ print_certificate_info (gnutls_x509_crt_t crt, FILE * out,
int ret;
if (all)
- ret = gnutls_x509_crt_print (crt, GNUTLS_X509_CRT_FULL, &info);
+ ret = gnutls_x509_crt_print (crt, GNUTLS_CRT_PRINT_FULL, &info);
else
ret =
- gnutls_x509_crt_print (crt, GNUTLS_X509_CRT_UNSIGNED_FULL, &info);
+ gnutls_x509_crt_print (crt, GNUTLS_CRT_PRINT_UNSIGNED_FULL, &info);
if (ret == 0)
{
fprintf (out, "%s\n", info.data);
@@ -1315,7 +1315,7 @@ print_crl_info (gnutls_x509_crl_t crl, FILE * out)
int ret;
size_t size;
- ret = gnutls_x509_crl_print (crl, GNUTLS_X509_CRT_FULL, &info);
+ ret = gnutls_x509_crl_print (crl, GNUTLS_CRT_PRINT_FULL, &info);
if (ret < 0)
error (EXIT_FAILURE, 0, "crl_print: %s", gnutls_strerror (ret));
diff --git a/src/serv.c b/src/serv.c
index 150325f1ab..bb5bcce7c2 100644
--- a/src/serv.c
+++ b/src/serv.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2006, 2007 Free Software Foundation
+ * Copyright (C) 2004, 2006, 2007, 2008 Free Software Foundation
* Copyright (C) 2001,2002 Paul Sheer
* Portions Copyright (C) 2002,2003 Nikos Mavrogiannopoulos
*
@@ -487,7 +487,7 @@ peer_print_info (gnutls_session_t session, int *ret_length, const char *header)
if (gnutls_x509_crt_init (&cert) == 0 &&
gnutls_x509_crt_import (cert, &cert_list[i],
GNUTLS_X509_FMT_DER) == 0 &&
- gnutls_x509_crt_print (cert, GNUTLS_X509_CRT_FULL, &info) == 0)
+ gnutls_x509_crt_print (cert, GNUTLS_CRT_PRINT_FULL, &info) == 0)
{
const char *post = "</PRE><P><PRE>";