summaryrefslogtreecommitdiff
path: root/kex.h
diff options
context:
space:
mode:
authorSimon Wilkinson <simon@sxw.org.uk>2014-02-09 16:09:48 +0000
committerColin Watson <cjwatson@debian.org>2023-02-03 00:39:07 +0000
commit61798b25a23b55d72a86a35062106cc3fc0ab834 (patch)
tree4d8425a5af38ee4fc200c653bf42e92e7425221b /kex.h
parentcf3c3acb2b8f74eeca7fcee269b1d33ac83f1188 (diff)
GSSAPI key exchange support
This patch has been rejected upstream: "None of the OpenSSH developers are in favour of adding this, and this situation has not changed for several years. This is not a slight on Simon's patch, which is of fine quality, but just that a) we don't trust GSSAPI implementations that much and b) we don't like adding new KEX since they are pre-auth attack surface. This one is particularly scary, since it requires hooks out to typically root-owned system resources." However, quite a lot of people rely on this in Debian, and it's better to have it merged into the main openssh package rather than having separate -krb5 packages (as we used to have). It seems to have a generally good security history. Author: Simon Wilkinson <simon@sxw.org.uk> Author: Colin Watson <cjwatson@debian.org> Author: Jakub Jelen <jjelen@redhat.com> Origin: other, https://github.com/openssh-gsskex/openssh-gsskex/pull/23 Bug: https://bugzilla.mindrot.org/show_bug.cgi?id=1242 Last-Updated: 2023-01-02 Patch-Name: gssapi.patch
Diffstat (limited to 'kex.h')
-rw-r--r--kex.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/kex.h b/kex.h
index c35329501..240dca89d 100644
--- a/kex.h
+++ b/kex.h
@@ -102,6 +102,15 @@ enum kex_exchange {
KEX_ECDH_SHA2,
KEX_C25519_SHA256,
KEX_KEM_SNTRUP761X25519_SHA512,
+#ifdef GSSAPI
+ KEX_GSS_GRP1_SHA1,
+ KEX_GSS_GRP14_SHA1,
+ KEX_GSS_GRP14_SHA256,
+ KEX_GSS_GRP16_SHA512,
+ KEX_GSS_GEX_SHA1,
+ KEX_GSS_NISTP256_SHA256,
+ KEX_GSS_C25519_SHA256,
+#endif
KEX_MAX
};
@@ -159,6 +168,12 @@ struct kex {
u_int flags;
int hash_alg;
int ec_nid;
+#ifdef GSSAPI
+ int gss_deleg_creds;
+ int gss_trust_dns;
+ char *gss_host;
+ char *gss_client;
+#endif
char *failed_choice;
int (*verify_host_key)(struct sshkey *, struct ssh *);
struct sshkey *(*load_host_public_key)(int, int, struct ssh *);
@@ -180,8 +195,10 @@ struct kex {
int kex_names_valid(const char *);
char *kex_alg_list(char);
+char *kex_gss_alg_list(char);
char *kex_names_cat(const char *, const char *);
int kex_assemble_names(char **, const char *, const char *);
+int kex_gss_names_valid(const char *);
int kex_exchange_identification(struct ssh *, int, const char *);
@@ -209,6 +226,12 @@ int kexgex_client(struct ssh *);
int kexgex_server(struct ssh *);
int kex_gen_client(struct ssh *);
int kex_gen_server(struct ssh *);
+#if defined(GSSAPI) && defined(WITH_OPENSSL)
+int kexgssgex_client(struct ssh *);
+int kexgssgex_server(struct ssh *);
+int kexgss_client(struct ssh *);
+int kexgss_server(struct ssh *);
+#endif
int kex_dh_keypair(struct kex *);
int kex_dh_enc(struct kex *, const struct sshbuf *, struct sshbuf **,
@@ -241,6 +264,12 @@ int kexgex_hash(int, const struct sshbuf *, const struct sshbuf *,
const BIGNUM *, const u_char *, size_t,
u_char *, size_t *);
+int kex_gen_hash(int hash_alg, const struct sshbuf *client_version,
+ const struct sshbuf *server_version, const struct sshbuf *client_kexinit,
+ const struct sshbuf *server_kexinit, const struct sshbuf *server_host_key_blob,
+ const struct sshbuf *client_pub, const struct sshbuf *server_pub,
+ const struct sshbuf *shared_secret, u_char *hash, size_t *hashlen);
+
void kexc25519_keygen(u_char key[CURVE25519_SIZE], u_char pub[CURVE25519_SIZE])
__attribute__((__bounded__(__minbytes__, 1, CURVE25519_SIZE)))
__attribute__((__bounded__(__minbytes__, 2, CURVE25519_SIZE)));