When silc-client accepts new file transfer and receives public key to
verify it will crash because the client connection has no Irssi server
associated to it. Handle this gracefully.
Call the sucessful public key verify completion after the key has been
saved because the completion callback may free the public key.
Author: Pekka Riikonen <priikone@silcnet.org>
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2001 - 2008 Pekka Riikonen
+ Copyright (C) 2001 - 2014 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
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
SilcBool success = (reason == KeyboardCompletionSuccess);
if (success && (line[0] == 'Y' || line[0] == 'y')) {
SilcBool success = (reason == KeyboardCompletionSuccess);
if (success && (line[0] == 'Y' || line[0] == 'y')) {
- /* Call the completion */
- if (verify->completion)
- verify->completion(TRUE, verify->context);
-
/* Save the key for future checking */
silc_pkcs_save_public_key(verify->filename, verify->public_key,
SILC_PKCS_FILE_BASE64);
/* Save the key for future checking */
silc_pkcs_save_public_key(verify->filename, verify->public_key,
SILC_PKCS_FILE_BASE64);
+
+ /* Call the completion */
+ if (verify->completion)
+ verify->completion(TRUE, verify->context);
} else {
/* Call the completion */
if (verify->completion)
} else {
/* Call the completion */
if (verify->completion)
"server" : "client");
int i;
"server" : "client");
int i;
- server = (SILC_SERVER_REC*)conn->context;
- SILC_VERIFY(server);
- if (!server) {
- if (completion)
- completion(FALSE, context);
- return;
+ if (conn_type != SILC_CONN_CLIENT) {
+ server = (SILC_SERVER_REC*)conn->context;
+ SILC_VERIFY(server);
+ if (!server) {
+ if (completion)
+ completion(FALSE, context);
+ return;
+ }
}
if (silc_pkcs_get_type(public_key) != SILC_PKCS_SILC) {
}
if (silc_pkcs_get_type(public_key) != SILC_PKCS_SILC) {