diff options
Diffstat (limited to 'kex.c')
-rw-r--r-- | kex.c | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: kex.c,v 1.144 2019/01/21 09:55:52 djm Exp $ */ | 1 | /* $OpenBSD: kex.c,v 1.145 2019/01/21 10:05:09 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. | 3 | * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. |
4 | * | 4 | * |
@@ -1052,6 +1052,24 @@ kex_derive_keys_bn(struct ssh *ssh, u_char *hash, u_int hashlen, | |||
1052 | } | 1052 | } |
1053 | #endif | 1053 | #endif |
1054 | 1054 | ||
1055 | int | ||
1056 | kex_load_hostkey(struct ssh *ssh, struct sshkey **pubp, struct sshkey **prvp) | ||
1057 | { | ||
1058 | struct kex *kex = ssh->kex; | ||
1059 | |||
1060 | *pubp = NULL; | ||
1061 | *prvp = NULL; | ||
1062 | if (kex->load_host_public_key == NULL || | ||
1063 | kex->load_host_private_key == NULL) | ||
1064 | return SSH_ERR_INVALID_ARGUMENT; | ||
1065 | *pubp = kex->load_host_public_key(kex->hostkey_type, | ||
1066 | kex->hostkey_nid, ssh); | ||
1067 | *prvp = kex->load_host_private_key(kex->hostkey_type, | ||
1068 | kex->hostkey_nid, ssh); | ||
1069 | if (*pubp == NULL) | ||
1070 | return SSH_ERR_NO_HOSTKEY_LOADED; | ||
1071 | return 0; | ||
1072 | } | ||
1055 | 1073 | ||
1056 | #if defined(DEBUG_KEX) || defined(DEBUG_KEXDH) || defined(DEBUG_KEXECDH) | 1074 | #if defined(DEBUG_KEX) || defined(DEBUG_KEXDH) || defined(DEBUG_KEXECDH) |
1057 | void | 1075 | void |