Adapt handshake fields to ffdh
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
diff --git a/library/ssl_tls13_generic.c b/library/ssl_tls13_generic.c
index 1bf627d..4ea4d01 100644
--- a/library/ssl_tls13_generic.c
+++ b/library/ssl_tls13_generic.c
@@ -1516,8 +1516,8 @@
MBEDTLS_SSL_CHK_BUF_READ_PTR(p, end, peerkey_len);
/* Store peer's ECDH public key. */
- memcpy(handshake->ecdh_psa_peerkey, p, peerkey_len);
- handshake->ecdh_psa_peerkey_len = peerkey_len;
+ memcpy(handshake->dh_psa_peerkey, p, peerkey_len);
+ handshake->dh_psa_peerkey_len = peerkey_len;
return 0;
}
@@ -1592,18 +1592,18 @@
return MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL;
}
- handshake->ecdh_psa_type = key_type;
- ssl->handshake->ecdh_bits = bits;
+ handshake->dh_psa_type = key_type;
+ ssl->handshake->dh_bits = bits;
key_attributes = psa_key_attributes_init();
psa_set_key_usage_flags(&key_attributes, PSA_KEY_USAGE_DERIVE);
psa_set_key_algorithm(&key_attributes, alg);
- psa_set_key_type(&key_attributes, handshake->ecdh_psa_type);
- psa_set_key_bits(&key_attributes, handshake->ecdh_bits);
+ psa_set_key_type(&key_attributes, handshake->dh_psa_type);
+ psa_set_key_bits(&key_attributes, handshake->dh_bits);
/* Generate ECDH/FFDH private key. */
status = psa_generate_key(&key_attributes,
- &handshake->ecdh_psa_privkey);
+ &handshake->dh_psa_privkey);
if (status != PSA_SUCCESS) {
ret = PSA_TO_MBEDTLS_ERR(status);
MBEDTLS_SSL_DEBUG_RET(1, "psa_generate_key", ret);
@@ -1612,7 +1612,7 @@
}
/* Export the public part of the ECDH/FFDH private key from PSA. */
- status = psa_export_public_key(handshake->ecdh_psa_privkey,
+ status = psa_export_public_key(handshake->dh_psa_privkey,
buf, buf_size,
&own_pubkey_len);