--- res/res_rtp_asterisk.c (Asterisk 13.21) +++ res/res_rtp_asterisk.c (working copy) @@ -44,7 +44,12 @@ #ifdef HAVE_OPENSSL_SRTP +#include +#include #include #include #include +#ifndef OPENSSL_NO_DH +#include +#endif #endif @@ -1610,5 +1615,5 @@ struct ast_rtp *rtp = ast_rtp_instance_get_data(instance); int res; -#ifdef HAVE_OPENSSL_EC +#if !defined(OPENSSL_NO_ECDH) && (OPENSSL_VERSION_NUMBER >= 0x10000000L) && (OPENSSL_VERSION_NUMBER < 0x10100000L) EC_KEY *ecdh; #endif @@ -1638,6 +1643,5 @@ SSL_CTX_set_read_ahead(rtp->ssl_ctx, 1); -#ifdef HAVE_OPENSSL_EC - +#ifndef OPENSSL_NO_DH if (!ast_strlen_zero(dtls_cfg->pvtfile)) { BIO *bio = BIO_new_file(dtls_cfg->pvtfile, "r"); @@ -1656,4 +1660,6 @@ } } +#endif /* !OPENSSL_NO_DH */ +#if !defined(OPENSSL_NO_ECDH) && (OPENSSL_VERSION_NUMBER >= 0x10000000L) && (OPENSSL_VERSION_NUMBER < 0x10100000L) /* enables AES-128 ciphers, to get AES-256 use NID_secp384r1 */ ecdh = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); @@ -1672,6 +1678,5 @@ EC_KEY_free(ecdh); } - -#endif /* #ifdef HAVE_OPENSSL_EC */ +#endif /* !OPENSSL_NO_ECDH */ rtp->dtls_verify = dtls_cfg->verify;