#ifndef SILCSKE_H
#define SILCSKE_H
-/****h* silcske/SilcSKEAPI
+/****h* silcske/SILC SKE Interface
*
* DESCRIPTION
*
*
* typedef void (*SilcSKEVerifyCb)(SilcSKE ske,
* unsigned char *pk_data,
- * uint32 pk_len,
+ * SilcUInt32 pk_len,
* SilcSKEPKType pk_type,
* void *context,
* SilcSKEVerifyCbCompletion completion,
***/
typedef void (*SilcSKEVerifyCb)(SilcSKE ske,
unsigned char *pk_data,
- uint32 pk_len,
+ SilcUInt32 pk_len,
SilcSKEPKType pk_type,
void *context,
SilcSKEVerifyCbCompletion completion,
*
* typedef SilcSKEStatus (*SilcSKECheckVersion)(SilcSKE ske,
* unsigned char *version,
- * uint32 len, void *context);
+ * SilcUInt32 len, void *context);
*
* DESCRIPTION
*
***/
typedef SilcSKEStatus (*SilcSKECheckVersion)(SilcSKE ske,
unsigned char *version,
- uint32 len, void *context);
+ SilcUInt32 len, void *context);
/****s* silcske/SilcSKEAPI/SilcSKEKeyMaterial
*
typedef struct {
unsigned char *send_iv;
unsigned char *receive_iv;
- uint32 iv_len;
+ SilcUInt32 iv_len;
unsigned char *send_enc_key;
unsigned char *receive_enc_key;
- uint32 enc_key_len;
+ SilcUInt32 enc_key_len;
unsigned char *send_hmac_key;
unsigned char *receive_hmac_key;
- uint32 hmac_key_len;
+ SilcUInt32 hmac_key_len;
} SilcSKEKeyMaterial;
/* Length of cookie in Start Payload */
/* The hash value HASH of the key exchange */
unsigned char *hash;
- uint32 hash_len;
+ SilcUInt32 hash_len;
/* Random Number Generator. This is set by the caller and must
be free'd by the caller. */
SilcSKECallbacks callbacks;
/* Backwards support version indicator */
- uint32 backward_version;
+ SilcUInt32 backward_version;
};
/***/
* SYNOPSIS
*
* SilcSKEStatus silc_ske_process_key_material(SilcSKE ske,
- * uint32 req_iv_len,
- * uint32 req_enc_key_len,
- * uint32 req_hmac_key_len,
+ * SilcUInt32 req_iv_len,
+ * SilcUInt32 req_enc_key_len,
+ * SilcUInt32 req_hmac_key_len,
* SilcSKEKeyMaterial *key);
*
* DESCRIPTION
*
***/
SilcSKEStatus silc_ske_process_key_material(SilcSKE ske,
- uint32 req_iv_len,
- uint32 req_enc_key_len,
- uint32 req_hmac_key_len,
+ SilcUInt32 req_iv_len,
+ SilcUInt32 req_enc_key_len,
+ SilcUInt32 req_hmac_key_len,
SilcSKEKeyMaterial *key);
/****f* silcske/SilcSKEAPI/silc_ske_process_key_material_data
*
* SilcSKEStatus
* silc_ske_process_key_material_data(unsigned char *data,
- * uint32 data_len,
- * uint32 req_iv_len,
- * uint32 req_enc_key_len,
- * uint32 req_hmac_key_len,
+ * SilcUInt32 data_len,
+ * SilcUInt32 req_iv_len,
+ * SilcUInt32 req_enc_key_len,
+ * SilcUInt32 req_hmac_key_len,
* SilcHash hash,
* SilcSKEKeyMaterial *key);
*
***/
SilcSKEStatus
silc_ske_process_key_material_data(unsigned char *data,
- uint32 data_len,
- uint32 req_iv_len,
- uint32 req_enc_key_len,
- uint32 req_hmac_key_len,
+ SilcUInt32 data_len,
+ SilcUInt32 req_iv_len,
+ SilcUInt32 req_enc_key_len,
+ SilcUInt32 req_hmac_key_len,
SilcHash hash,
SilcSKEKeyMaterial *key);
***/
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 */