mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-07 10:40:28 +09:00
dh: Rename variables for DH key exchange
Rename and refactor how some variables are held in ssh_crypto_struct. Refactor allocation of dh exchange public keys. This is in preparation for switching the code to use openssl native DH handling and allowed to better reason about the code and the overall API. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Andreas Schneider
parent
997fe4d418
commit
2f38af1559
@@ -45,6 +45,7 @@
|
||||
#ifdef HAVE_OPENSSL_ECDH_H
|
||||
#include <openssl/ecdh.h>
|
||||
#endif
|
||||
#include "libssh/dh.h"
|
||||
#include "libssh/ecdh.h"
|
||||
#include "libssh/kex.h"
|
||||
#include "libssh/curve25519.h"
|
||||
@@ -98,10 +99,11 @@ enum ssh_cipher_e {
|
||||
SSH_AEAD_CHACHA20_POLY1305
|
||||
};
|
||||
|
||||
struct dh_ctx;
|
||||
|
||||
struct ssh_crypto_struct {
|
||||
bignum e,f,x,k,y;
|
||||
bignum g, p;
|
||||
int dh_group_is_mutable; /* do free group parameters */
|
||||
bignum shared_secret;
|
||||
struct dh_ctx *dh_ctx;
|
||||
#ifdef WITH_GEX
|
||||
size_t dh_pmin; int dh_pn; int dh_pmax; /* preferred group parameters */
|
||||
#endif /* WITH_GEX */
|
||||
|
||||
@@ -25,6 +25,18 @@
|
||||
|
||||
#include "libssh/crypto.h"
|
||||
|
||||
struct dh_keypair {
|
||||
bignum priv_key;
|
||||
bignum pub_key;
|
||||
};
|
||||
|
||||
struct dh_ctx {
|
||||
struct dh_keypair client;
|
||||
struct dh_keypair server;
|
||||
bignum generator;
|
||||
bignum modulus;
|
||||
};
|
||||
|
||||
int ssh_dh_init(void);
|
||||
void ssh_dh_finalize(void);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user