summaryrefslogtreecommitdiff
path: root/lib/nettle
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2017-07-14 09:34:05 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2018-02-19 15:29:33 +0100
commit30c1855c060de476e9463421791db9e013a780b1 (patch)
treeac7075fc7a04bf093e58e450a316dd3eef52720d /lib/nettle
parentd48eebb53752dc3b7cbcdbc09f5ca3cab477e7a5 (diff)
downloadgnutls-30c1855c060de476e9463421791db9e013a780b1.tar.gz
Added support for key share extension
This enables TLS 1.3 key exchange based on the key share extension. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Diffstat (limited to 'lib/nettle')
-rw-r--r--lib/nettle/pk.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/nettle/pk.c b/lib/nettle/pk.c
index 0ecd14f5c3..64f17d80c3 100644
--- a/lib/nettle/pk.c
+++ b/lib/nettle/pk.c
@@ -200,7 +200,8 @@ ecc_shared_secret(struct ecc_scalar *private_key,
static int _wrap_nettle_pk_derive(gnutls_pk_algorithm_t algo,
gnutls_datum_t * out,
const gnutls_pk_params_st * priv,
- const gnutls_pk_params_st * pub)
+ const gnutls_pk_params_st * pub,
+ unsigned int flags)
{
int ret;
@@ -249,7 +250,14 @@ static int _wrap_nettle_pk_derive(gnutls_pk_algorithm_t algo,
goto dh_cleanup;
}
- ret = _gnutls_mpi_dprint(k, out);
+ if (flags & PK_DERIVE_TLS13) {
+ ret =
+ _gnutls_mpi_dprint_size(k, out,
+ (bits+7)/8);
+ } else {
+ ret = _gnutls_mpi_dprint(k, out);
+ }
+
if (ret < 0) {
gnutls_assert();
goto dh_cleanup;