From af7134fb7dcf98573b6aac836548c6153ac3772c Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Tue, 30 May 2023 15:52:38 -0400 Subject: [PATCH] add unconst as the OpenSSL APIs seem to randomly change what's supposed to be const or not. Or, the function definitions don't match the documentation --- src/modules/rlm_eap/libeap/mppe_keys.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/modules/rlm_eap/libeap/mppe_keys.c b/src/modules/rlm_eap/libeap/mppe_keys.c index 4a54290935..e54ad7d842 100644 --- a/src/modules/rlm_eap/libeap/mppe_keys.c +++ b/src/modules/rlm_eap/libeap/mppe_keys.c @@ -41,11 +41,14 @@ void TLS_PRF(SSL *ssl, unsigned char *key, size_t keylen) { const EVP_MD *md = SSL_CIPHER_get_handshake_digest(SSL_get_current_cipher(ssl)); - + EVP_MD *unconst_md; EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_TLS1_PRF, NULL); EVP_PKEY_derive_init(pctx); - EVP_PKEY_CTX_set_tls1_prf_md(pctx, md); + + memcpy(&unconst_md, &md, sizeof(md)); /* const issues */ + EVP_PKEY_CTX_set_tls1_prf_md(pctx, unconst_md); + EVP_PKEY_CTX_set1_tls1_prf_secret(pctx, sec, seclen); for (unsigned int i = 0; i < iovcnt; i++) { -- 2.47.3