aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2010-04-08 15:08:35 +0200
committerMartin Willi <martin@revosec.ch>2010-04-08 15:08:35 +0200
commitb34b93dbf7e799d24bb381b3e15ef0d98f4adebb (patch)
treec7beafa14ae750f4865784969c76afa4a8acd19a /src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c
parent6c1dc87551e10fe9f497a32314d3dd663eb2105e (diff)
downloadstrongswan-b34b93dbf7e799d24bb381b3e15ef0d98f4adebb.tar.bz2
strongswan-b34b93dbf7e799d24bb381b3e15ef0d98f4adebb.tar.xz
Store DH generator in a chunk, hide non-public data in a private struct
Diffstat (limited to 'src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c')
-rw-r--r--src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c b/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c
index 1520d5783..9a032c54f 100644
--- a/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c
+++ b/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c
@@ -128,10 +128,9 @@ static status_t set_modulus(private_openssl_diffie_hellman_t *this)
{
return NOT_FOUND;
}
- this->dh->p = BN_bin2bn(params->prime, params->prime_len, NULL);
- this->dh->g = BN_new();
- BN_set_word(this->dh->g, params->generator);
- if (params->exp_len != params->prime_len)
+ this->dh->p = BN_bin2bn(params->prime.ptr, params->prime.len, NULL);
+ this->dh->g = BN_bin2bn(params->generator.ptr, params->generator.len, NULL);
+ if (params->exp_len != params->prime.len)
{
this->dh->length = params->exp_len * 8;
}