From 05fb446f43bd1853e81f77729f0d20084486ffb7 Mon Sep 17 00:00:00 2001 From: Iru Cai Date: Tue, 1 May 2018 00:04:09 +0800 Subject: 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} --- src/protocol/internal/ssh_session.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/protocol/internal/ssh_session.h (limited to 'src/protocol/internal/ssh_session.h') 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 -- cgit v1.2.3