diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2003-10-31 09:41:08 +0000 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2003-10-31 09:41:08 +0000 |
commit | e414b565f85e31b7d0e276f68958297841ea9572 (patch) | |
tree | 212d97f1d4d22ad5cdab243787ed07312f24e52f /lib | |
parent | 2b082d3bc8c134d58cdc4467125795319f04462c (diff) | |
download | gnutls-e414b565f85e31b7d0e276f68958297841ea9572.tar.gz |
some openpgp related changes.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Makefile.am | 2 | ||||
-rw-r--r-- | lib/gnutls_x509.c | 16 | ||||
-rw-r--r-- | lib/strfile.h | 8 |
3 files changed, 15 insertions, 11 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am index 1e31ad4034..7924cfcdea 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -23,7 +23,7 @@ EXTRA_DIST = debug.h gnutls_compress.h defines.h gnutls.asn pkix.asn \ libgnutls-config.in libgnutls.m4 gnutls.h.in.in gnutls_errors_int.h \ gnutls-api.tex gnutls_datum.h auth_cert.h gnutls_mpi.h \ gnutls_pk.h gnutls_record.h gnutls_cert.h \ - gnutls_constate.h gnutls_global.h \ + gnutls_constate.h gnutls_global.h strfile.h \ gnutls_sig.h gnutls_mem.h gnutls_ui.h \ io_debug.h ext_max_record.h gnutls_session_pack.h \ gnutls_alert.h gnutls_str.h gnutls_state.h gnutls_x509.h \ diff --git a/lib/gnutls_x509.c b/lib/gnutls_x509.c index af0e47b436..3481c63091 100644 --- a/lib/gnutls_x509.c +++ b/lib/gnutls_x509.c @@ -619,13 +619,9 @@ static int read_key_mem(gnutls_certificate_credentials res, const char *key, int # include <sys/mman.h> #endif -typedef struct { - opaque * data; - size_t size; - int mmaped; -} strfile; +#include <strfile.h> -inline static void _strfile_free( strfile *x) +void _gnutls_strfile_free( strfile *x) { #ifdef HAVE_MMAP if (x->mmaped) { @@ -725,7 +721,7 @@ static int read_cert_file(gnutls_certificate_credentials res, const char *certfi } ret = read_cert_mem( res, x.data, x.size, type); - _strfile_free(&x); + _gnutls_strfile_free(&x); return ret; @@ -749,7 +745,7 @@ static int read_key_file(gnutls_certificate_credentials res, const char *keyfile } ret = read_key_mem( res, x.data, x.size, type); - _strfile_free(&x); + _gnutls_strfile_free(&x); return ret; } @@ -1256,7 +1252,7 @@ int gnutls_certificate_set_x509_trust_file(gnutls_certificate_credentials res, ret = parse_pem_ca_mem( &res->x509_ca_list, &res->x509_ncas, x.data, x.size); - _strfile_free(&x); + _gnutls_strfile_free(&x); if (ret < 0) { gnutls_assert(); @@ -1509,7 +1505,7 @@ int gnutls_certificate_set_x509_crl_file(gnutls_certificate_credentials res, ret = parse_pem_crl_mem( &res->x509_crl_list, &res->x509_ncrls, x.data, x.size); - _strfile_free(&x); + _gnutls_strfile_free(&x); if (ret < 0) { gnutls_assert(); diff --git a/lib/strfile.h b/lib/strfile.h new file mode 100644 index 0000000000..56ed41fed1 --- /dev/null +++ b/lib/strfile.h @@ -0,0 +1,8 @@ +typedef struct { + opaque * data; + size_t size; + int mmaped; +} strfile; + +void _gnutls_strfile_free( strfile *x); +strfile _gnutls_file_to_str( const char * file); |