summaryrefslogtreecommitdiff
path: root/src/protocol/internal/ssh_session.h
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2018-05-01 00:04:09 +0800
committerIru Cai <mytbk920423@gmail.com>2018-05-04 19:46:06 +0800
commit05fb446f43bd1853e81f77729f0d20084486ffb7 (patch)
treee58b8ec5920bca6d6028fb31e78fa35b44c9a054 /src/protocol/internal/ssh_session.h
parentdffefc69bf9d0b9754e1a8b1426be9c51c8e5eb1 (diff)
downloadfqterm-05fb446f43bd1853e81f77729f0d20084486ffb7.tar.xz
refactor using ssh_session structure
* move computeKey to C code * Use `mpint_e`, `secret` instead of bn_e, bn_K, drop bn_f * compute DH image and secret in DH related code * drop {get,put}{BN2,SSH2BN}
Diffstat (limited to 'src/protocol/internal/ssh_session.h')
-rw-r--r--src/protocol/internal/ssh_session.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/protocol/internal/ssh_session.h b/src/protocol/internal/ssh_session.h
new file mode 100644
index 0000000..d7df1c9
--- /dev/null
+++ b/src/protocol/internal/ssh_session.h
@@ -0,0 +1,23 @@
+#ifndef SSH_SESSION_H
+#define SSH_SESSION_H
+
+#include "ssh_diffie-hellman.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* } for better indentation in Vim */
+
+typedef struct
+{
+ unsigned char *session_id;
+ unsigned char H[SHA512_DIGEST_LENGTH];
+ SSH_DH *dh;
+} ssh_session;
+
+void computeKey(ssh_session *, int, char, unsigned char []);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif