WordPress.org

Make WordPress Core

Ticket #47186: 47186-bikeshed.patch

File 47186-bikeshed.patch, 1.8 KB (added by paragoninitiativeenterprises, 15 months ago)

Lowers parameters, uses mulInt64Fast via static property on ParagonIE_Sodium_Compat as per @dd32's suggestion

  • wp-admin/includes/file.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    11991199
    12001200        }
    12011201
     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
    12021232        if ( ! $signatures ) {
    12031233                return new WP_Error(
    12041234                        'signature_verification_no_signature',