From b457fec36399c1f7de093d5e92bb4fa453b79c86 Mon Sep 17 00:00:00 2001 From: Jakub Sławiński Date: Sun, 5 Feb 2006 15:14:03 +0100 Subject: v0.8 - Fixed: infinite loop after buffering message - Fixed: corrupt packets after closing connections in the stopped state - Fixed: bug in mapping user numbers between afclient and afserver - Fixed: premature close of the service connection - Fixed: invalid buffering when the connection is closing - Added: Multiple tunnels in one afclient<->afserver connection --- src/ssl_routines.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'src/ssl_routines.c') diff --git a/src/ssl_routines.c b/src/ssl_routines.c index 30a0714..ae20fe2 100644 --- a/src/ssl_routines.c +++ b/src/ssl_routines.c @@ -19,11 +19,21 @@ */ #include - -#include "ssl_routines.h" #include #include #include +#include + +#include "ssl_routines.h" + +/* + * Function name: check_public_key + * Description: Checks if the public key is trusted. + * Arguments: filename - the name of the file with stored keys + * hostname - the name of the host + * keyhash - the hash of the key + * Returns: The result of the check. + */ int check_public_key(char* filename, char* hostname, char* keyhash) @@ -32,6 +42,10 @@ check_public_key(char* filename, char* hostname, char* keyhash) char buff[256]; int lspaceind, i; + assert(filename != NULL); + assert(hostname != NULL); + assert(keyhash != NULL); + memset(buff, 0, 256); storefile = fopen(filename, "r"); @@ -68,10 +82,23 @@ check_public_key(char* filename, char* hostname, char* keyhash) return SSL_PUBLIC_KEY_NOT_KNOWN; } +/* + * Function name: add_public_key + * Description: Adds the key to the store file. + * Arguments: filename - the name of the file with stored keys + * hostname - the name of the host + * keyhash - the hash of the key + */ + void add_public_key(char* filename, char* hostname, char* keyhash) { FILE* storefile; + + assert(filename != NULL); + assert(hostname != NULL); + assert(keyhash != NULL); + storefile = fopen(filename, "a"); if (storefile == NULL) { return; -- cgit v1.1