-
Bug
-
Resolution: Fixed
-
Minor
-
3.11.4, 4.0
-
MOODLE_311_STABLE, MOODLE_400_STABLE
-
MOODLE_311_STABLE
-
From the php80 release notes:
. The openssl_x509_free() function is deprecated and no longer has an effect,
instead the OpenSSLCertificate instance is automatically destroyed if it is no
longer referenced.
. The openssl_pkey_free() (and its alias openssl_free_key)
function is deprecated and no longer has an effect,
instead the OpenSSLAsymmetricKey instance is automatically destroyed if it is no
longer referenced.
So this issue is about to verify that all the uses in code are conditional (for php < 8).
Cases:
$ ag '(openssl_x509_free|openssl_pkey_free|openssl_free_key)'
|
repository/s3/S3.php
|
354: openssl_free_key(self::$__signingKeyResource);
|
|
enrol/lti/ims-blti/OAuth.php
|
152: openssl_free_key($privatekeyid);
|
172: openssl_free_key($publickeyid);
|
|
mnet/lib.php
|
425: openssl_x509_free($selfSignedCert);
|
434: openssl_pkey_free($new_key);
|
|
lib/phpmailer/src/PHPMailer.php
|
4530: openssl_pkey_free($privKey);
|
4536: openssl_pkey_free($privKey);
|
|
lib/google/src/Google/Signer/P12.php
|
77: openssl_pkey_free($this->privateKey);
|
|
lib/google/src/Google/Verifier/Pem.php
|
53: openssl_x509_free($this->publicKey);
|
|
mod/lti/OAuth.php
|
266: openssl_free_key($privatekeyid);
|
286: openssl_free_key($publickeyid);
|
The changes will be performed similar to what PHPMailer is already doing, for example:
- // Release the key resource
|
- openssl_free_key($publickeyid);
|
+ // TODO: Remove this block once PHP 8.0 becomes required.
|
+ if (PHP_MAJOR_VERSION < 8) {
|
+ // Release the key resource
|
+ openssl_free_key($publickeyid);
|
+ }
|