diff options
author | Andreas Steffen <andreas.steffen@strongswan.org> | 2007-02-21 13:10:24 +0000 |
---|---|---|
committer | Andreas Steffen <andreas.steffen@strongswan.org> | 2007-02-21 13:10:24 +0000 |
commit | 7a01e2b9a3b9c2d788088c0699873bd165bdd43a (patch) | |
tree | bb3aa7791971f6b0d7b286c0fd271577b4deac03 | |
parent | 51f4dfa035bfb8f43fcd1626c447da9f93e47dce (diff) | |
download | strongswan-7a01e2b9a3b9c2d788088c0699873bd165bdd43a.tar.bz2 strongswan-7a01e2b9a3b9c2d788088c0699873bd165bdd43a.tar.xz |
SHA512-HMAC bug fix and hash function self-test support
-rw-r--r-- | src/pluto/ike_alg.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/pluto/ike_alg.h b/src/pluto/ike_alg.h index a41718c04..69a12cd43 100644 --- a/src/pluto/ike_alg.h +++ b/src/pluto/ike_alg.h @@ -38,13 +38,33 @@ struct encrypt_desc { void (*do_crypt)(u_int8_t *dat, size_t datasize, u_int8_t *key, size_t key_size, u_int8_t *iv, bool enc); }; +typedef struct hash_testvector hash_testvector_t; + +struct hash_testvector { + const size_t msg_size; + const u_char *msg; + const u_char *msg_digest; +}; + +typedef struct hmac_testvector hmac_testvector_t; + +struct hmac_testvector { + const size_t key_size; + const u_char *key; + const size_t msg_size; + const u_char *msg; + const u_char *hmac; +}; struct hash_desc { u_int16_t algo_type; u_int16_t algo_id; struct ike_alg *algo_next; size_t hash_ctx_size; + size_t hash_block_size; size_t hash_digest_size; + const hash_testvector_t *hash_testvectors; + const hmac_testvector_t *hmac_testvectors; void (*hash_init)(void *ctx); void (*hash_update)(void *ctx, const u_int8_t *in, size_t datasize); void (*hash_final)(u_int8_t *out, void *ctx); @@ -66,6 +86,7 @@ extern const struct oakley_group_desc* ike_alg_pfsgroup(struct connection *c extern struct db_context * ike_alg_db_new(struct alg_info_ike *ai, lset_t policy); extern void ike_alg_list(void); extern void ike_alg_show_connection(struct connection *c, const char *instance); +extern bool ik_alg_test(void); extern bool ike_alg_ok_final(u_int ealg, u_int key_len, u_int aalg, u_int group , struct alg_info_ike *alg_info_ike); extern int ike_alg_init(void); |