aboutsummaryrefslogtreecommitdiff
path: root/src/openvpn/crypto_mbedtls.c
diff options
context:
space:
mode:
authorArne Schwabe2020-10-09 13:54:53 +0200
committerGert Doering2020-10-09 18:07:27 +0200
commit6dc09d0d4520483716530e12a444b156720cdfcc (patch)
tree8944ec2fbe13444afcead90a6a308a30f8009710 /src/openvpn/crypto_mbedtls.c
parent1e6e083e8888042d58f9541bf74d343d52fc5681 (diff)
downloadopenvpn-6dc09d0d4520483716530e12a444b156720cdfcc.zip
openvpn-6dc09d0d4520483716530e12a444b156720cdfcc.tar.gz
Implement generating data channel keys via EKM/RFC 5705
OpenVPN currently uses its own (based on TLS 1.0) key derivation mechanism to generate the 256 bytes key data in key2 struct that are then used used to generate encryption/hmac/iv vectors. While this mechanism is still secure, it is not state of the art. Instead of modernising our own approach, this commit implements key derivation using the Keying Material Exporters API introduced by RFC 5705. We also use an opportunistic approach of negotiating the use of EKM (exported key material) through an IV_PROTO flag and prefer EKM to our own PRF if both client and server support it. The use of EKM is pushed to the client as part of NCP as key-derivation tls-ekm. We still exchange the random data (112 bytes from client to server and 64 byte from server to client) for the OpenVPN PRF but do not use it. Removing that exchange would break the handshake and make a key-method 3 or similar necessary. As a side effect, this makes a little bit easier to have a FIPS compatible version of OpenVPN since we do not rely on calling MD5 anymore. Side note: this commit breaks the (not yet merged) WolfSSL support as it claims to support EKM in the OpenSSL compat API but always returns an error if you try to use it. Patch v2: rebase/change to V2 of EKM refactoring Patch v3: add Changes.rst Patch v4: Rebase on master. Patch v5: Refuse internal label to be used with --keying-material-exporter, polishing/fixes suggested by Steffan integrated Signed-off-by: Arne Schwabe <arne@rfc2549.org> Acked-by: Steffan Karger <steffan.karger@foxcrypto.com> Message-Id: <20201009115453.4279-1-arne@rfc2549.org> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg21187.html Signed-off-by: Gert Doering <gert@greenie.muc.de>
Diffstat (limited to 'src/openvpn/crypto_mbedtls.c')
0 files changed, 0 insertions, 0 deletions