mirror of
https://github.com/vanhauser-thc/thc-hydra.git
synced 2025-08-19 21:03:52 -07:00
rsa keylength fix
This commit is contained in:
parent
a5cdf157f4
commit
bfaa4c83a7
2 changed files with 8 additions and 5 deletions
1
CHANGES
1
CHANGES
|
@ -6,6 +6,7 @@ Release 8.2-pre
|
||||||
* Better library finding in ./configure for SVN + support for Darwin Homebrew
|
* Better library finding in ./configure for SVN + support for Darwin Homebrew
|
||||||
* Fixed http-form module crash that only occurs on *BSD/OSX systems. Thanks to zdk for reporting!
|
* Fixed http-form module crash that only occurs on *BSD/OSX systems. Thanks to zdk for reporting!
|
||||||
* Fixed for SSL connection to support TLSv1.2 etc.
|
* Fixed for SSL connection to support TLSv1.2 etc.
|
||||||
|
* Support for different RSA keylengths, thanks to fann95 for the patch
|
||||||
* ... your patch?
|
* ... your patch?
|
||||||
|
|
||||||
|
|
||||||
|
|
12
hydra-mod.c
12
hydra-mod.c
|
@ -439,15 +439,17 @@ int internal__hydra_connect(char *host, int port, int protocol, int type) {
|
||||||
|
|
||||||
#ifdef LIBOPENSSL
|
#ifdef LIBOPENSSL
|
||||||
RSA *ssl_temp_rsa_cb(SSL * ssl, int export, int keylength) {
|
RSA *ssl_temp_rsa_cb(SSL * ssl, int export, int keylength) {
|
||||||
if (rsa == NULL) {
|
if(rsa->n && RSA_size(rsa)!=(keylength/8)){
|
||||||
|
RSA_free(rsa);
|
||||||
|
}
|
||||||
|
if (rsa->n == 0) {
|
||||||
#ifdef NO_RSA_LEGACY
|
#ifdef NO_RSA_LEGACY
|
||||||
RSA *private = RSA_new();
|
RSA *rsa = RSA_new();
|
||||||
BIGNUM *f4 = BN_new();
|
BIGNUM *f4 = BN_new();
|
||||||
|
|
||||||
BN_set_word(f4, RSA_F4);
|
BN_set_word(f4, RSA_F4);
|
||||||
RSA_generate_key_ex(rsa, 1024, f4, NULL);
|
RSA_generate_key_ex(rsa, keylength, f4, NULL);
|
||||||
#else
|
#else
|
||||||
rsa = RSA_generate_key(1024, RSA_F4, NULL, NULL);
|
rsa = RSA_generate_key(keylength, RSA_F4, NULL, NULL);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
return rsa;
|
return rsa;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue