Fixed entry resolving while processing incoming notify packets,
[silc.git] / lib / silcclient / client_keyagr.c
index 3effa0569d56607d5c5c2b2a2ec889e2b67d77fe..15d0f13048e55ea484e9f81f0e30b7db5e9020ee 100644 (file)
@@ -103,7 +103,7 @@ static void silc_client_keyagr_resolved(SilcClient client,
 
 static void silc_client_keyagr_verify_key_cb(SilcBool success, void *context)
 {
-  VerifyKeyContext verify = context;
+  SilcVerifyKeyContext verify = context;
 
   /* Call the completion callback back to the SKE */
   verify->completion(verify->ske, success ? SILC_SKE_STATUS_OK :
@@ -125,7 +125,7 @@ static void silc_client_keyagr_verify_key(SilcSKE ske,
   SilcClientKeyAgreement ke = client_entry->internal.ke;
   SilcClientConnection conn = ke->conn;
   SilcClient client = conn->client;
-  VerifyKeyContext verify;
+  SilcVerifyKeyContext verify;
 
   /* If we provided repository for SKE and we got here the key was not
      found from the repository. */
@@ -649,19 +649,19 @@ SILC_FSM_STATE(silc_client_key_agreement)
   if (packet->src_id_type != SILC_ID_CLIENT) {
     /** Invalid packet */
     silc_fsm_next(fsm, silc_client_key_agreement_error);
-    SILC_FSM_CONTINUE;
+    return SILC_FSM_CONTINUE;
   }
 
   if (!silc_id_str2id(packet->src_id, packet->src_id_len, SILC_ID_CLIENT,
                      &remote_id, sizeof(remote_id))) {
     /** Invalid source ID */
     silc_fsm_next(fsm, silc_client_key_agreement_error);
-    SILC_FSM_CONTINUE;
+    return SILC_FSM_CONTINUE;
   }
 
   /* Check whether we know this client already */
   remote_client = silc_client_get_client_by_id(client, conn, &remote_id);
-  if (!remote_client || !remote_client->nickname[0]) {
+  if (!remote_client || !remote_client->internal.valid) {
     /** Resolve client info */
     silc_client_unref_client(client, conn, remote_client);
     SILC_FSM_CALL(silc_client_get_client_by_id_resolve(
@@ -677,7 +677,7 @@ SILC_FSM_STATE(silc_client_key_agreement)
     /** Malformed Payload */
     SILC_LOG_DEBUG(("Malformed key agreement payload"));
     silc_fsm_next(fsm, silc_client_key_agreement_error);
-    SILC_FSM_CONTINUE;
+    return SILC_FSM_CONTINUE;
   }
 
   /* If remote did not provide connection endpoint, we will assume that we
@@ -697,7 +697,7 @@ SILC_FSM_STATE(silc_client_key_agreement)
   silc_key_agreement_payload_free(payload);
 
   silc_packet_free(packet);
-  SILC_FSM_FINISH;
+  return SILC_FSM_FINISH;
 }
 
 /* Key agreement packet processing error */
@@ -706,5 +706,5 @@ SILC_FSM_STATE(silc_client_key_agreement_error)
 {
   SilcPacket packet = state_context;
   silc_packet_free(packet);
-  SILC_FSM_FINISH;
+  return SILC_FSM_FINISH;
 }