mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 12:20:42 +09:00
Fix the dh.c build with libgcrypt
Fixes bug reported by gentoo at https://bugs.gentoo.org/show_bug.cgi?id=533424 The function was only used by EDCSA backend which are not supported by the libgcrypt code anyway.
This commit is contained in:
@@ -49,7 +49,9 @@ int hashbufin_add_cookie(ssh_session session, unsigned char *cookie);
|
||||
int hashbufout_add_cookie(ssh_session session);
|
||||
int generate_session_keys(ssh_session session);
|
||||
bignum make_string_bn(ssh_string string);
|
||||
#ifdef HAVE_LIBCRYPTO
|
||||
void make_string_bn_inplace(ssh_string string, bignum bnout);
|
||||
#endif /* HAVE_LIBCRYPTO */
|
||||
ssh_string make_bignum_string(bignum num);
|
||||
|
||||
#endif /* DH_H_ */
|
||||
|
||||
11
src/dh.c
11
src/dh.c
@@ -407,14 +407,17 @@ bignum make_string_bn(ssh_string string){
|
||||
return bn;
|
||||
}
|
||||
|
||||
#ifdef HAVE_LIBCRYPTO
|
||||
/** @internal
|
||||
* @brief converts the content of a SSH string in an already allocated bignum
|
||||
* @warning only available with OpenSSL builds
|
||||
*/
|
||||
void make_string_bn_inplace(ssh_string string, bignum bnout) {
|
||||
unsigned int len = ssh_string_len(string);
|
||||
#ifdef HAVE_LIBGCRYPT
|
||||
#error "unsupported"
|
||||
#elif defined HAVE_LIBCRYPTO
|
||||
bignum_bin2bn(string->data, len, bnout);
|
||||
#endif
|
||||
}
|
||||
#endif /* HAVE_LIBCRYPTO */
|
||||
|
||||
|
||||
ssh_string dh_get_e(ssh_session session) {
|
||||
return make_bignum_string(session->next_crypto->e);
|
||||
|
||||
Reference in New Issue
Block a user