X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=apps%2Firssi%2Fsrc%2Fsilc%2Fcore%2Fclientutil.c;h=93b575fe9a5fdc14a38da05166f101a169c7ce1d;hb=a818c5b5411bbc4436d1c5f011236985c96bb787;hp=622fb762465da3ecc5ef2cba67152bb618b45e76;hpb=2dc218143c7859f7529396dc121ae08e2fd78da0;p=silc.git diff --git a/apps/irssi/src/silc/core/clientutil.c b/apps/irssi/src/silc/core/clientutil.c index 622fb762..93b575fe 100644 --- a/apps/irssi/src/silc/core/clientutil.c +++ b/apps/irssi/src/silc/core/clientutil.c @@ -2,14 +2,13 @@ client.c - Author: Pekka Riikonen + Author: Pekka Riikonen - Copyright (C) 1997 - 2000 Pekka Riikonen + Copyright (C) 1997 - 2002 Pekka Riikonen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. + the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -159,7 +158,7 @@ int silc_client_create_key_pair(char *pkcs_name, int bits, SilcPrivateKey prv_key; SilcRng rng; unsigned char *key; - uint32 key_len; + SilcUInt32 key_len; char line[256]; char *pkfile = NULL, *prvfile = NULL; @@ -304,14 +303,16 @@ int silc_client_check_silc_dir() memset(file_public_key, 0, sizeof(file_public_key)); memset(file_private_key, 0, sizeof(file_private_key)); + identifier = silc_client_create_identifier(); + pw = getpwuid(getuid()); if (!pw) { fprintf(stderr, "silc: %s\n", strerror(errno)); + if (identifier) + silc_free(identifier); return FALSE; } - identifier = silc_client_create_identifier(); - /* We'll take home path from /etc/passwd file to be sure. */ snprintf(filename, sizeof(filename) - 1, "%s/.silc/", pw->pw_dir); snprintf(servfilename, sizeof(servfilename) - 1, "%s/.silc/serverkeys", @@ -552,7 +553,7 @@ int silc_client_show_key(char *keyfile) SilcPublicKeyIdentifier ident; char *fingerprint, *babbleprint; unsigned char *pk; - uint32 pk_len; + SilcUInt32 pk_len; SilcPKCS pkcs; int key_len = 0; @@ -597,6 +598,7 @@ int silc_client_show_key(char *keyfile) fflush(stdout); silc_free(fingerprint); + silc_free(babbleprint); silc_free(pk); silc_pkcs_public_key_free(public_key); silc_pkcs_free_identifier(ident);