57
if (!(f = fopen(file, "r"))
58
|| fseek(f, 0, SEEK_END) != 0
59
|| (filelen = ftell(f)) < 0
60
|| fseek(f, 0, SEEK_SET) != 0
61
|| !(ptr = malloc((size_t)filelen))
62
|| fread(ptr, 1, (size_t)filelen, f) < (size_t)filelen)
57
if (!(f = fopen (file, "r"))
58
|| fseek (f, 0, SEEK_END) != 0
59
|| (filelen = ftell (f)) < 0
60
|| fseek (f, 0, SEEK_SET) != 0
61
|| !(ptr = malloc ((size_t) filelen))
62
|| fread (ptr, 1, (size_t) filelen, f) < (size_t) filelen)
64
64
return loaded_file;
67
67
loaded_file.data = ptr;
68
loaded_file.size = (unsigned int)filelen;
68
loaded_file.size = (unsigned int) filelen;
69
69
return loaded_file;
72
static void unload_file(gnutls_datum_t data)
73
unload_file (gnutls_datum_t data)
77
78
/* Load the certificate and the private key.
140
141
gnutls_certificate_allocate_credentials (&xcred);
143
gnutls_priority_init( &priorities_cache, "NORMAL", NULL);
144
gnutls_priority_init (&priorities_cache, "NORMAL", NULL);
146
147
/* sets the trusted cas file