"server" : "client");
int i;
+ server = (SILC_SERVER_REC*)conn->context;
if (conn_type != SILC_CONN_CLIENT) {
- server = (SILC_SERVER_REC*)conn->context;
SILC_VERIFY(server);
if (!server) {
if (completion)
}
}
+ /* If we have pending public key prompt already up */
+ if (server && server->prompt_op) {
+ silc_async_abort(server->prompt_op, NULL, NULL);
+ server->prompt_op = NULL;
+ }
+
if (silc_pkcs_get_type(public_key) != SILC_PKCS_SILC) {
printformat_module("fe-common/silc", NULL, NULL,
MSGLEVEL_CRAP, SILCTXT_PUBKEY_UNSUPPORTED,
* the operation has been aborted.
*/
ctx->user_prompt_proc(NULL, ctx->user_context, KeyboardCompletionAborted);
+
+ /*
+ * Allow new prompt after we've abored despite us leaking Irssi prompt
+ * data. It's more important to get new prompt up and this abort
+ * guarantees we handle things correctly towards silcclient library by
+ * calling the callback above.
+ */
+ silc_keyboard_prompt_pending = FALSE;
}
static void silc_keyboard_entry_redirect_completion(const char *line,
/* Responder is started here if correct packet comes in */
if (!ake->ske_op) {
- if (packet->type == SILC_PACKET_KEY_EXCHANGE)
- {
- /* Ignore pre-set proposal */
- if (ake->params.prop) {
- silc_ske_group_free(ake->params.prop->group);
- silc_cipher_free(ake->params.prop->cipher);
- silc_hash_free(ake->params.prop->hash);
- silc_hmac_free(ake->params.prop->hmac);
- silc_pkcs_public_key_free(ake->params.prop->public_key);
- silc_free(ake->params.prop);
- ake->params.prop = NULL;
- }
- }
- else if (packet->type != SILC_PACKET_KEY_EXCHANGE_1)
- {
- SILC_LOG_DEBUG(("Invalid SKE packet for responder"));
- silc_async_abort(client_entry->internal.op, NULL, NULL);
- goto drop;
+ if (packet->type == SILC_PACKET_KEY_EXCHANGE) {
+ /* Ignore pre-set proposal */
+ if (ake->params.prop) {
+ silc_ske_group_free(ake->params.prop->group);
+ silc_cipher_free(ake->params.prop->cipher);
+ silc_hash_free(ake->params.prop->hash);
+ silc_hmac_free(ake->params.prop->hmac);
+ silc_pkcs_public_key_free(ake->params.prop->public_key);
+ silc_free(ake->params.prop);
+ ake->params.prop = NULL;
}
+ } else if (packet->type != SILC_PACKET_KEY_EXCHANGE_1) {
+ SILC_LOG_DEBUG(("Invalid SKE packet for responder"));
+ silc_async_abort(client_entry->internal.op, NULL, NULL);
+ goto drop;
+ }
ake->ske_op = silc_ske_responder(ake->ske, ake->ske_stream, &ake->params);
if (!ake->ske_op) {
SilcVerifyKeyContext verify = context;
SilcClientAutonegMessageKey ake = verify->context;
- SILC_LOG_DEBUG(("Start"));
+ SILC_LOG_DEBUG(("Start, verify %p, ake %p", context, ake));
/* Call the completion callback back to the SKE */
if (!verify->aborted) {