Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.11.6, 4.0
Description
As part of processing mnet requests - Moodle verifies that the public key associated with the mnet host is a valid key.
It does this by checking that the type returned by `openssl_get_publickey` for the key is a "resource". However, as of php 8.0, that function now returns an object of type "OpenSSLAsymmetricKey" on success.
By checking for either, we can support both php7 and 8 (the function still returns `false` on failure).
Reference:
https://www.php.net/manual/en/function.openssl-pkey-get-public.php (openssl_get_publickey is an alias to this func).