summaryrefslogtreecommitdiff
path: root/lib/auth
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2017-08-07 16:23:29 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2017-08-08 08:30:01 +0200
commit2c5129f360384cc74aa94290c4edd1463d3e558f (patch)
tree50aad16304755e84d2cf8b4ffd73384e1d9f74b6 /lib/auth
parentd9a3e84f99f90b21d79a5874a0f117a3a2c524b7 (diff)
downloadgnutls-2c5129f360384cc74aa94290c4edd1463d3e558f.tar.gz
gnutls_pk_params_st: separate flags/qbits and curve
Previously we were using the field flags to store the size of q in case of GNUTLS_PK_DH, some key generation flags in case of GNUTLS_PK_RSA, and the curve in case of elliptic curve key. Separate this into multiple fields to reduce confusion on the field. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Diffstat (limited to 'lib/auth')
-rw-r--r--lib/auth/dh_common.c4
-rw-r--r--lib/auth/ecdhe.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/auth/dh_common.c b/lib/auth/dh_common.c
index 1612f3427f..df57747183 100644
--- a/lib/auth/dh_common.c
+++ b/lib/auth/dh_common.c
@@ -244,7 +244,7 @@ _gnutls_proc_dh_common_server_kx(gnutls_session_t session,
used_ffdhe = 1;
_gnutls_session_group_set(session, session->internals.priorities->groups.entry[j]);
- session->key.dh_params.flags = *session->internals.priorities->groups.entry[j]->q_bits;
+ session->key.dh_params.qbits = *session->internals.priorities->groups.entry[j]->q_bits;
break;
}
}
@@ -312,7 +312,7 @@ _gnutls_dh_common_print_server_kx(gnutls_session_t session,
gnutls_buffer_st * data)
{
int ret;
- unsigned q_bits = session->key.dh_params.flags;
+ unsigned q_bits = session->key.dh_params.qbits;
if (q_bits < 192 && q_bits != 0) {
gnutls_assert();
diff --git a/lib/auth/ecdhe.c b/lib/auth/ecdhe.c
index ae8c9f11fa..7baee665cf 100644
--- a/lib/auth/ecdhe.c
+++ b/lib/auth/ecdhe.c
@@ -99,7 +99,7 @@ static int calc_ecdh_key(gnutls_session_t session,
pub.params[ECC_Y] = session->key.ecdh_y;
pub.raw_pub.data = session->key.ecdhx.data;
pub.raw_pub.size = session->key.ecdhx.size;
- pub.flags = ecurve->id;
+ pub.curve = ecurve->id;
ret =
_gnutls_pk_derive(ecurve->pk, &tmp_dh_key,