diff options
Diffstat (limited to 'include/libssh/crypto.h')
-rw-r--r-- | include/libssh/crypto.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/include/libssh/crypto.h b/include/libssh/crypto.h index ede71661..32016827 100644 --- a/include/libssh/crypto.h +++ b/include/libssh/crypto.h @@ -111,7 +111,11 @@ struct ssh_crypto_struct { #endif /* WITH_GEX */ #ifdef HAVE_ECDH #ifdef HAVE_OPENSSL_ECC +#if OPENSSL_VERSION_NUMBER < 0x30000000L EC_KEY *ecdh_privkey; +#else + EVP_PKEY *ecdh_privkey; +#endif /* OPENSSL_VERSION_NUMBER */ #elif defined HAVE_GCRYPT_ECC gcry_sexp_t ecdh_privkey; #elif defined HAVE_LIBMBEDCRYPTO @@ -126,8 +130,9 @@ struct ssh_crypto_struct { ssh_curve25519_pubkey curve25519_server_pubkey; #endif ssh_string dh_server_signature; /* information used by dh_handshake. */ - size_t digest_len; /* len of the two fields below */ + size_t session_id_len; unsigned char *session_id; + size_t digest_len; /* len of the secret hash */ unsigned char *secret_hash; /* Secret hash is same as session id until re-kex */ unsigned char *encryptIV; unsigned char *decryptIV; @@ -207,10 +212,23 @@ struct ssh_cipher_struct { void (*cleanup)(struct ssh_cipher_struct *cipher); }; +#ifdef __cplusplus +extern "C" { +#endif + const struct ssh_cipher_struct *ssh_get_chacha20poly1305_cipher(void); int sshkdf_derive_key(struct ssh_crypto_struct *crypto, unsigned char *key, size_t key_len, - int key_type, unsigned char *output, + uint8_t key_type, unsigned char *output, size_t requested_len); +int secure_memcmp(const void *s1, const void *s2, size_t n); +#if defined(HAVE_LIBCRYPTO) && !defined(WITH_PKCS11_PROVIDER) +ENGINE *pki_get_engine(void); +#endif /* HAVE_LIBCRYPTO */ + +#ifdef __cplusplus +} +#endif + #endif /* _CRYPTO_H_ */ |