diff options
author | tb <> | 2022-06-29 08:27:52 +0000 |
---|---|---|
committer | tb <> | 2022-06-29 08:27:52 +0000 |
commit | d514ed3f0a5ed2d924983d4533a179823bf09ca0 (patch) | |
tree | 737bede5c25ec5b6855578423751b08517e50653 /src/lib/libssl/tls_key_share.c | |
parent | 24c464130eda826952b6d98e975e3dd7c8181b84 (diff) | |
download | openbsd-d514ed3f0a5ed2d924983d4533a179823bf09ca0.tar.gz openbsd-d514ed3f0a5ed2d924983d4533a179823bf09ca0.tar.bz2 openbsd-d514ed3f0a5ed2d924983d4533a179823bf09ca0.zip |
Check the security of DH key shares
ok beck, looks good to jsing
Diffstat (limited to '')
-rw-r--r-- | src/lib/libssl/tls_key_share.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lib/libssl/tls_key_share.c b/src/lib/libssl/tls_key_share.c index e5e6c304b6..0b941d8b0d 100644 --- a/src/lib/libssl/tls_key_share.c +++ b/src/lib/libssl/tls_key_share.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls_key_share.c,v 1.4 2022/01/11 18:28:41 jsing Exp $ */ | 1 | /* $OpenBSD: tls_key_share.c,v 1.5 2022/06/29 08:27:52 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2020, 2021 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2020, 2021 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -471,3 +471,14 @@ tls_key_share_derive(struct tls_key_share *ks, uint8_t **shared_key, | |||
471 | return tls_key_share_derive_ecdhe_ecp(ks, shared_key, | 471 | return tls_key_share_derive_ecdhe_ecp(ks, shared_key, |
472 | shared_key_len); | 472 | shared_key_len); |
473 | } | 473 | } |
474 | |||
475 | int | ||
476 | tls_key_share_peer_security(const SSL *ssl, struct tls_key_share *ks) | ||
477 | { | ||
478 | switch (ks->nid) { | ||
479 | case NID_dhKeyAgreement: | ||
480 | return ssl_security_dh(ssl, ks->dhe_peer); | ||
481 | default: | ||
482 | return 0; | ||
483 | } | ||
484 | } | ||