summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/kex.h
diff options
context:
space:
mode:
authorNiels Provos <provos@cvs.openbsd.org>2000-10-11 04:02:19 +0000
committerNiels Provos <provos@cvs.openbsd.org>2000-10-11 04:02:19 +0000
commit8ef2c7e4d780ac0f723a5d73bf24723ed8ef3cbd (patch)
tree0564ffe59ef6df32e25ab2ae8b01b6c2aa9115b6 /usr.bin/ssh/kex.h
parentf51b9361bdced13cc5b955d542ca6120d8b62be7 (diff)
First rough implementation of the diffie-hellman group exchange. The
client can ask the server for bigger groups to perform the diffie-hellman in, thus increasing the attack complexity when using ciphers with longer keys. University of Windsor provided network, T the company.
Diffstat (limited to 'usr.bin/ssh/kex.h')
-rw-r--r--usr.bin/ssh/kex.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/usr.bin/ssh/kex.h b/usr.bin/ssh/kex.h
index 8c89687b606..36af701e495 100644
--- a/usr.bin/ssh/kex.h
+++ b/usr.bin/ssh/kex.h
@@ -24,8 +24,9 @@
#ifndef KEX_H
#define KEX_H
-#define KEX_DH1 "diffie-hellman-group1-sha1"
-#define KEX_DSS "ssh-dss"
+#define KEX_DH1 "diffie-hellman-group1-sha1"
+#define KEX_DHGEX "diffie-hellman-group-exchange-sha1"
+#define KEX_DSS "ssh-dss"
enum kex_init_proposals {
PROPOSAL_KEX_ALGS,
@@ -47,6 +48,11 @@ enum kex_modes {
MODE_MAX
};
+enum kex_exchange {
+ DH_GRP1_SHA1,
+ DH_GEX_SHA1
+};
+
typedef struct Kex Kex;
typedef struct Mac Mac;
typedef struct Comp Comp;
@@ -83,6 +89,7 @@ struct Kex {
int server;
char *name;
char *hostkeyalg;
+ int kex_type;
};
Buffer *kex_init(char *myproposal[PROPOSAL_MAX]);
@@ -96,6 +103,8 @@ kex_choose_conf(char *cprop[PROPOSAL_MAX],
int kex_derive_keys(Kex *k, unsigned char *hash, BIGNUM *shared_secret);
void packet_set_kex(Kex *k);
int dh_pub_is_valid(DH *dh, BIGNUM *dh_pub);
+DH *dh_new_group_asc(const char *, const char *);
+DH *dh_new_group(BIGNUM *, BIGNUM *);
DH *dh_new_group1();
unsigned char *
@@ -109,4 +118,15 @@ kex_hash(
BIGNUM *server_dh_pub,
BIGNUM *shared_secret);
+unsigned char *
+kex_hash_gex(
+ char *client_version_string,
+ char *server_version_string,
+ char *ckexinit, int ckexinitlen,
+ char *skexinit, int skexinitlen,
+ char *serverhostkeyblob, int sbloblen,
+ int minbits, BIGNUM *prime, BIGNUM *gen,
+ BIGNUM *client_dh_pub,
+ BIGNUM *server_dh_pub,
+ BIGNUM *shared_secret);
#endif