| | 1202 | $oldFastMult = ParagonIE_Sodium_Compat::$fastMult; |
| | 1203 | ParagonIE_Sodium_Compat::$fastMult = true; |
| | 1204 | if ( |
| | 1205 | ! extension_loaded( 'sodium' ) && |
| | 1206 | ! ParagonIE_Sodium_Compat::runtime_speed_test(25, 5) |
| | 1207 | ) { |
| | 1208 | $max = ini_get('max_execution_time'); |
| | 1209 | if ($max > 0 && $max < 60) { |
| | 1210 | ParagonIE_Sodium_Compat::$fastMult = $oldFastMult; |
| | 1211 | // This cannot be performed in a reasonable amount of time |
| | 1212 | // https://github.com/paragonie/sodium_compat#help-sodium_compat-is-slow-how-can-i-make-it-fast |
| | 1213 | |
| | 1214 | return new WP_Error( |
| | 1215 | 'signature_verification_unsupported', |
| | 1216 | sprintf( |
| | 1217 | /* translators: 1: The filename of the package. */ |
| | 1218 | __('The authenticity of %1$s could not be verified as signature verification is unavailable on this system.'), |
| | 1219 | '<span class="code">' . esc_html($filename_for_errors) . '</span>' |
| | 1220 | ), |
| | 1221 | array( |
| | 1222 | 'php' => phpversion(), |
| | 1223 | 'sodium' => defined('SODIUM_LIBRARY_VERSION') ? SODIUM_LIBRARY_VERSION : (defined('ParagonIE_Sodium_Compat::VERSION_STRING') ? ParagonIE_Sodium_Compat::VERSION_STRING : false), |
| | 1224 | 'polyfill-is-fast' => false, |
| | 1225 | 'max-execution-time' => $max |
| | 1226 | ) |
| | 1227 | ); |
| | 1228 | } |
| | 1229 | } |
| | 1230 | ParagonIE_Sodium_Compat::$fastMult = $oldFastMult; |
| | 1231 | |