1 /* IKE modular algorithm handling interface
2 * Author: JuanJo Ciarlante <jjo-ipsec@mendoza.gov.ar>
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 #include "connections.h"
23 struct ike_alg
*algo_next
;
26 typedef struct enc_testvector enc_testvector_t
;
28 struct enc_testvector
{
29 const size_t key_size
;
32 const size_t data_size
;
40 struct ike_alg
*algo_next
;
46 const enc_testvector_t
*enc_testvectors
;
49 typedef struct hash_testvector hash_testvector_t
;
51 struct hash_testvector
{
52 const size_t msg_size
;
54 const u_char
*msg_digest
;
57 typedef struct hmac_testvector hmac_testvector_t
;
59 struct hmac_testvector
{
60 const size_t key_size
;
62 const size_t msg_size
;
69 struct ike_alg
*algo_next
;
71 size_t hash_digest_size
;
72 const hash_testvector_t
*hash_testvectors
;
73 const hmac_testvector_t
*hmac_testvectors
;
76 #define IKE_ALG_ENCRYPT 0
77 #define IKE_ALG_HASH 1
78 #define IKE_ALG_MAX IKE_ALG_HASH
80 extern int ike_alg_add(struct ike_alg
*a
);
81 extern struct hash_desc
*ike_alg_get_hasher(u_int alg
);
82 extern struct encrypt_desc
*ike_alg_get_encrypter(u_int alg
);
83 extern bool ike_alg_enc_present(u_int ealg
);
84 extern bool ike_alg_hash_present(u_int halg
);
85 extern int ike_alg_register_hash(struct hash_desc
*a
);
86 extern int ike_alg_register_enc(struct encrypt_desc
*e
);
87 extern const struct oakley_group_desc
* ike_alg_pfsgroup(struct connection
*c
89 extern struct db_context
* ike_alg_db_new(struct alg_info_ike
*ai
, lset_t policy
);
90 extern void ike_alg_list(void);
91 extern void ike_alg_show_connection(struct connection
*c
, const char *instance
);
92 extern bool ike_alg_test(void);
93 extern bool ike_alg_ok_final(u_int ealg
, u_int key_len
, u_int aalg
, u_int group
94 , struct alg_info_ike
*alg_info_ike
);
95 extern int ike_alg_init(void);
97 #endif /* _IKE_ALG_H */