summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_locl.h
diff options
context:
space:
mode:
authorjsing <>2020-01-30 16:25:09 +0000
committerjsing <>2020-01-30 16:25:09 +0000
commit1f07a6fc3b3b9d44b731e6cf17fd00b540758db8 (patch)
treec2c8df4a9c431efa5cc0db8ff09bf1be05c80c4e /src/lib/libssl/ssl_locl.h
parent668fa98385559e6ca53555e32da8e7eb618f0d80 (diff)
downloadopenbsd-1f07a6fc3b3b9d44b731e6cf17fd00b540758db8.tar.gz
openbsd-1f07a6fc3b3b9d44b731e6cf17fd00b540758db8.tar.bz2
openbsd-1f07a6fc3b3b9d44b731e6cf17fd00b540758db8.zip
Factor out/rewrite the ECDHE EC point key exchange code.
This reduces replication between the existing TLS client/server and allows the code to soon be reused for TLSv1.3. With feedback from inoguchi@ and tb@ ok inoguchi@ tb@
Diffstat (limited to 'src/lib/libssl/ssl_locl.h')
-rw-r--r--src/lib/libssl/ssl_locl.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/libssl/ssl_locl.h b/src/lib/libssl/ssl_locl.h
index 6c33ec9743..5ff6f39b45 100644
--- a/src/lib/libssl/ssl_locl.h
+++ b/src/lib/libssl/ssl_locl.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_locl.h,v 1.257 2020/01/29 17:08:49 jsing Exp $ */ 1/* $OpenBSD: ssl_locl.h,v 1.258 2020/01/30 16:25:09 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -872,6 +872,7 @@ typedef struct ssl3_state_internal_st {
872 DH *dh; 872 DH *dh;
873 873
874 EC_KEY *ecdh; /* holds short lived ECDH key */ 874 EC_KEY *ecdh; /* holds short lived ECDH key */
875 int ecdh_nid;
875 876
876 uint8_t *x25519; 877 uint8_t *x25519;
877 878
@@ -1017,6 +1018,7 @@ typedef struct sess_cert_st {
1017 /* Obviously we don't have the private keys of these, 1018 /* Obviously we don't have the private keys of these,
1018 * so maybe we shouldn't even use the CERT_PKEY type here. */ 1019 * so maybe we shouldn't even use the CERT_PKEY type here. */
1019 1020
1021 int peer_nid;
1020 DH *peer_dh_tmp; 1022 DH *peer_dh_tmp;
1021 EC_KEY *peer_ecdh_tmp; 1023 EC_KEY *peer_ecdh_tmp;
1022 uint8_t *peer_x25519_tmp; 1024 uint8_t *peer_x25519_tmp;
@@ -1278,6 +1280,12 @@ int ssl3_get_client_certificate(SSL *s);
1278int ssl3_get_client_key_exchange(SSL *s); 1280int ssl3_get_client_key_exchange(SSL *s);
1279int ssl3_get_cert_verify(SSL *s); 1281int ssl3_get_cert_verify(SSL *s);
1280 1282
1283int ssl_kex_generate_ecdhe_ecp(EC_KEY *ecdh, int nid);
1284int ssl_kex_public_ecdhe_ecp(EC_KEY *ecdh, CBB *cbb);
1285int ssl_kex_peer_public_ecdhe_ecp(EC_KEY *ecdh, int nid, CBS *cbs);
1286int ssl_kex_derive_ecdhe_ecp(EC_KEY *ecdh, EC_KEY *ecdh_peer,
1287 uint8_t **shared_key, size_t *shared_key_len);
1288
1281int tls1_new(SSL *s); 1289int tls1_new(SSL *s);
1282void tls1_free(SSL *s); 1290void tls1_free(SSL *s);
1283void tls1_clear(SSL *s); 1291void tls1_clear(SSL *s);