openssl: Improve compatibility to newer BoringSSL releases

Closes strongswan/strongswan#352
This commit is contained in:
Tobias Brunner
2021-08-24 14:20:37 +02:00
parent 1d64b6c462
commit 57e68ab9c5
5 changed files with 14 additions and 8 deletions
@@ -168,7 +168,8 @@ static status_t set_modulus(private_openssl_diffie_hellman_t *this)
}
if (params->exp_len != params->prime.len)
{
#ifdef OPENSSL_IS_BORINGSSL
#if defined(OPENSSL_IS_BORINGSSL) && \
(!defined(BORINGSSL_API_VERSION) || BORINGSSL_API_VERSION < 11)
this->dh->priv_length = params->exp_len * 8;
#else
if (!DH_set_length(this->dh, params->exp_len * 8))