Initial code commit for Toolkit 1.1.
[silc.git] / lib / silcske / silcske.h
index 5c552e03b7051962ea6eee7359f15d9c2eaa4522..554da9e71bc7cf66cd2dd688ada5a8b779c48cd9 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef SILCSKE_H
 #define SILCSKE_H
 
-/****h* silcske/SilcSKEAPI
+/****h* silcske/SILC SKE Interface
  *
  * DESCRIPTION
  *
@@ -273,10 +273,10 @@ typedef struct {
  * SOURCE
  */
 typedef enum {
-  SILC_SKE_SP_FLAG_NONE      = 0x00,     /* No flags */
-  SILC_SKE_SP_FLAG_NO_REPLY  = 0x01,    /* No reply required to payload */
-  SILC_SKE_SP_FLAG_PFS       = 0x02,    /* Perfect Forward Secrecy */
-  SILC_SKE_SP_FLAG_MUTUAL    = 0x04,    /* Mutual authentication */
+  SILC_SKE_SP_FLAG_NONE         = 0x00,         /* No flags */
+  SILC_SKE_SP_FLAG_IV_INCLUDED  = 0x01,         /* IV included in ciphertexts */
+  SILC_SKE_SP_FLAG_PFS          = 0x02,         /* Perfect Forward Secrecy */
+  SILC_SKE_SP_FLAG_MUTUAL       = 0x04,         /* Mutual authentication */
 } SilcSKESecurityPropertyFlag;
 /***/
 
@@ -325,7 +325,9 @@ struct SilcSKESecurityPropertiesStruct {
  */
 struct SilcSKEStruct {
   /* The connection object. This is initialized by the caller. */
+#if 0
   SilcSocketConnection sock;
+#endif
 
   /* Security properties negotiated */
   SilcSKESecurityProperties prop;
@@ -335,6 +337,7 @@ struct SilcSKEStruct {
   SilcSKEStartPayload *start_payload;
   SilcSKEKEPayload *ke1_payload;
   SilcSKEKEPayload *ke2_payload;
+  unsigned char *remote_version;
 
   /* Temporary copy of the KE Start Payload used in the
      HASH computation. */
@@ -500,7 +503,9 @@ void silc_ske_set_callbacks(SilcSKE ske,
  *
  ***/
 SilcSKEStatus silc_ske_initiator_start(SilcSKE ske, SilcRng rng,
+#if 0
                                       SilcSocketConnection sock,
+#endif
                                       SilcSKEStartPayload *start_payload);
 
 /****f* silcske/SilcSKEAPI/silc_ske_initiator_phase_1
@@ -624,7 +629,9 @@ SilcSKEStatus silc_ske_initiator_finish(SilcSKE ske,
  *
  ***/
 SilcSKEStatus silc_ske_responder_start(SilcSKE ske, SilcRng rng,
+#if 0
                                       SilcSocketConnection sock,
+#endif
                                       const char *version,
                                       SilcBuffer start_payload,
                                       SilcSKESecurityPropertyFlag flags);
@@ -892,4 +899,32 @@ silc_ske_process_key_material_data(unsigned char *data,
  ***/
 void silc_ske_free_key_material(SilcSKEKeyMaterial *key);
 
+/****f* silcske/SilcSKEAPI/silc_ske_parse_version
+ *
+ * SYNOPSIS
+ *
+ *    bool silc_ske_parse_version(SilcSKE ske, 
+ *                                SilcUInt32 *protocol_version,
+ *                                char **protocol_version_string,
+ *                                SilcUInt32 *software_version, 
+ *                                char **software_version_string,
+ *                                char **vendor_version);
+ *
+ * DESCRIPTION
+ *
+ *    This utility function can be used to parse the remote host's version
+ *    string.  This returns the protocol version, and software version into
+ *    the `protocol_version', `software_version' and `vendor_version' pointers
+ *    if they are provided.  The string versions of the versions are saved
+ *    in *_string pointers if they are provided.  Returns TRUE if the version
+ *    string was successfully parsed.
+ *
+ ***/
+bool silc_ske_parse_version(SilcSKE ske, 
+                           SilcUInt32 *protocol_version,
+                           char **protocol_version_string,
+                           SilcUInt32 *software_version, 
+                           char **software_version_string,
+                           char **vendor_version);
+
 #endif /* !SILCSKE_H */