Store DH generator in a chunk, hide non-public data in a private struct

This commit is contained in:
Martin Willi
2010-04-08 15:08:35 +02:00
parent 6c1dc87551
commit b34b93dbf7
5 changed files with 305 additions and 313 deletions
+5 -20
View File
@@ -112,36 +112,21 @@ struct diffie_hellman_t {
* Parameters for a specific diffie hellman group.
*/
struct diffie_hellman_params_t {
/**
* DH group.
*/
diffie_hellman_group_t group;
/**
* The prime as byte array.
* The prime of the group
*/
const u_int8_t *prime;
const chunk_t prime;
/**
* Length of the prime (in bytes).
* Generator of the group
*/
size_t prime_len;
const chunk_t generator;
/**
* Optimal length of the exponent (in bytes), as specified in RFC 3526.
*/
size_t opt_exp_len;
/**
* Length of the exponent (in bytes) that should be used, depending on
* the dh_exponent_ansi_x9_42 setting in strongswan.conf.
* Exponent length to use
*/
size_t exp_len;
/**
* Generator.
*/
u_int16_t generator;
};
/**