summaryrefslogtreecommitdiffhomepage
path: root/kex.h
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2013-10-21 22:57:21 +0800
committerMatt Johnston <matt@ucc.asn.au>2013-10-21 22:57:21 +0800
commit8eefb092c83f8f89f4d5574e4a05799eb9df3de8 (patch)
tree38ab731e4c38f1e287c187a9ca14ea73a92f9434 /kex.h
parent3d733a16e9ee856a45a1fbd9a1b48005d78063f9 (diff)
parent45bd0edae52c07daa2d54ca7f7c0a57d51130791 (diff)
Merge in ECC
Diffstat (limited to 'kex.h')
-rw-r--r--kex.h29
1 files changed, 27 insertions, 2 deletions
diff --git a/kex.h b/kex.h
index 72430e9..e2e186b 100644
--- a/kex.h
+++ b/kex.h
@@ -27,16 +27,26 @@
#include "includes.h"
#include "algo.h"
+#include "signkey.h"
void send_msg_kexinit();
void recv_msg_kexinit();
void send_msg_newkeys();
void recv_msg_newkeys();
void kexfirstinitialise();
-void gen_kexdh_vals(mp_int *dh_pub, mp_int *dh_priv);
-void kexdh_comb_key(mp_int *dh_pub_us, mp_int *dh_priv, mp_int *dh_pub_them,
+
+struct kex_dh_param *gen_kexdh_param();
+void free_kexdh_param(struct kex_dh_param *param);
+void kexdh_comb_key(struct kex_dh_param *param, mp_int *dh_pub_them,
sign_key *hostkey);
+#ifdef DROPBEAR_ECDH
+struct kex_ecdh_param *gen_kexecdh_param();
+void free_kexecdh_param(struct kex_ecdh_param *param);
+void kexecdh_comb_key(struct kex_ecdh_param *param, buffer *pub_them,
+ sign_key *hostkey);
+#endif
+
#ifndef DISABLE_ZLIB
int is_compress_trans();
int is_compress_recv();
@@ -66,6 +76,21 @@ struct KEXState {
};
+#define DH_P_1_LEN 128
+extern const unsigned char dh_p_1[DH_P_1_LEN];
+#define DH_P_14_LEN 256
+extern const unsigned char dh_p_14[DH_P_14_LEN];
+
+struct kex_dh_param {
+ mp_int pub; /* e */
+ mp_int priv; /* x */
+};
+
+#ifdef DROPBEAR_ECDH
+struct kex_ecdh_param {
+ ecc_key key;
+};
+#endif
#define MAX_KEXHASHBUF 2000