diff options
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | gl/override/lib/read-file.c.diff | 38 | ||||
-rw-r--r-- | gl/override/lib/read-file.h.diff | 16 | ||||
-rw-r--r-- | gl/override/tests/test-read-file.c.diff | 20 | ||||
-rw-r--r-- | gl/read-file.c | 8 | ||||
-rw-r--r-- | gl/read-file.h | 6 | ||||
-rw-r--r-- | gl/tests/test-read-file.c | 4 | ||||
-rw-r--r-- | lib/gnutls_x509.c | 10 | ||||
-rw-r--r-- | lib/openpgp/gnutls_openpgp.c | 6 | ||||
-rw-r--r-- | src/certtool-common.c | 12 | ||||
-rw-r--r-- | src/certtool.c | 22 | ||||
-rw-r--r-- | src/cli.c | 2 | ||||
-rw-r--r-- | src/crywrap/crywrap.c | 2 |
13 files changed, 40 insertions, 110 deletions
diff --git a/configure.ac b/configure.ac index 83d8820169..2e7e57992d 100644 --- a/configure.ac +++ b/configure.ac @@ -402,6 +402,10 @@ AC_SUBST(LIBGNUTLS_CFLAGS) AC_DEFINE([GNUTLS_COMPAT_H], 1, [Make sure we don't use old features in code.]) AC_DEFINE([GNUTLS_INTERNAL_BUILD], 1, [We allow temporarily usage of deprecated functions - until they are removed.]) +AC_DEFINE([fread_file], [_gnutls_fread_file], [static lib rename]) +AC_DEFINE([read_file], [_gnutls_read_file], [static lib rename]) +AC_DEFINE([read_binary_file], [_gnutls_read_binary_file], [static lib rename]) + dnl Crywrap dependencies AC_MSG_RESULT([*** *** Checking dependencies for crywrap... diff --git a/gl/override/lib/read-file.c.diff b/gl/override/lib/read-file.c.diff deleted file mode 100644 index 2907631df9..0000000000 --- a/gl/override/lib/read-file.c.diff +++ /dev/null @@ -1,38 +0,0 @@ ---- read-file.c.orig -+++ read-file.c -@@ -41,7 +41,7 @@ - *LENGTH. On errors, *LENGTH is undefined, errno preserves the - values set by system functions (if any), and NULL is returned. */ - char * --fread_file (FILE *stream, size_t *length) -+gl_fread_file (FILE *stream, size_t *length) - { - char *buf = NULL; - size_t alloc = BUFSIZ; -@@ -145,7 +145,7 @@ internal_read_file (const char *filename, size_t *length, const char *mode) - if (!stream) - return NULL; - -- out = fread_file (stream, length); -+ out = gl_fread_file (stream, length); - - save_errno = errno; - -@@ -170,7 +170,7 @@ internal_read_file (const char *filename, size_t *length, const char *mode) - undefined, errno preserves the values set by system functions (if - any), and NULL is returned. */ - char * --read_file (const char *filename, size_t *length) -+gl_read_file (const char *filename, size_t *length) - { - return internal_read_file (filename, length, "r"); - } -@@ -183,7 +183,7 @@ read_file (const char *filename, size_t *length) - preserves the values set by system functions (if any), and NULL is - returned. */ - char * --read_binary_file (const char *filename, size_t *length) -+gl_read_binary_file (const char *filename, size_t *length) - { - return internal_read_file (filename, length, "rb"); - } diff --git a/gl/override/lib/read-file.h.diff b/gl/override/lib/read-file.h.diff deleted file mode 100644 index 3731bc7ffe..0000000000 --- a/gl/override/lib/read-file.h.diff +++ /dev/null @@ -1,16 +0,0 @@ ---- read-file.h.orig -+++ read-file.h -@@ -25,10 +25,10 @@ - /* Get FILE. */ - #include <stdio.h> - --extern char *fread_file (FILE * stream, size_t * length); -+extern char *gl_fread_file (FILE * stream, size_t * length); - --extern char *read_file (const char *filename, size_t * length); -+extern char *gl_read_file (const char *filename, size_t * length); - --extern char *read_binary_file (const char *filename, size_t * length); -+extern char *gl_read_binary_file (const char *filename, size_t * length); - - #endif /* READ_FILE_H */ diff --git a/gl/override/tests/test-read-file.c.diff b/gl/override/tests/test-read-file.c.diff deleted file mode 100644 index 1c25c30332..0000000000 --- a/gl/override/tests/test-read-file.c.diff +++ /dev/null @@ -1,20 +0,0 @@ ---- test-read-file.c.orig -+++ test-read-file.c -@@ -37,7 +37,7 @@ main (void) - if (stat (FILE1, &statbuf) >= 0) - { - size_t len; -- char *out = read_file (FILE1, &len); -+ char *out = gl_read_file (FILE1, &len); - - if (!out) - { -@@ -79,7 +79,7 @@ main (void) - if (stat (FILE2, &statbuf) >= 0) - { - size_t len; -- char *out = read_file (FILE2, &len); -+ char *out = gl_read_file (FILE2, &len); - - if (!out) - { diff --git a/gl/read-file.c b/gl/read-file.c index 0e6c3835fc..bcbfbbb460 100644 --- a/gl/read-file.c +++ b/gl/read-file.c @@ -41,7 +41,7 @@ *LENGTH. On errors, *LENGTH is undefined, errno preserves the values set by system functions (if any), and NULL is returned. */ char * -gl_fread_file (FILE *stream, size_t *length) +fread_file (FILE *stream, size_t *length) { char *buf = NULL; size_t alloc = BUFSIZ; @@ -145,7 +145,7 @@ internal_read_file (const char *filename, size_t *length, const char *mode) if (!stream) return NULL; - out = gl_fread_file (stream, length); + out = fread_file (stream, length); save_errno = errno; @@ -170,7 +170,7 @@ internal_read_file (const char *filename, size_t *length, const char *mode) undefined, errno preserves the values set by system functions (if any), and NULL is returned. */ char * -gl_read_file (const char *filename, size_t *length) +read_file (const char *filename, size_t *length) { return internal_read_file (filename, length, "r"); } @@ -183,7 +183,7 @@ gl_read_file (const char *filename, size_t *length) preserves the values set by system functions (if any), and NULL is returned. */ char * -gl_read_binary_file (const char *filename, size_t *length) +read_binary_file (const char *filename, size_t *length) { return internal_read_file (filename, length, "rb"); } diff --git a/gl/read-file.h b/gl/read-file.h index 70d88d64d0..42663ef666 100644 --- a/gl/read-file.h +++ b/gl/read-file.h @@ -25,10 +25,10 @@ /* Get FILE. */ #include <stdio.h> -extern char *gl_fread_file (FILE * stream, size_t * length); +extern char *fread_file (FILE * stream, size_t * length); -extern char *gl_read_file (const char *filename, size_t * length); +extern char *read_file (const char *filename, size_t * length); -extern char *gl_read_binary_file (const char *filename, size_t * length); +extern char *read_binary_file (const char *filename, size_t * length); #endif /* READ_FILE_H */ diff --git a/gl/tests/test-read-file.c b/gl/tests/test-read-file.c index 23c1b750f8..de7a0bb9f3 100644 --- a/gl/tests/test-read-file.c +++ b/gl/tests/test-read-file.c @@ -37,7 +37,7 @@ main (void) if (stat (FILE1, &statbuf) >= 0) { size_t len; - char *out = gl_read_file (FILE1, &len); + char *out = read_file (FILE1, &len); if (!out) { @@ -79,7 +79,7 @@ main (void) if (stat (FILE2, &statbuf) >= 0) { size_t len; - char *out = gl_read_file (FILE2, &len); + char *out = read_file (FILE2, &len); if (!out) { diff --git a/lib/gnutls_x509.c b/lib/gnutls_x509.c index d5f3a15cc7..c86c4edd4b 100644 --- a/lib/gnutls_x509.c +++ b/lib/gnutls_x509.c @@ -793,7 +793,7 @@ read_cert_file (gnutls_certificate_credentials_t res, } #endif /* ENABLE_PKCS11 */ - data = gl_read_binary_file (certfile, &size); + data = read_binary_file (certfile, &size); if (data == NULL) { @@ -828,7 +828,7 @@ read_key_file (gnutls_certificate_credentials_t res, } #endif /* ENABLE_PKCS11 */ - data = gl_read_binary_file (keyfile, &size); + data = read_binary_file (keyfile, &size); if (data == NULL) { @@ -1569,7 +1569,7 @@ gnutls_certificate_set_x509_trust_file (gnutls_certificate_credentials_t cred, } #endif - cas.data = gl_read_binary_file (cafile, &size); + cas.data = read_binary_file (cafile, &size); if (cas.data == NULL) { gnutls_assert (); @@ -1790,7 +1790,7 @@ gnutls_certificate_set_x509_crl_file (gnutls_certificate_credentials_t res, { int ret; size_t size; - char *data = gl_read_binary_file (crlfile, &size); + char *data = read_binary_file (crlfile, &size); if (data == NULL) { @@ -2155,7 +2155,7 @@ int size_t size; int ret; - p12blob.data = gl_read_binary_file (pkcs12file, &size); + p12blob.data = read_binary_file (pkcs12file, &size); p12blob.size = (unsigned int) size; if (p12blob.data == NULL) { diff --git a/lib/openpgp/gnutls_openpgp.c b/lib/openpgp/gnutls_openpgp.c index b1c7c1f866..ae7320aaf6 100644 --- a/lib/openpgp/gnutls_openpgp.c +++ b/lib/openpgp/gnutls_openpgp.c @@ -452,7 +452,7 @@ gnutls_certificate_set_openpgp_key_file2 (gnutls_certificate_credentials_t return GNUTLS_E_FILE_ERROR; } - cert.data = gl_read_binary_file (certfile, &size); + cert.data = read_binary_file (certfile, &size); cert.size = (unsigned int) size; if (cert.data == NULL) { @@ -460,7 +460,7 @@ gnutls_certificate_set_openpgp_key_file2 (gnutls_certificate_credentials_t return GNUTLS_E_FILE_ERROR; } - key.data = gl_read_binary_file (keyfile, &size); + key.data = read_binary_file (keyfile, &size); key.size = (unsigned int) size; if (key.data == NULL) { @@ -549,7 +549,7 @@ gnutls_certificate_set_openpgp_keyring_file (gnutls_certificate_credentials_t c, return GNUTLS_E_INVALID_REQUEST; } - ring.data = gl_read_binary_file (file, &size); + ring.data = read_binary_file (file, &size); ring.size = (unsigned int) size; if (ring.data == NULL) { diff --git a/src/certtool-common.c b/src/certtool-common.c index 7e547a6276..9f87ae8898 100644 --- a/src/certtool-common.c +++ b/src/certtool-common.c @@ -281,7 +281,7 @@ load_private_key (int mand, common_info_st * info) return _load_pkcs11_privkey(info->privkey); #endif - dat.data = gl_read_binary_file (info->privkey, &size); + dat.data = read_binary_file (info->privkey, &size); dat.size = size; if (!dat.data) @@ -315,7 +315,7 @@ load_x509_private_key (int mand, common_info_st * info) if (ret < 0) error (EXIT_FAILURE, 0, "privkey_init: %s", gnutls_strerror (ret)); - dat.data = gl_read_binary_file (info->privkey, &size); + dat.data = read_binary_file (info->privkey, &size); dat.size = size; if (!dat.data) @@ -451,7 +451,7 @@ load_request (common_info_st * info) if (ret < 0) error (EXIT_FAILURE, 0, "crq_init: %s", gnutls_strerror (ret)); - dat.data = gl_read_binary_file (info->request, &size); + dat.data = read_binary_file (info->request, &size); dat.size = size; if (!dat.data) @@ -489,7 +489,7 @@ load_ca_private_key (common_info_st * info) return _load_pkcs11_privkey(info->ca_privkey); #endif - dat.data = gl_read_binary_file (info->ca_privkey, &size); + dat.data = read_binary_file (info->ca_privkey, &size); dat.size = size; if (!dat.data) @@ -520,7 +520,7 @@ load_ca_cert (common_info_st * info) if (ret < 0) error (EXIT_FAILURE, 0, "crt_init: %s", gnutls_strerror (ret)); - dat.data = gl_read_binary_file (info->ca, &size); + dat.data = read_binary_file (info->ca, &size); dat.size = size; if (!dat.data) @@ -562,7 +562,7 @@ load_pubkey (int mand, common_info_st * info) if (ret < 0) error (EXIT_FAILURE, 0, "privkey_init: %s", gnutls_strerror (ret)); - dat.data = gl_read_binary_file (info->pubkey, &size); + dat.data = read_binary_file (info->pubkey, &size); dat.size = size; if (!dat.data) diff --git a/src/certtool.c b/src/certtool.c index 09f31e28f9..824165a478 100644 --- a/src/certtool.c +++ b/src/certtool.c @@ -1155,7 +1155,7 @@ certificate_info (int pubkey, common_info_st * cinfo) gnutls_datum_t pem; unsigned int crt_num; - pem.data = gl_fread_file (infile, &size); + pem.data = fread_file (infile, &size); pem.size = size; crt_num = MAX_CRTS; @@ -1218,7 +1218,7 @@ pgp_certificate_info (void) gnutls_datum_t pem, out_data; unsigned int verify_status; - pem.data = gl_fread_file (infile, &size); + pem.data = fread_file (infile, &size); pem.size = size; ret = gnutls_openpgp_crt_init (&crt); @@ -1405,7 +1405,7 @@ pgp_ring_info (void) int ret, i, count; gnutls_datum_t pem; - pem.data = gl_fread_file (infile, &size); + pem.data = fread_file (infile, &size); pem.size = size; ret = gnutls_openpgp_keyring_init (&ring); @@ -1526,7 +1526,7 @@ crl_info (void) if (ret < 0) error (EXIT_FAILURE, 0, "crl_init: %s", gnutls_strerror (ret)); - pem.data = gl_fread_file (infile, &size); + pem.data = fread_file (infile, &size); pem.size = size; if (!pem.data) @@ -1582,7 +1582,7 @@ crq_info (void) if (ret < 0) error (EXIT_FAILURE, 0, "crq_init: %s", gnutls_strerror (ret)); - pem.data = gl_fread_file (infile, &size); + pem.data = fread_file (infile, &size); pem.size = size; if (!pem.data) @@ -2159,7 +2159,7 @@ verify_chain (void) char *buf; size_t size; - buf = gl_fread_file (infile, &size); + buf = fread_file (infile, &size); if (buf == NULL) error (EXIT_FAILURE, errno, "reading chain"); @@ -2180,13 +2180,13 @@ verify_certificate (common_info_st * cinfo) if (ca_file == NULL) error (EXIT_FAILURE, errno, "opening CA file"); - cert = gl_fread_file (infile, &cert_size); + cert = fread_file (infile, &cert_size); if (cert == NULL) error (EXIT_FAILURE, errno, "reading certificate chain"); cert[cert_size] = 0; - cas = gl_fread_file (ca_file, &ca_size); + cas = fread_file (ca_file, &ca_size); if (cas == NULL) error (EXIT_FAILURE, errno, "reading CA list"); @@ -2226,7 +2226,7 @@ verify_crl (common_info_st * cinfo) if (ret < 0) error (EXIT_FAILURE, 0, "crl_init: %s", gnutls_strerror (ret)); - pem.data = gl_fread_file (infile, &size); + pem.data = fread_file (infile, &size); pem.size = size; ret = gnutls_x509_crl_import (crl, &pem, info.incert_format); @@ -2601,7 +2601,7 @@ pkcs12_info (void) if (result < 0) error (EXIT_FAILURE, 0, "p12_init: %s", gnutls_strerror (result)); - data.data = gl_fread_file (infile, &size); + data.data = fread_file (infile, &size); data.size = size; result = gnutls_pkcs12_import (pkcs12, &data, info.incert_format, 0); @@ -2676,7 +2676,7 @@ pkcs7_info (void) if (result < 0) error (EXIT_FAILURE, 0, "p7_init: %s", gnutls_strerror (result)); - data.data = gl_fread_file (infile, &size); + data.data = fread_file (infile, &size); data.size = size; result = gnutls_pkcs7_import (pkcs7, &data, info.incert_format); @@ -123,7 +123,7 @@ load_file (const char *file) gnutls_datum_t loaded_file = { NULL, 0 }; size_t length; - loaded_file.data = gl_read_binary_file (file, &length); + loaded_file.data = read_binary_file (file, &length); if (loaded_file.data) loaded_file.size = (unsigned int) length; diff --git a/src/crywrap/crywrap.c b/src/crywrap/crywrap.c index 24ed8fcf83..da41f854d8 100644 --- a/src/crywrap/crywrap.c +++ b/src/crywrap/crywrap.c @@ -203,7 +203,7 @@ load_file (const char *file) gnutls_datum_t loaded_file = { NULL, 0 }; size_t length; - loaded_file.data = gl_read_binary_file (file, &length); + loaded_file.data = read_binary_file (file, &length); if (loaded_file.data) loaded_file.size = (unsigned int) length; |