26 #include "libssh/crypto.h"
30 #define DH_CLIENT_KEYPAIR 0
31 #define DH_SERVER_KEYPAIR 1
41 #if !defined(HAVE_LIBCRYPTO) || OPENSSL_VERSION_NUMBER < 0x30000000L
42 int ssh_dh_get_parameters(
struct dh_ctx *ctx,
43 const_bignum *modulus, const_bignum *generator);
45 int ssh_dh_get_parameters(
struct dh_ctx *ctx,
46 bignum *modulus, bignum *generator);
48 int ssh_dh_set_parameters(
struct dh_ctx *ctx,
49 const bignum modulus,
const bignum generator);
51 int ssh_dh_keypair_gen_keys(
struct dh_ctx *ctx,
int peer);
52 #if !defined(HAVE_LIBCRYPTO) || OPENSSL_VERSION_NUMBER < 0x30000000L
53 int ssh_dh_keypair_get_keys(
struct dh_ctx *ctx,
int peer,
54 const_bignum *priv, const_bignum *pub);
56 int ssh_dh_keypair_get_keys(
struct dh_ctx *ctx,
int peer,
57 bignum *priv, bignum *pub);
59 int ssh_dh_keypair_set_keys(
struct dh_ctx *ctx,
int peer,
60 bignum priv, bignum pub);
62 int ssh_dh_compute_shared_secret(
struct dh_ctx *ctx,
int local,
int remote,
68 int ssh_dh_init(
void);
69 void ssh_dh_finalize(
void);
71 int ssh_dh_import_next_pubkey_blob(
ssh_session session,
75 int ssh_dh_get_current_server_publickey_blob(
ssh_session session,
78 int ssh_dh_get_next_server_publickey_blob(
ssh_session session,
83 void ssh_client_dh_remove_callbacks(
ssh_session session);
88 int ssh_fallback_group(uint32_t pmax, bignum *p, bignum *g);
89 bool ssh_dh_is_known_group(bignum modulus, bignum generator);