diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2003-02-03 16:11:43 +0000 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2003-02-03 16:11:43 +0000 |
commit | dab47e0ecb7c96e6737a52e06c7b56fbe93d1237 (patch) | |
tree | 6d78dc998972f5e6ed53d36eceeb70ad358f37f5 /lib/auth_dhe.c | |
parent | 198cf86a48fd021c861f232cd6e7abfa8b68b911 (diff) | |
download | gnutls-dab47e0ecb7c96e6737a52e06c7b56fbe93d1237.tar.gz |
* gnutls_dh_params_generate() and gnutls_rsa_params_generate() now use
gnutls_malloc() to allocate the output parameters.
* Added gnutls_pkcs3_extract_dh_params() which extracts parameters from
PKCS#3 encoded structures. This was in order to read parameters generated
using the openssl dhparam tool.
* Several changes in the temporary (DH/RSA) parameter codebase. No DH
parameters are now included in the library. Also a credentials structure
can now hold only one temporary parameter.
Diffstat (limited to 'lib/auth_dhe.c')
-rw-r--r-- | lib/auth_dhe.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/auth_dhe.c b/lib/auth_dhe.c index 6a8520033e..0d476da51f 100644 --- a/lib/auth_dhe.c +++ b/lib/auth_dhe.c @@ -95,6 +95,7 @@ static int gen_dhe_server_kx(gnutls_session session, opaque ** data) } bits = _gnutls_dh_get_prime_bits( session); +fprintf(stderr, "bits: %d\n", bits); /* find the appropriate certificate */ if ((ret = @@ -105,10 +106,9 @@ static int gen_dhe_server_kx(gnutls_session session, opaque ** data) return ret; } - g = gnutls_get_dh_params( cred->dh_params, &p, bits); - if (g == NULL) { + if ( (ret=_gnutls_get_dh_params( cred->dh_params, &p, &g)) < 0) { gnutls_assert(); - return GNUTLS_E_MEMORY_ERROR; + return ret; } if ( (ret=_gnutls_auth_info_set( session, GNUTLS_CRD_CERTIFICATE, @@ -266,10 +266,9 @@ GNUTLS_MPI p, g; return GNUTLS_E_INSUFICIENT_CREDENTIALS; } - g = gnutls_get_dh_params( cred->dh_params, &p, bits); - if (g == NULL || p == NULL) { + if ( (ret=_gnutls_get_dh_params( cred->dh_params, &p, &g)) < 0) { gnutls_assert(); - return GNUTLS_E_MEMORY_ERROR; + return ret; } ret = _gnutls_proc_dh_common_client_kx( session, data, _data_size, g, p); |