fixed some compiler warnings

This commit is contained in:
van Hauser 2016-10-15 14:46:48 +02:00
parent a88f18ee16
commit 514e23611b
4 changed files with 96 additions and 10 deletions

View file

@ -456,10 +456,10 @@ int internal__hydra_connect(char *host, int port, int protocol, int type) {
return ret;
}
#ifdef LIBOPENSSL && !defined(LIBRESSL_VERSION_NUMBER)
#if defined(LIBOPENSSL) && !defined(LIBRESSL_VERSION_NUMBER)
RSA *ssl_temp_rsa_cb(SSL * ssl, int export, int keylength) {
int ok = 0;
#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
#if !defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L
BIGNUM *n;
n = BN_new();
RSA_get0_key(rsa, &n, NULL, NULL);
@ -469,7 +469,7 @@ RSA *ssl_temp_rsa_cb(SSL * ssl, int export, int keylength) {
ok = 1;
#endif
if(ok == 0 && RSA_size(rsa)!=(keylength/8)){ // n is not zero
#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
#if !defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L
BN_free(n);
#endif
RSA_free(rsa);
@ -485,8 +485,7 @@ RSA *ssl_temp_rsa_cb(SSL * ssl, int export, int keylength) {
rsa = RSA_generate_key(keylength, RSA_F4, NULL, NULL);
#endif
}
#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
#if !defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L
BN_free(n);
#endif
return rsa;