]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
add unconst
authorAlan T. DeKok <aland@freeradius.org>
Tue, 30 May 2023 19:52:38 +0000 (15:52 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 30 May 2023 19:52:38 +0000 (15:52 -0400)
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

index 4a542909357e0cf32ea25d880e9c9f2b4dd7bbf2..e54ad7d8427ab33e1309d1da71d5060586a65e92 100644 (file)
@@ -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++) {