1 /* Author: Daniel Kahn Gillmor <dkg@fifthhorseman.net> */
2 /* Date: Fri, 04 Apr 2008 19:31:16 -0400 */
3 /* License: GPL v3 or later */
6 #include <gnutls/gnutls.h>
11 #include <sys/types.h>
16 /* Functions to help dealing with GnuTLS for monkeysphere key
17 translation projects: */
19 /* set everything up, including logging levels. Return 0 on
23 /* logging and output functions: */
25 void err(const char* fmt, ...);
26 void logfunc(int level, const char* string);
28 /* basic datum manipulations: */
30 void init_datum(gnutls_datum_t* d);
31 void copy_datum(gnutls_datum_t* dest, const gnutls_datum_t* src);
32 int compare_data(const gnutls_datum_t* a, const gnutls_datum_t* b);
33 void free_datum(gnutls_datum_t* d);
35 /* functions to get data into datum objects: */
37 /* read the passed-in string, store in a single datum */
38 int set_datum_string(gnutls_datum_t* d, const char* s);
40 /* read the passed-in file descriptor until EOF, store in a single
42 int set_datum_fd(gnutls_datum_t* d, int fd);
44 /* read the file indicated (by na1me) in the fname parameter. store
45 its entire contents in a single datum. */
46 int set_datum_file(gnutls_datum_t* d, const char* fname);