# HG changeset patch # User Daniel Atallah # Date 1155322967 0 # Node ID 545dbc931e8cb9ca79e5e5be6a44b10c6b08e00b # Parent 682394f005ddf9cf3bd4437e53bf0c8f517dcb44 [gaim-migrate @ 16709] Deal with inability to create key pair. (CID 139) committer: Tailor Script diff -r 682394f005dd -r 545dbc931e8c src/protocols/silc/util.c --- a/src/protocols/silc/util.c Fri Aug 11 18:35:26 2006 +0000 +++ b/src/protocols/silc/util.c Fri Aug 11 19:02:47 2006 +0000 @@ -205,12 +205,20 @@ /* If file doesn't exist */ if (errno == ENOENT) { gaim_connection_update_progress(gc, _("Creating SILC key pair..."), 1, 5); - silc_create_key_pair(SILCGAIM_DEF_PKCS, + if (!silc_create_key_pair(SILCGAIM_DEF_PKCS, SILCGAIM_DEF_PKCS_LEN, file_public_key, file_private_key, NULL, (gc->password == NULL) ? "" : gc->password, - NULL, NULL, NULL, FALSE); - g_stat(file_public_key, &st); + NULL, NULL, NULL, FALSE)) { + gaim_debug_error("silc", "Couldn't create key pair\n"); + return FALSE; + } + + if ((g_stat(file_public_key, &st)) == -1) { + gaim_debug_error("silc", "Couldn't stat '%s' public key, error: %s\n", + file_public_key, strerror(errno)); + return FALSE; + } } else { gaim_debug_error("silc", "Couldn't stat '%s' public key, error: %s\n", file_public_key, strerror(errno));