Page MenuHomePhabricator

Remove usage of deprecated openssl_free_key within ext:OAuth tests
Closed, ResolvedPublic

Description

Was done here for something else with @-suppression:

rARCf64eb04

But I think just removing the function calls should be fine, since the keys are allegedly automatically freed now:

https://www.php.net/manual/en/function.openssl-free-key.php

This probably shouldn't be picked to all supported release branches though.

Event Timeline

sbassett triaged this task as Medium priority.Oct 6 2022, 2:40 PM

Change 839606 had a related patch set uploaded (by SBassett; author: SBassett):

[mediawiki/extensions/OAuth@master] Remove usage of deprecated openssl_free_key with ext:OAuth tests

https://gerrit.wikimedia.org/r/839606

sbassett renamed this task from Remove usage of deprecated openssl_free_key with ext:OAuth tests to Remove usage of deprecated openssl_free_key within ext:OAuth tests.Oct 6 2022, 2:44 PM

Change 839606 merged by jenkins-bot:

[mediawiki/extensions/OAuth@master] Remove usage of deprecated openssl_free_key with ext:OAuth tests

https://gerrit.wikimedia.org/r/839606

Change 839568 had a related patch set uploaded (by SBassett; author: SBassett):

[mediawiki/extensions/OAuth@REL1_39] Remove usage of deprecated openssl_free_key with ext:OAuth tests

https://gerrit.wikimedia.org/r/839568

Change 839569 had a related patch set uploaded (by SBassett; author: SBassett):

[mediawiki/extensions/OAuth@REL1_38] Remove usage of deprecated openssl_free_key with ext:OAuth tests

https://gerrit.wikimedia.org/r/839569

We still support older versions of PHP in all branches, so shouldn't the call be wrapped in a PHP version check instead?

Granted, I'm never really sure whether the various free/close calls are useful. PHP automatically frees resources at the end of the request, so unless you do batch management where you touch a lot of keys (which I don't think we do), I'm not sure freeing the memory manually makes any practical difference.

We still support older versions of PHP in all branches, so shouldn't the call be wrapped in a PHP version check instead?

Granted, I'm never really sure whether the various free/close calls are useful. PHP automatically frees resources at the end of the request, so unless you do batch management where you touch a lot of keys (which I don't think we do), I'm not sure freeing the memory manually makes any practical difference.

I'm happy to abandon the ports to 1.38 and 1.39. I still think this should live on master though (already merged) as it can't be used in php 8.x and, as you said, likely doesn't really matter, so it's just cheap code clean-up.

Change 839568 merged by Gergő Tisza:

[mediawiki/extensions/OAuth@REL1_39] Remove usage of deprecated openssl_free_key with ext:OAuth tests

https://gerrit.wikimedia.org/r/839568

Change 839569 merged by SBassett:

[mediawiki/extensions/OAuth@REL1_38] Remove usage of deprecated openssl_free_key with ext:OAuth tests

https://gerrit.wikimedia.org/r/839569