diff options
author | djm@openbsd.org <djm@openbsd.org> | 2019-01-21 10:28:01 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2019-01-21 22:08:47 +1100 |
commit | 9c9c97e14fe190931f341876ad98213e1e1dc19f (patch) | |
tree | 079c12ccb4e1538928872d4bc5623727119291e2 /kexkems.c | |
parent | 2f6a9ddbbf6ca8623c53c323ff17fb6d68d66970 (diff) |
upstream: use KEM API for vanilla DH KEX
from markus@ ok djm@
OpenBSD-Commit-ID: af56466426b08a8be275412ae2743319e3d277c9
Diffstat (limited to 'kexkems.c')
-rw-r--r-- | kexkems.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: kexkems.c,v 1.2 2019/01/21 10:24:09 djm Exp $ */ | 1 | /* $OpenBSD: kexkems.c,v 1.3 2019/01/21 10:28:02 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2019 Markus Friedl. All rights reserved. | 3 | * Copyright (c) 2019 Markus Friedl. All rights reserved. |
4 | * | 4 | * |
@@ -69,6 +69,14 @@ input_kex_kem_init(int type, u_int32_t seq, struct ssh *ssh) | |||
69 | 69 | ||
70 | /* compute shared secret */ | 70 | /* compute shared secret */ |
71 | switch (kex->kex_type) { | 71 | switch (kex->kex_type) { |
72 | case KEX_DH_GRP1_SHA1: | ||
73 | case KEX_DH_GRP14_SHA1: | ||
74 | case KEX_DH_GRP14_SHA256: | ||
75 | case KEX_DH_GRP16_SHA512: | ||
76 | case KEX_DH_GRP18_SHA512: | ||
77 | r = kex_dh_enc(kex, client_pubkey, pklen, &server_pubkey, | ||
78 | &shared_secret); | ||
79 | break; | ||
72 | case KEX_C25519_SHA256: | 80 | case KEX_C25519_SHA256: |
73 | r = kex_c25519_enc(kex, client_pubkey, pklen, &server_pubkey, | 81 | r = kex_c25519_enc(kex, client_pubkey, pklen, &server_pubkey, |
74 | &shared_secret); | 82 | &shared_secret); |