Added entry locking using read/write locks.
[silc.git] / lib / silcclient / client_keyagr.c
index a0c791d81cbe90fb316f904e8095e4941a095137..efabe7582285f7b603a1d06c942b87e4c73ead07 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 2001 - 2006 Pekka Riikonen
+  Copyright (C) 2001 - 2007 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
@@ -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. */
@@ -186,7 +186,7 @@ static void silc_client_keyagr_completion(SilcSKE ske,
   silc_client_keyagr_free(client, conn, client_entry);
 }
 
-/* Starts key agreement as responder.  */
+/* Starts key agreement as responder. */
 
 static void silc_client_process_key_agreement(SilcClient client,
                                              SilcClientConnection conn,
@@ -649,14 +649,14 @@ 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 */
@@ -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;
 }