summaryrefslogtreecommitdiff
path: root/src/protocol/internal/ssh_diffie-hellman.h
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2018-06-04 10:03:30 +0800
committerIru Cai <mytbk920423@gmail.com>2018-06-06 21:24:00 +0800
commit172598081bb5121ee9085888b91e0e6195b5c5b5 (patch)
treeb8dc4b8af32adb57544319918bb3ef2fd5b9c928 /src/protocol/internal/ssh_diffie-hellman.h
parentd540b1fa0451f87d5bcfd13bdfbcf98013880cc2 (diff)
downloadfqterm-172598081bb5121ee9085888b91e0e6195b5c5b5.tar.xz
restruct ssh_dh
* Use strong PRNG * Add a name field * Move BIGNUM things to priv
Diffstat (limited to 'src/protocol/internal/ssh_diffie-hellman.h')
-rw-r--r--src/protocol/internal/ssh_diffie-hellman.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/protocol/internal/ssh_diffie-hellman.h b/src/protocol/internal/ssh_diffie-hellman.h
index 58733b0..4284633 100644
--- a/src/protocol/internal/ssh_diffie-hellman.h
+++ b/src/protocol/internal/ssh_diffie-hellman.h
@@ -29,14 +29,20 @@ extern "C" {
typedef struct ssh_diffie_hellman
{
- BIGNUM *g; // generator
- BIGNUM *p; // prime
- BIGNUM *bn_x; /* random number */
+ const char *name;
+ union {
+ struct {
+ BIGNUM *g; // generator
+ BIGNUM *p; // prime
+ BIGNUM *bn_x; /* random number */
+ BN_CTX *ctx;
+ } dh;
+ unsigned char privkey[32];
+ } priv;
int e_len;
unsigned char *mpint_e; /* g^x mod p */
int secret_len;
unsigned char *secret;
- BN_CTX *ctx;
evp_md_t digest;
} SSH_DH;