-typedef SilcSKEStatus (*SilcSKECheckVersion)(SilcSKE ske,
- unsigned char *version,
- SilcUInt32 len, void *context);
-
-/****s* silcske/SilcSKEAPI/SilcSKEKeyMaterial
- *
- * NAME
- *
- * typedef struct { ... } SilcSKEKeyMaterial;
- *
- * DESCRIPTION
- *
- * This is the key material structure, and is passed as argument by the
- * application to silc_ske_process_key_material* functions. It includes
- * the processed key material which can be used as SILC session keys.
- *
- ***/
-typedef struct {
- unsigned char *send_iv;
- unsigned char *receive_iv;
- SilcUInt32 iv_len;
- unsigned char *send_enc_key;
- unsigned char *receive_enc_key;
- SilcUInt32 enc_key_len;
- unsigned char *send_hmac_key;
- unsigned char *receive_hmac_key;
- SilcUInt32 hmac_key_len;
-} SilcSKEKeyMaterial;
-
-/* Length of cookie in Start Payload */
-#define SILC_SKE_COOKIE_LEN 16
-
-#include "silcske_groups.h"
-#include "silcske_payload.h"
-
-/****d* silcske/SilcSKEAPI/SilcSKESecurityPropertyFlag
- *
- * NAME
- *
- * typedef enum { ... } SilcSKESecurityPropertyFlag
- *
- * DESCRIPTION
- *
- * SKE security property flags as defined by the SK protocol.
- *
- * 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 */
-} SilcSKESecurityPropertyFlag;
-/***/
-
-/****s* silcske/SilcSKEAPI/SilcSKESecurityPropertiesStruct
- *
- * NAME
- *
- * struct SilcSKESecurityPropertiesStruct { ... };
- *
- * DESCRIPTION
- *
- * Security Properties negotiated between key exchange parties. This
- * structure is filled from the Key Exchange Start Payload which is used
- * to negotiate what security properties should be used in the
- * communication.
- *
- * SOURCE
- */
-struct SilcSKESecurityPropertiesStruct {
- SilcSKESecurityPropertyFlag flags; /* Flags */
- SilcSKEDiffieHellmanGroup group; /* Selected Diffie Hellman group */
- SilcPKCS pkcs; /* Selected PKCS algorithm */
- SilcCipher cipher; /* Selected cipher */
- SilcHash hash; /* Selected hash algorithm */
- SilcHmac hmac; /* Selected HMAC */
-};
-/***/
-
-/****s* silcske/SilcSKEAPI/SilcSKEStruct
- *
- * NAME
- *
- * struct SilcSKEStruct { ... };
- *
- * DESCRIPTION
- *
- * This structure is the SKE session context, and has a type definition
- * to SilcSKE. The structure includes the network connection socket,
- * securit properties collected during the SKE negotiation, payloads
- * sent and received during the negotiation, and the actual raw key
- * material too. The application usually does not need to reference
- * to the inside of this structure. However, checking the current
- * status of the session can easily be checked with ske->status.
- *
- * SOURCE
- */
-struct SilcSKEStruct {
- /* The connection object. This is initialized by the caller. */
- SilcSocketConnection sock;
-
- /* Security properties negotiated */
- SilcSKESecurityProperties prop;
-
- /* Key Exchange payloads filled during key negotiation with
- remote data. Responder may save local data here as well. */
- SilcSKEStartPayload *start_payload;
- SilcSKEKEPayload *ke1_payload;
- SilcSKEKEPayload *ke2_payload;
-
- /* Temporary copy of the KE Start Payload used in the
- HASH computation. */
- SilcBuffer start_payload_copy;
-
- /* Random number x, 1 < x < q. This is the secret exponent
- used in Diffie Hellman computations. */
- SilcMPInt *x;
-
- /* The secret shared key */
- SilcMPInt *KEY;
-
- /* The hash value HASH of the key exchange */
- unsigned char *hash;
- SilcUInt32 hash_len;
-
- /* Random Number Generator. This is set by the caller and must
- be free'd by the caller. */
- SilcRng rng;
-
- /* Pointer to the what ever user data. This is set by the caller
- and is not touched by the SKE. The caller must also free this one. */
- void *user_data;
-
- /* Current status of SKE */
- SilcSKEStatus status;
-
- /* Reference counter. This is used when SKE library is performing async
- operations, like public key verification. */
- int users;
-
- /* SKE callbacks. */
- SilcSKECallbacks callbacks;
-
- /* Backwards support version indicator */
- SilcUInt32 backward_version;
-};
-/***/