From 4b558a53f61005b0ca49665d2da92303f6e14872 Mon Sep 17 00:00:00 2001 From: Jonathan Beck Date: Mon, 4 Aug 2008 22:31:43 +0200 Subject: Store certificates and private keys as PEM files instead of storing them in config file. Added functions to generate proper pairing request. Signed-off-by: Matt Colyer --- src/userpref.h | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'src/userpref.h') diff --git a/src/userpref.h b/src/userpref.h index cef0bed..441c7be 100644 --- a/src/userpref.h +++ b/src/userpref.h @@ -22,6 +22,7 @@ #ifndef USERPREF_H #define USERPREF_H +#include /** * \fn char* get_host_id() * method to get user's HostID. Caller must free returned buffer. @@ -43,34 +44,34 @@ int is_device_known(char* public_key); int store_device_public_key(char* public_key); /** -* \fn char* get_root_private_key() -* \return RootPrivateKey if exists. Returns NULL otherwise. +* \fn int get_root_private_key(gnutls_datum_t* root_privkey) +* \return 1 if everything went well. Returns 0 otherwise. */ -char* get_root_private_key(); +int get_root_private_key(gnutls_datum_t* root_privkey); /** -* \fn char* get_host_private_key() -* \return HostPrivateKey if exists. Returns NULL otherwise. +* \fn int get_host_private_key(gnutls_datum_t* host_privkey) +* \return 1 if everything went well. Returns 0 otherwise. */ -char* get_host_private_key(); +int get_host_private_key(gnutls_datum_t* host_privkey); /** -* \fn char* get_root_certificate() -* \return RootCertificate if exists. Returns NULL otherwise. +* \fn int get_root_certificate(gnutls_datum_t* root_cert) +* \return 1 if everything went well. Returns 0 otherwise. */ -char* get_root_certificate(); +int get_root_certificate(gnutls_datum_t* root_cert); /** -* \fn char* get_host_certificate() -* \return HostCertificate if exists. Returns NULL otherwise. +* \fn int get_host_certificate(gnutls_datum_t* host_cert) +* \return 1 if everything went well. Returns 0 otherwise. */ -char* get_host_certificate(); +int get_host_certificate(gnutls_datum_t* host_cert); /** -* \fn int init_config_file(char* host_id, char* root_private_key, char* host_private_key, char* root_cert, char* host_cert) +* \fn int init_config_file(char* host_id, gnutls_datum_t* root_key, gnutls_datum_t* host_key, gnutls_datum_t* root_cert, gnutls_datum_t* host_cert) * setup a brand new config file. * \return 1 if everything went well. Returns 0 otherwise. */ -int init_config_file(char* host_id, char* root_private_key, char* host_private_key, char* root_cert, char* host_cert); +int init_config_file(char* host_id, gnutls_datum_t* root_key, gnutls_datum_t* host_key, gnutls_datum_t* root_cert, gnutls_datum_t* host_cert); #endif -- cgit v1.1-32-gdbae