Version Description
- May 16, 2019 =
- Improvement: Updated sodium_compat to address an incompatibility that may occur with the pending WordPress 5.2.1 update.
- Improvement: Clarified text around the reCAPTCHA setting to indicate v3 keys must be used.
- Improvement: Added detection for Jetpack and a notice when XML-RPC authentication is disabled.
- Fix: Suppressed error messages on the NTP time check to compensate for hosts with UDP connections disabled.
Download this release
Release Info
Developer | wfryan |
Plugin | Wordfence Security – Firewall & Malware Scan |
Version | 7.3.2 |
Comparing to | |
See all releases |
Code changes from version 7.3.1 to 7.3.2
- css/{activity-report-widget.1557854560.css → activity-report-widget.1558031354.css} +0 -0
- css/{diff.1557854560.css → diff.1558031354.css} +0 -0
- css/{dt_table.1557854560.css → dt_table.1558031354.css} +0 -0
- css/{fullLog.1557854560.css → fullLog.1558031354.css} +0 -0
- css/{iptraf.1557854560.css → iptraf.1558031354.css} +0 -0
- css/{jquery-ui-timepicker-addon.1557854560.css → jquery-ui-timepicker-addon.1558031354.css} +0 -0
- css/{jquery-ui.min.1557854560.css → jquery-ui.min.1558031354.css} +0 -0
- css/{jquery-ui.structure.min.1557854560.css → jquery-ui.structure.min.1558031354.css} +0 -0
- css/{jquery-ui.theme.min.1557854560.css → jquery-ui.theme.min.1558031354.css} +0 -0
- css/{main.1557854560.css → main.1558031354.css} +0 -0
- css/{phpinfo.1557854560.css → phpinfo.1558031354.css} +0 -0
- css/{wf-adminbar.1557854560.css → wf-adminbar.1558031354.css} +0 -0
- css/{wf-colorbox.1557854560.css → wf-colorbox.1558031354.css} +0 -0
- css/{wf-font-awesome.1557854560.css → wf-font-awesome.1558031354.css} +0 -0
- css/{wf-global.1557854560.css → wf-global.1558031354.css} +0 -0
- css/{wf-ionicons.1557854560.css → wf-ionicons.1558031354.css} +0 -0
- css/{wf-onboarding.1557854560.css → wf-onboarding.1558031354.css} +0 -0
- css/{wf-roboto-font.1557854560.css → wf-roboto-font.1558031354.css} +0 -0
- css/{wfselect2.min.1557854560.css → wfselect2.min.1558031354.css} +0 -0
- css/{wordfenceBox.1557854560.css → wordfenceBox.1558031354.css} +0 -0
- js/{Chart.bundle.min.1557854560.js → Chart.bundle.min.1558031354.js} +0 -0
- js/{admin.1557854560.js → admin.1558031354.js} +0 -0
- js/{admin.ajaxWatcher.1557854560.js → admin.ajaxWatcher.1558031354.js} +0 -0
- js/{admin.liveTraffic.1557854560.js → admin.liveTraffic.1558031354.js} +0 -0
- js/{date.1557854560.js → date.1558031354.js} +0 -0
- js/{jquery-ui-timepicker-addon.1557854560.js → jquery-ui-timepicker-addon.1558031354.js} +0 -0
- js/{jquery.colorbox-min.1557854560.js → jquery.colorbox-min.1558031354.js} +0 -0
- js/{jquery.colorbox.1557854560.js → jquery.colorbox.1558031354.js} +0 -0
- js/{jquery.dataTables.min.1557854560.js → jquery.dataTables.min.1558031354.js} +0 -0
- js/{jquery.qrcode.min.1557854560.js → jquery.qrcode.min.1558031354.js} +0 -0
- js/{jquery.tmpl.min.1557854560.js → jquery.tmpl.min.1558031354.js} +0 -0
- js/{jquery.tools.min.1557854560.js → jquery.tools.min.1558031354.js} +0 -0
- js/{knockout-3.3.0.1557854560.js → knockout-3.3.0.1558031354.js} +0 -0
- js/{wfdashboard.1557854560.js → wfdashboard.1558031354.js} +0 -0
- js/{wfdropdown.1557854560.js → wfdropdown.1558031354.js} +0 -0
- js/{wfglobal.1557854560.js → wfglobal.1558031354.js} +0 -0
- js/{wfpopover.1557854560.js → wfpopover.1558031354.js} +0 -0
- js/{wfselect2.min.1557854560.js → wfselect2.min.1558031354.js} +0 -0
- modules/login-security/classes/controller/time.php +2 -2
- modules/login-security/classes/controller/wordfencels.php +17 -0
- modules/login-security/css/{admin-global.1557854560.css → admin-global.1558031354.css} +0 -0
- modules/login-security/css/{admin.1557854560.css → admin.1558031354.css} +0 -0
- modules/login-security/css/{colorbox.1557854560.css → colorbox.1558031354.css} +0 -0
- modules/login-security/css/{font-awesome.1557854560.css → font-awesome.1558031354.css} +0 -0
- modules/login-security/css/{ionicons.1557854560.css → ionicons.1558031354.css} +0 -0
- modules/login-security/css/{jquery-ui-timepicker-addon.1557854560.css → jquery-ui-timepicker-addon.1558031354.css} +0 -0
- modules/login-security/css/{jquery-ui.min.1557854560.css → jquery-ui.min.1558031354.css} +0 -0
- modules/login-security/css/{jquery-ui.structure.min.1557854560.css → jquery-ui.structure.min.1558031354.css} +0 -0
- modules/login-security/css/{jquery-ui.theme.min.1557854560.css → jquery-ui.theme.min.1558031354.css} +0 -0
- modules/login-security/css/{login.1557854560.css → login.1558031354.css} +0 -0
- modules/login-security/js/{admin-global.1557854560.js → admin-global.1558031354.js} +0 -0
- modules/login-security/js/{admin.1557854560.js → admin.1558031354.js} +0 -0
- modules/login-security/js/{jquery-ui-timepicker-addon.1557854560.js → jquery-ui-timepicker-addon.1558031354.js} +0 -0
- modules/login-security/js/{jquery.colorbox.1557854560.js → jquery.colorbox.1558031354.js} +0 -0
- modules/login-security/js/{jquery.colorbox.min.1557854560.js → jquery.colorbox.min.1558031354.js} +0 -0
- modules/login-security/js/{jquery.qrcode.min.1557854560.js → jquery.qrcode.min.1558031354.js} +0 -0
- modules/login-security/js/{jquery.tmpl.min.1557854560.js → jquery.tmpl.min.1558031354.js} +0 -0
- modules/login-security/js/{login.1557854560.js → login.1558031354.js} +0 -0
- modules/login-security/views/options/option-captcha.php +3 -3
- modules/login-security/wordfence-ls.php +2 -2
- readme.txt +7 -1
- vendor/composer/installed.json +6 -6
- vendor/paragonie/sodium_compat/lib/php72compat.php +6 -6
- vendor/paragonie/sodium_compat/lib/sodium_compat.php +15 -26
- vendor/paragonie/sodium_compat/namespaced/Core/Salsa20.php +2 -2
- vendor/paragonie/sodium_compat/namespaced/Core/Xsalsa20.php +1 -1
- vendor/paragonie/sodium_compat/phpstan.neon.dist +18 -0
- vendor/paragonie/sodium_compat/src/Compat.php +50 -9
- vendor/paragonie/sodium_compat/src/Core/BLAKE2b.php +2 -1
- vendor/paragonie/sodium_compat/src/Core/ChaCha20/Ctx.php +3 -4
- vendor/paragonie/sodium_compat/src/Core/Curve25519/Fe.php +13 -11
- vendor/paragonie/sodium_compat/src/Core/Util.php +1 -1
- vendor/paragonie/sodium_compat/src/Core32/BLAKE2b.php +1 -1
- vendor/paragonie/sodium_compat/src/Core32/ChaCha20/Ctx.php +3 -3
- vendor/paragonie/sodium_compat/src/Core32/Int32.php +137 -1
- vendor/paragonie/sodium_compat/src/Core32/Int64.php +149 -6
- vendor/paragonie/sodium_compat/src/Core32/X25519.php +1 -11
- vendor/paragonie/sodium_compat/src/File.php +2 -8
- wordfence.php +3 -3
css/{activity-report-widget.1557854560.css → activity-report-widget.1558031354.css}
RENAMED
File without changes
|
css/{diff.1557854560.css → diff.1558031354.css}
RENAMED
File without changes
|
css/{dt_table.1557854560.css → dt_table.1558031354.css}
RENAMED
File without changes
|
css/{fullLog.1557854560.css → fullLog.1558031354.css}
RENAMED
File without changes
|
css/{iptraf.1557854560.css → iptraf.1558031354.css}
RENAMED
File without changes
|
css/{jquery-ui-timepicker-addon.1557854560.css → jquery-ui-timepicker-addon.1558031354.css}
RENAMED
File without changes
|
css/{jquery-ui.min.1557854560.css → jquery-ui.min.1558031354.css}
RENAMED
File without changes
|
css/{jquery-ui.structure.min.1557854560.css → jquery-ui.structure.min.1558031354.css}
RENAMED
File without changes
|
css/{jquery-ui.theme.min.1557854560.css → jquery-ui.theme.min.1558031354.css}
RENAMED
File without changes
|
css/{main.1557854560.css → main.1558031354.css}
RENAMED
File without changes
|
css/{phpinfo.1557854560.css → phpinfo.1558031354.css}
RENAMED
File without changes
|
css/{wf-adminbar.1557854560.css → wf-adminbar.1558031354.css}
RENAMED
File without changes
|
css/{wf-colorbox.1557854560.css → wf-colorbox.1558031354.css}
RENAMED
File without changes
|
css/{wf-font-awesome.1557854560.css → wf-font-awesome.1558031354.css}
RENAMED
File without changes
|
css/{wf-global.1557854560.css → wf-global.1558031354.css}
RENAMED
File without changes
|
css/{wf-ionicons.1557854560.css → wf-ionicons.1558031354.css}
RENAMED
File without changes
|
css/{wf-onboarding.1557854560.css → wf-onboarding.1558031354.css}
RENAMED
File without changes
|
css/{wf-roboto-font.1557854560.css → wf-roboto-font.1558031354.css}
RENAMED
File without changes
|
css/{wfselect2.min.1557854560.css → wfselect2.min.1558031354.css}
RENAMED
File without changes
|
css/{wordfenceBox.1557854560.css → wordfenceBox.1558031354.css}
RENAMED
File without changes
|
js/{Chart.bundle.min.1557854560.js → Chart.bundle.min.1558031354.js}
RENAMED
File without changes
|
js/{admin.1557854560.js → admin.1558031354.js}
RENAMED
File without changes
|
js/{admin.ajaxWatcher.1557854560.js → admin.ajaxWatcher.1558031354.js}
RENAMED
File without changes
|
js/{admin.liveTraffic.1557854560.js → admin.liveTraffic.1558031354.js}
RENAMED
File without changes
|
js/{date.1557854560.js → date.1558031354.js}
RENAMED
File without changes
|
js/{jquery-ui-timepicker-addon.1557854560.js → jquery-ui-timepicker-addon.1558031354.js}
RENAMED
File without changes
|
js/{jquery.colorbox-min.1557854560.js → jquery.colorbox-min.1558031354.js}
RENAMED
File without changes
|
js/{jquery.colorbox.1557854560.js → jquery.colorbox.1558031354.js}
RENAMED
File without changes
|
js/{jquery.dataTables.min.1557854560.js → jquery.dataTables.min.1558031354.js}
RENAMED
File without changes
|
js/{jquery.qrcode.min.1557854560.js → jquery.qrcode.min.1558031354.js}
RENAMED
File without changes
|
js/{jquery.tmpl.min.1557854560.js → jquery.tmpl.min.1558031354.js}
RENAMED
File without changes
|
js/{jquery.tools.min.1557854560.js → jquery.tools.min.1558031354.js}
RENAMED
File without changes
|
js/{knockout-3.3.0.1557854560.js → knockout-3.3.0.1558031354.js}
RENAMED
File without changes
|
js/{wfdashboard.1557854560.js → wfdashboard.1558031354.js}
RENAMED
File without changes
|
js/{wfdropdown.1557854560.js → wfdropdown.1558031354.js}
RENAMED
File without changes
|
js/{wfglobal.1557854560.js → wfglobal.1558031354.js}
RENAMED
File without changes
|
js/{wfpopover.1557854560.js → wfpopover.1558031354.js}
RENAMED
File without changes
|
js/{wfselect2.min.1557854560.js → wfselect2.min.1558031354.js}
RENAMED
File without changes
|
modules/login-security/classes/controller/time.php
CHANGED
@@ -88,11 +88,11 @@ class Controller_Time {
|
|
88 |
$fractional = sprintf('%010d', round(($remote_originate - ((int) $remote_originate)) * 0x100000000));
|
89 |
$packed = pack('N', $secondsNTP) . pack('N', $fractional);
|
90 |
|
91 |
-
if (fwrite($socket, $packet . $packed)) {
|
92 |
$response = fread($socket, 48);
|
93 |
$local_transmitted = microtime(true);
|
94 |
}
|
95 |
-
fclose($socket);
|
96 |
|
97 |
if (isset($response) && Model_Crypto::strlen($response) == 48) {
|
98 |
break;
|
88 |
$fractional = sprintf('%010d', round(($remote_originate - ((int) $remote_originate)) * 0x100000000));
|
89 |
$packed = pack('N', $secondsNTP) . pack('N', $fractional);
|
90 |
|
91 |
+
if (@fwrite($socket, $packet . $packed)) {
|
92 |
$response = fread($socket, 48);
|
93 |
$local_transmitted = microtime(true);
|
94 |
}
|
95 |
+
@fclose($socket);
|
96 |
|
97 |
if (isset($response) && Model_Crypto::strlen($response) == 48) {
|
98 |
break;
|
modules/login-security/classes/controller/wordfencels.php
CHANGED
@@ -114,6 +114,23 @@ class Controller_WordfenceLS {
|
|
114 |
END
|
115 |
);
|
116 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
}
|
118 |
|
119 |
/**
|
114 |
END
|
115 |
);
|
116 |
}
|
117 |
+
|
118 |
+
if ((is_plugin_active('jetpack/jetpack.php') || (is_multisite() && is_plugin_active_for_network('jetpack/jetpack.php'))) && !Controller_Settings::shared()->get_bool(Controller_Settings::OPTION_ALLOW_XML_RPC) && Controller_Permissions::shared()->can_manage_settings()) {
|
119 |
+
if (is_multisite()) {
|
120 |
+
add_action('network_admin_notices', array($this, '_jetpack_xml_rpc_notice'));
|
121 |
+
}
|
122 |
+
else {
|
123 |
+
add_action('admin_notices', array($this, '_jetpack_xml_rpc_notice'));
|
124 |
+
}
|
125 |
+
}
|
126 |
+
}
|
127 |
+
|
128 |
+
/**
|
129 |
+
* Notices
|
130 |
+
*/
|
131 |
+
|
132 |
+
public function _jetpack_xml_rpc_notice() {
|
133 |
+
echo '<div class="notice notice-warning"><p>' . sprintf(__('XML-RPC authentication is disabled. Jetpack is currently active and requires XML-RPC authentication to work correctly. <a href="%s">Manage Settings</a>', 'wordfence-2fa'), esc_url(network_admin_url('admin.php?page=WFLS#top#settings'))) . '</p></div>';
|
134 |
}
|
135 |
|
136 |
/**
|
modules/login-security/css/{admin-global.1557854560.css → admin-global.1558031354.css}
RENAMED
File without changes
|
modules/login-security/css/{admin.1557854560.css → admin.1558031354.css}
RENAMED
File without changes
|
modules/login-security/css/{colorbox.1557854560.css → colorbox.1558031354.css}
RENAMED
File without changes
|
modules/login-security/css/{font-awesome.1557854560.css → font-awesome.1558031354.css}
RENAMED
File without changes
|
modules/login-security/css/{ionicons.1557854560.css → ionicons.1558031354.css}
RENAMED
File without changes
|
modules/login-security/css/{jquery-ui-timepicker-addon.1557854560.css → jquery-ui-timepicker-addon.1558031354.css}
RENAMED
File without changes
|
modules/login-security/css/{jquery-ui.min.1557854560.css → jquery-ui.min.1558031354.css}
RENAMED
File without changes
|
modules/login-security/css/{jquery-ui.structure.min.1557854560.css → jquery-ui.structure.min.1558031354.css}
RENAMED
File without changes
|
modules/login-security/css/{jquery-ui.theme.min.1557854560.css → jquery-ui.theme.min.1558031354.css}
RENAMED
File without changes
|
modules/login-security/css/{login.1557854560.css → login.1558031354.css}
RENAMED
File without changes
|
modules/login-security/js/{admin-global.1557854560.js → admin-global.1558031354.js}
RENAMED
File without changes
|
modules/login-security/js/{admin.1557854560.js → admin.1558031354.js}
RENAMED
File without changes
|
modules/login-security/js/{jquery-ui-timepicker-addon.1557854560.js → jquery-ui-timepicker-addon.1558031354.js}
RENAMED
File without changes
|
modules/login-security/js/{jquery.colorbox.1557854560.js → jquery.colorbox.1558031354.js}
RENAMED
File without changes
|
modules/login-security/js/{jquery.colorbox.min.1557854560.js → jquery.colorbox.min.1558031354.js}
RENAMED
File without changes
|
modules/login-security/js/{jquery.qrcode.min.1557854560.js → jquery.qrcode.min.1558031354.js}
RENAMED
File without changes
|
modules/login-security/js/{jquery.tmpl.min.1557854560.js → jquery.tmpl.min.1558031354.js}
RENAMED
File without changes
|
modules/login-security/js/{login.1557854560.js → login.1558031354.js}
RENAMED
File without changes
|
modules/login-security/views/options/option-captcha.php
CHANGED
@@ -19,7 +19,7 @@ $secretValue = \WordfenceLS\Controller_Settings::shared()->get($secretOptionName
|
|
19 |
<li>
|
20 |
<strong id="wfls-enable-auth-captcha-label"><?php _e('Enable reCAPTCHA on the login and user registration pages', 'wordfence-2fa'); ?></strong>
|
21 |
</li>
|
22 |
-
<li class="wfls-option-subtitle"><?php _e('Note: This feature requires a free site key and secret for the <a href="https://www.google.com/recaptcha/intro/v3.html" target="_blank" rel="noopener noreferrer">reCAPTCHA Service</a>.', 'wordfence-2fa'); ?></li>
|
23 |
</ul>
|
24 |
</li>
|
25 |
</ul>
|
@@ -30,11 +30,11 @@ $secretValue = \WordfenceLS\Controller_Settings::shared()->get($secretOptionName
|
|
30 |
<li>
|
31 |
<table>
|
32 |
<tr class="wfls-option wfls-option-text" data-original-value="<?php echo esc_attr($siteKeyValue); ?>" data-text-option="<?php echo esc_attr($siteKeyOptionName); ?>">
|
33 |
-
<th id="wfls-enable-captcha-site-key-label" class="wfls-padding-add-bottom"><?php _e('Site Key', 'wordfence'); ?></th>
|
34 |
<td class="wfls-option-text wfls-padding-add-bottom"><input type="text" name="recaptchaSiteKey" id="input-recaptchaSiteKey" class="wfls-form-control" value="<?php echo esc_attr($siteKeyValue); ?>"<?php if (!$currentEnableValue) { echo ' disabled'; } ?>></td>
|
35 |
</tr>
|
36 |
<tr class="wfls-option wfls-option-text" data-original-value="<?php echo esc_attr($secretValue); ?>" data-text-option="<?php echo esc_attr($secretOptionName); ?>">
|
37 |
-
<th id="wfls-enable-captcha-secret-label"><?php _e('Secret', 'wordfence'); ?></th>
|
38 |
<td class="wfls-option-text"><input type="text" name="recaptchaSecret" id="input-recaptchaSecret" class="wfls-form-control" value="<?php echo esc_attr($secretValue); ?>"<?php if (!$currentEnableValue) { echo ' disabled'; } ?>></td>
|
39 |
</tr>
|
40 |
</table>
|
19 |
<li>
|
20 |
<strong id="wfls-enable-auth-captcha-label"><?php _e('Enable reCAPTCHA on the login and user registration pages', 'wordfence-2fa'); ?></strong>
|
21 |
</li>
|
22 |
+
<li class="wfls-option-subtitle"><?php _e('Note: This feature requires a free site key and secret for the <a href="https://www.google.com/recaptcha/intro/v3.html" target="_blank" rel="noopener noreferrer">Google reCAPTCHA v3 Service</a>.', 'wordfence-2fa'); ?></li>
|
23 |
</ul>
|
24 |
</li>
|
25 |
</ul>
|
30 |
<li>
|
31 |
<table>
|
32 |
<tr class="wfls-option wfls-option-text" data-original-value="<?php echo esc_attr($siteKeyValue); ?>" data-text-option="<?php echo esc_attr($siteKeyOptionName); ?>">
|
33 |
+
<th id="wfls-enable-captcha-site-key-label" class="wfls-padding-add-bottom"><?php _e('reCAPTCHA v3 Site Key', 'wordfence'); ?></th>
|
34 |
<td class="wfls-option-text wfls-padding-add-bottom"><input type="text" name="recaptchaSiteKey" id="input-recaptchaSiteKey" class="wfls-form-control" value="<?php echo esc_attr($siteKeyValue); ?>"<?php if (!$currentEnableValue) { echo ' disabled'; } ?>></td>
|
35 |
</tr>
|
36 |
<tr class="wfls-option wfls-option-text" data-original-value="<?php echo esc_attr($secretValue); ?>" data-text-option="<?php echo esc_attr($secretOptionName); ?>">
|
37 |
+
<th id="wfls-enable-captcha-secret-label"><?php _e('reCAPTCHA v3 Secret', 'wordfence'); ?></th>
|
38 |
<td class="wfls-option-text"><input type="text" name="recaptchaSecret" id="input-recaptchaSecret" class="wfls-form-control" value="<?php echo esc_attr($secretValue); ?>"<?php if (!$currentEnableValue) { echo ' disabled'; } ?>></td>
|
39 |
</tr>
|
40 |
</table>
|
modules/login-security/wordfence-ls.php
CHANGED
@@ -26,8 +26,8 @@ if ($wfCoreActive && !(isset($wfCoreLoading) && $wfCoreLoading)) {
|
|
26 |
else {
|
27 |
define('WORDFENCE_LS_FROM_CORE', ($wfCoreActive && isset($wfCoreLoading) && $wfCoreLoading));
|
28 |
|
29 |
-
define('WORDFENCE_LS_VERSION', '1.0.
|
30 |
-
define('WORDFENCE_LS_BUILD_NUMBER', '
|
31 |
|
32 |
if (!WORDFENCE_LS_FROM_CORE) {
|
33 |
global $wp_plugin_paths;
|
26 |
else {
|
27 |
define('WORDFENCE_LS_FROM_CORE', ($wfCoreActive && isset($wfCoreLoading) && $wfCoreLoading));
|
28 |
|
29 |
+
define('WORDFENCE_LS_VERSION', '1.0.1');
|
30 |
+
define('WORDFENCE_LS_BUILD_NUMBER', '1558031354');
|
31 |
|
32 |
if (!WORDFENCE_LS_FROM_CORE) {
|
33 |
global $wp_plugin_paths;
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: security, firewall, malware scanner, web application firewall, two factor
|
|
4 |
Requires at least: 3.9
|
5 |
Requires PHP: 5.3
|
6 |
Tested up to: 5.2
|
7 |
-
Stable tag: 7.3.
|
8 |
|
9 |
Secure your website with the most comprehensive WordPress security plugin. Firewall, malware scan, blocking, live traffic, login security & more.
|
10 |
|
@@ -183,6 +183,12 @@ Secure your website with Wordfence.
|
|
183 |
|
184 |
== Changelog ==
|
185 |
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
= 7.3.1 - May 14, 2019 =
|
187 |
* Improvement: Two-factor authentication is new and improved, now available on all Premium and Free installations.
|
188 |
* Improvement: Added Google reCAPTCHA v3 support to the login and registration forms.
|
4 |
Requires at least: 3.9
|
5 |
Requires PHP: 5.3
|
6 |
Tested up to: 5.2
|
7 |
+
Stable tag: 7.3.2
|
8 |
|
9 |
Secure your website with the most comprehensive WordPress security plugin. Firewall, malware scan, blocking, live traffic, login security & more.
|
10 |
|
183 |
|
184 |
== Changelog ==
|
185 |
|
186 |
+
= 7.3.2 - May 16, 2019 =
|
187 |
+
* Improvement: Updated sodium_compat to address an incompatibility that may occur with the pending WordPress 5.2.1 update.
|
188 |
+
* Improvement: Clarified text around the reCAPTCHA setting to indicate v3 keys must be used.
|
189 |
+
* Improvement: Added detection for Jetpack and a notice when XML-RPC authentication is disabled.
|
190 |
+
* Fix: Suppressed error messages on the NTP time check to compensate for hosts with UDP connections disabled.
|
191 |
+
|
192 |
= 7.3.1 - May 14, 2019 =
|
193 |
* Improvement: Two-factor authentication is new and improved, now available on all Premium and Free installations.
|
194 |
* Improvement: Added Google reCAPTCHA v3 support to the login and registration forms.
|
vendor/composer/installed.json
CHANGED
@@ -267,17 +267,17 @@
|
|
267 |
},
|
268 |
{
|
269 |
"name": "paragonie/sodium_compat",
|
270 |
-
"version": "v1.
|
271 |
-
"version_normalized": "1.
|
272 |
"source": {
|
273 |
"type": "git",
|
274 |
"url": "https://github.com/paragonie/sodium_compat.git",
|
275 |
-
"reference": "
|
276 |
},
|
277 |
"dist": {
|
278 |
"type": "zip",
|
279 |
-
"url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/
|
280 |
-
"reference": "
|
281 |
"shasum": ""
|
282 |
},
|
283 |
"require": {
|
@@ -291,7 +291,7 @@
|
|
291 |
"ext-libsodium": "PHP < 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security.",
|
292 |
"ext-sodium": "PHP >= 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security."
|
293 |
},
|
294 |
-
"time": "2019-
|
295 |
"type": "library",
|
296 |
"installation-source": "dist",
|
297 |
"autoload": {
|
267 |
},
|
268 |
{
|
269 |
"name": "paragonie/sodium_compat",
|
270 |
+
"version": "v1.10.0",
|
271 |
+
"version_normalized": "1.10.0.0",
|
272 |
"source": {
|
273 |
"type": "git",
|
274 |
"url": "https://github.com/paragonie/sodium_compat.git",
|
275 |
+
"reference": "228a9fc64cf4ba84c7967c1076d94209db03e0ee"
|
276 |
},
|
277 |
"dist": {
|
278 |
"type": "zip",
|
279 |
+
"url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/228a9fc64cf4ba84c7967c1076d94209db03e0ee",
|
280 |
+
"reference": "228a9fc64cf4ba84c7967c1076d94209db03e0ee",
|
281 |
"shasum": ""
|
282 |
},
|
283 |
"require": {
|
291 |
"ext-libsodium": "PHP < 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security.",
|
292 |
"ext-sodium": "PHP >= 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security."
|
293 |
},
|
294 |
+
"time": "2019-05-13T16:04:50+00:00",
|
295 |
"type": "library",
|
296 |
"installation-source": "dist",
|
297 |
"autoload": {
|
vendor/paragonie/sodium_compat/lib/php72compat.php
CHANGED
@@ -107,7 +107,7 @@ if (!is_callable('sodium_crypto_aead_aes256gcm_decrypt')) {
|
|
107 |
* @param string $assocData
|
108 |
* @param string $nonce
|
109 |
* @param string $key
|
110 |
-
* @return string
|
111 |
*/
|
112 |
function sodium_crypto_aead_aes256gcm_decrypt($message, $assocData, $nonce, $key)
|
113 |
{
|
@@ -153,7 +153,7 @@ if (!is_callable('sodium_crypto_aead_chacha20poly1305_decrypt')) {
|
|
153 |
* @param string $assocData
|
154 |
* @param string $nonce
|
155 |
* @param string $key
|
156 |
-
* @return string
|
157 |
*/
|
158 |
function sodium_crypto_aead_chacha20poly1305_decrypt($message, $assocData, $nonce, $key)
|
159 |
{
|
@@ -199,7 +199,7 @@ if (!is_callable('sodium_crypto_aead_chacha20poly1305_ietf_decrypt')) {
|
|
199 |
* @param string $assocData
|
200 |
* @param string $nonce
|
201 |
* @param string $key
|
202 |
-
* @return string
|
203 |
*/
|
204 |
function sodium_crypto_aead_chacha20poly1305_ietf_decrypt($message, $assocData, $nonce, $key)
|
205 |
{
|
@@ -245,7 +245,7 @@ if (!is_callable('sodium_crypto_aead_xchacha20poly1305_ietf_decrypt')) {
|
|
245 |
* @param string $assocData
|
246 |
* @param string $nonce
|
247 |
* @param string $key
|
248 |
-
* @return string
|
249 |
*/
|
250 |
function sodium_crypto_aead_xchacha20poly1305_ietf_decrypt($message, $assocData, $nonce, $key)
|
251 |
{
|
@@ -952,7 +952,7 @@ if (!is_callable('sodium_hex2bin')) {
|
|
952 |
if (!is_callable('sodium_increment')) {
|
953 |
/**
|
954 |
* @see ParagonIE_Sodium_Compat::increment()
|
955 |
-
* @param
|
956 |
* @return void
|
957 |
* @throws SodiumException
|
958 |
* @throws TypeError
|
@@ -1009,7 +1009,7 @@ if (!is_callable('sodium_memcmp')) {
|
|
1009 |
if (!is_callable('sodium_memzero')) {
|
1010 |
/**
|
1011 |
* @see ParagonIE_Sodium_Compat::memzero()
|
1012 |
-
* @param string
|
1013 |
* @return void
|
1014 |
* @throws SodiumException
|
1015 |
* @throws TypeError
|
107 |
* @param string $assocData
|
108 |
* @param string $nonce
|
109 |
* @param string $key
|
110 |
+
* @return string|bool
|
111 |
*/
|
112 |
function sodium_crypto_aead_aes256gcm_decrypt($message, $assocData, $nonce, $key)
|
113 |
{
|
153 |
* @param string $assocData
|
154 |
* @param string $nonce
|
155 |
* @param string $key
|
156 |
+
* @return string|bool
|
157 |
*/
|
158 |
function sodium_crypto_aead_chacha20poly1305_decrypt($message, $assocData, $nonce, $key)
|
159 |
{
|
199 |
* @param string $assocData
|
200 |
* @param string $nonce
|
201 |
* @param string $key
|
202 |
+
* @return string|bool
|
203 |
*/
|
204 |
function sodium_crypto_aead_chacha20poly1305_ietf_decrypt($message, $assocData, $nonce, $key)
|
205 |
{
|
245 |
* @param string $assocData
|
246 |
* @param string $nonce
|
247 |
* @param string $key
|
248 |
+
* @return string|bool
|
249 |
*/
|
250 |
function sodium_crypto_aead_xchacha20poly1305_ietf_decrypt($message, $assocData, $nonce, $key)
|
251 |
{
|
952 |
if (!is_callable('sodium_increment')) {
|
953 |
/**
|
954 |
* @see ParagonIE_Sodium_Compat::increment()
|
955 |
+
* @param string $string
|
956 |
* @return void
|
957 |
* @throws SodiumException
|
958 |
* @throws TypeError
|
1009 |
if (!is_callable('sodium_memzero')) {
|
1010 |
/**
|
1011 |
* @see ParagonIE_Sodium_Compat::memzero()
|
1012 |
+
* @param string $str
|
1013 |
* @return void
|
1014 |
* @throws SodiumException
|
1015 |
* @throws TypeError
|
vendor/paragonie/sodium_compat/lib/sodium_compat.php
CHANGED
@@ -45,16 +45,14 @@ if (!is_callable('\\Sodium\\crypto_aead_aes256gcm_decrypt')) {
|
|
45 |
* @param string $nonce
|
46 |
* @param string $key
|
47 |
* @return string|bool
|
48 |
-
* @throws \SodiumException
|
49 |
-
* @throws \TypeError
|
50 |
*/
|
51 |
function crypto_aead_aes256gcm_decrypt($message, $assocData, $nonce, $key)
|
52 |
{
|
53 |
try {
|
54 |
return ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_decrypt($message, $assocData, $nonce, $key);
|
55 |
-
} catch (
|
56 |
return false;
|
57 |
-
} catch (
|
58 |
return false;
|
59 |
}
|
60 |
}
|
@@ -93,16 +91,14 @@ if (!is_callable('\\Sodium\\crypto_aead_chacha20poly1305_decrypt')) {
|
|
93 |
* @param string $nonce
|
94 |
* @param string $key
|
95 |
* @return string|bool
|
96 |
-
* @throws \SodiumException
|
97 |
-
* @throws \TypeError
|
98 |
*/
|
99 |
function crypto_aead_chacha20poly1305_decrypt($message, $assocData, $nonce, $key)
|
100 |
{
|
101 |
try {
|
102 |
return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_decrypt($message, $assocData, $nonce, $key);
|
103 |
-
} catch (
|
104 |
return false;
|
105 |
-
} catch (
|
106 |
return false;
|
107 |
}
|
108 |
}
|
@@ -131,16 +127,14 @@ if (!is_callable('\\Sodium\\crypto_aead_chacha20poly1305_ietf_decrypt')) {
|
|
131 |
* @param string $nonce
|
132 |
* @param string $key
|
133 |
* @return string|bool
|
134 |
-
* @throws \SodiumException
|
135 |
-
* @throws \TypeError
|
136 |
*/
|
137 |
function crypto_aead_chacha20poly1305_ietf_decrypt($message, $assocData, $nonce, $key)
|
138 |
{
|
139 |
try {
|
140 |
return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_decrypt($message, $assocData, $nonce, $key);
|
141 |
-
} catch (
|
142 |
return false;
|
143 |
-
} catch (
|
144 |
return false;
|
145 |
}
|
146 |
}
|
@@ -238,16 +232,14 @@ if (!is_callable('\\Sodium\\crypto_box_open')) {
|
|
238 |
* @param string $nonce
|
239 |
* @param string $kp
|
240 |
* @return string|bool
|
241 |
-
* @throws \SodiumException
|
242 |
-
* @throws \TypeError
|
243 |
*/
|
244 |
function crypto_box_open($message, $nonce, $kp)
|
245 |
{
|
246 |
try {
|
247 |
return ParagonIE_Sodium_Compat::crypto_box_open($message, $nonce, $kp);
|
248 |
-
} catch (
|
249 |
return false;
|
250 |
-
} catch (
|
251 |
return false;
|
252 |
}
|
253 |
}
|
@@ -298,15 +290,14 @@ if (!is_callable('\\Sodium\\crypto_box_seal_open')) {
|
|
298 |
* @param string $message
|
299 |
* @param string $kp
|
300 |
* @return string|bool
|
301 |
-
* @throws \TypeError
|
302 |
*/
|
303 |
function crypto_box_seal_open($message, $kp)
|
304 |
{
|
305 |
try {
|
306 |
return ParagonIE_Sodium_Compat::crypto_box_seal_open($message, $kp);
|
307 |
-
} catch (\
|
308 |
return false;
|
309 |
-
} catch (\
|
310 |
return false;
|
311 |
}
|
312 |
}
|
@@ -543,16 +534,14 @@ if (!is_callable('\\Sodium\\crypto_secretbox_open')) {
|
|
543 |
* @param string $nonce
|
544 |
* @param string $key
|
545 |
* @return string|bool
|
546 |
-
* @throws \SodiumException
|
547 |
-
* @throws \TypeError
|
548 |
*/
|
549 |
function crypto_secretbox_open($message, $nonce, $key)
|
550 |
{
|
551 |
try {
|
552 |
return ParagonIE_Sodium_Compat::crypto_secretbox_open($message, $nonce, $key);
|
553 |
-
} catch (
|
554 |
return false;
|
555 |
-
} catch (
|
556 |
return false;
|
557 |
}
|
558 |
}
|
@@ -622,9 +611,9 @@ if (!is_callable('\\Sodium\\crypto_sign_open')) {
|
|
622 |
{
|
623 |
try {
|
624 |
return ParagonIE_Sodium_Compat::crypto_sign_open($signedMessage, $pk);
|
625 |
-
} catch (\
|
626 |
return false;
|
627 |
-
} catch (\
|
628 |
return false;
|
629 |
}
|
630 |
}
|
@@ -810,7 +799,7 @@ if (!is_callable('\\Sodium\\randombytes_uniform')) {
|
|
810 |
* @see ParagonIE_Sodium_Compat::randombytes_uniform()
|
811 |
* @param int $upperLimit
|
812 |
* @return int
|
813 |
-
* @throws \
|
814 |
* @throws \Error
|
815 |
*/
|
816 |
function randombytes_uniform($upperLimit)
|
45 |
* @param string $nonce
|
46 |
* @param string $key
|
47 |
* @return string|bool
|
|
|
|
|
48 |
*/
|
49 |
function crypto_aead_aes256gcm_decrypt($message, $assocData, $nonce, $key)
|
50 |
{
|
51 |
try {
|
52 |
return ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_decrypt($message, $assocData, $nonce, $key);
|
53 |
+
} catch (\TypeError $ex) {
|
54 |
return false;
|
55 |
+
} catch (\SodiumException $ex) {
|
56 |
return false;
|
57 |
}
|
58 |
}
|
91 |
* @param string $nonce
|
92 |
* @param string $key
|
93 |
* @return string|bool
|
|
|
|
|
94 |
*/
|
95 |
function crypto_aead_chacha20poly1305_decrypt($message, $assocData, $nonce, $key)
|
96 |
{
|
97 |
try {
|
98 |
return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_decrypt($message, $assocData, $nonce, $key);
|
99 |
+
} catch (\TypeError $ex) {
|
100 |
return false;
|
101 |
+
} catch (\SodiumException $ex) {
|
102 |
return false;
|
103 |
}
|
104 |
}
|
127 |
* @param string $nonce
|
128 |
* @param string $key
|
129 |
* @return string|bool
|
|
|
|
|
130 |
*/
|
131 |
function crypto_aead_chacha20poly1305_ietf_decrypt($message, $assocData, $nonce, $key)
|
132 |
{
|
133 |
try {
|
134 |
return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_decrypt($message, $assocData, $nonce, $key);
|
135 |
+
} catch (\TypeError $ex) {
|
136 |
return false;
|
137 |
+
} catch (\SodiumException $ex) {
|
138 |
return false;
|
139 |
}
|
140 |
}
|
232 |
* @param string $nonce
|
233 |
* @param string $kp
|
234 |
* @return string|bool
|
|
|
|
|
235 |
*/
|
236 |
function crypto_box_open($message, $nonce, $kp)
|
237 |
{
|
238 |
try {
|
239 |
return ParagonIE_Sodium_Compat::crypto_box_open($message, $nonce, $kp);
|
240 |
+
} catch (\TypeError $ex) {
|
241 |
return false;
|
242 |
+
} catch (\SodiumException $ex) {
|
243 |
return false;
|
244 |
}
|
245 |
}
|
290 |
* @param string $message
|
291 |
* @param string $kp
|
292 |
* @return string|bool
|
|
|
293 |
*/
|
294 |
function crypto_box_seal_open($message, $kp)
|
295 |
{
|
296 |
try {
|
297 |
return ParagonIE_Sodium_Compat::crypto_box_seal_open($message, $kp);
|
298 |
+
} catch (\TypeError $ex) {
|
299 |
return false;
|
300 |
+
} catch (\SodiumException $ex) {
|
301 |
return false;
|
302 |
}
|
303 |
}
|
534 |
* @param string $nonce
|
535 |
* @param string $key
|
536 |
* @return string|bool
|
|
|
|
|
537 |
*/
|
538 |
function crypto_secretbox_open($message, $nonce, $key)
|
539 |
{
|
540 |
try {
|
541 |
return ParagonIE_Sodium_Compat::crypto_secretbox_open($message, $nonce, $key);
|
542 |
+
} catch (\TypeError $ex) {
|
543 |
return false;
|
544 |
+
} catch (\SodiumException $ex) {
|
545 |
return false;
|
546 |
}
|
547 |
}
|
611 |
{
|
612 |
try {
|
613 |
return ParagonIE_Sodium_Compat::crypto_sign_open($signedMessage, $pk);
|
614 |
+
} catch (\TypeError $ex) {
|
615 |
return false;
|
616 |
+
} catch (\SodiumException $ex) {
|
617 |
return false;
|
618 |
}
|
619 |
}
|
799 |
* @see ParagonIE_Sodium_Compat::randombytes_uniform()
|
800 |
* @param int $upperLimit
|
801 |
* @return int
|
802 |
+
* @throws \SodiumException
|
803 |
* @throws \Error
|
804 |
*/
|
805 |
function randombytes_uniform($upperLimit)
|
vendor/paragonie/sodium_compat/namespaced/Core/Salsa20.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
namespace ParagonIE\Sodium\Core;
|
3 |
|
4 |
-
class
|
5 |
{
|
6 |
|
7 |
-
}
|
1 |
<?php
|
2 |
namespace ParagonIE\Sodium\Core;
|
3 |
|
4 |
+
class Salsa20 extends \ParagonIE_Sodium_Core_Salsa20
|
5 |
{
|
6 |
|
7 |
+
}
|
vendor/paragonie/sodium_compat/namespaced/Core/Xsalsa20.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
namespace ParagonIE\Sodium\Core;
|
3 |
|
4 |
-
class Xsalsa20 extends \
|
5 |
{
|
6 |
|
7 |
}
|
1 |
<?php
|
2 |
namespace ParagonIE\Sodium\Core;
|
3 |
|
4 |
+
class Xsalsa20 extends \ParagonIE_Sodium_Core_XSalsa20
|
5 |
{
|
6 |
|
7 |
}
|
vendor/paragonie/sodium_compat/phpstan.neon.dist
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
parameters:
|
2 |
+
level: max
|
3 |
+
paths:
|
4 |
+
- %currentWorkingDirectory%/src/
|
5 |
+
- %currentWorkingDirectory%/lib/
|
6 |
+
- %currentWorkingDirectory%/namespaced/
|
7 |
+
# excludes_analyse:
|
8 |
+
ignoreErrors:
|
9 |
+
# sodium_crypto_pwhash is a built-in function
|
10 |
+
- '/^Default value of the parameter #6 \$algo \(null\) of function sodium_crypto_pwhash\(\) is incompatible with type int\.$/'
|
11 |
+
# PHPStan issue #2124
|
12 |
+
- '#^Function sodium_crypto_scalarmult_base invoked with 1 parameter, 2 required\.$#'
|
13 |
+
# On PHP >=7.2 there is HashContext
|
14 |
+
- '/^Parameter #1 \$context of function hash_final expects HashContext, resource given\.$/'
|
15 |
+
# People call generichash() with all kinds of rubish
|
16 |
+
-
|
17 |
+
message: '#^Else branch is unreachable because previous condition is always true\.$#'
|
18 |
+
path: %currentWorkingDirectory%/src/File.php
|
vendor/paragonie/sodium_compat/src/Compat.php
CHANGED
@@ -144,9 +144,9 @@ class ParagonIE_Sodium_Compat
|
|
144 |
*
|
145 |
* @param string $left The left operand; must be a string
|
146 |
* @param string $right The right operand; must be a string
|
147 |
-
* @return int < 0 if the left operand is less than the right
|
148 |
-
* = 0 if both strings are equal
|
149 |
-
* > 0 if the right operand is less than the left
|
150 |
* @throws SodiumException
|
151 |
* @throws TypeError
|
152 |
* @psalm-suppress MixedArgument
|
@@ -675,7 +675,7 @@ class ParagonIE_Sodium_Compat
|
|
675 |
* @param string $key Encryption key
|
676 |
* @param bool $dontFallback Don't fallback to ext/sodium
|
677 |
*
|
678 |
-
* @return string
|
679 |
* @throws SodiumException
|
680 |
* @throws TypeError
|
681 |
* @psalm-suppress MixedArgument
|
@@ -1303,12 +1303,13 @@ class ParagonIE_Sodium_Compat
|
|
1303 |
/**
|
1304 |
* Get the final BLAKE2b hash output for a given context.
|
1305 |
*
|
1306 |
-
* @param string
|
1307 |
-
* @param int $length
|
1308 |
-
* @return string
|
1309 |
* @throws SodiumException
|
1310 |
* @throws TypeError
|
1311 |
* @psalm-suppress MixedArgument
|
|
|
1312 |
*/
|
1313 |
public static function crypto_generichash_final(&$ctx, $length = self::CRYPTO_GENERICHASH_BYTES)
|
1314 |
{
|
@@ -1381,13 +1382,15 @@ class ParagonIE_Sodium_Compat
|
|
1381 |
/**
|
1382 |
* Update a BLAKE2b hashing context with additional data.
|
1383 |
*
|
1384 |
-
* @param string
|
1385 |
-
*
|
|
|
1386 |
* @param string $message The message to append to the existing hash state.
|
1387 |
* @return void
|
1388 |
* @throws SodiumException
|
1389 |
* @throws TypeError
|
1390 |
* @psalm-suppress MixedArgument
|
|
|
1391 |
*/
|
1392 |
public static function crypto_generichash_update(&$ctx, $message)
|
1393 |
{
|
@@ -2634,6 +2637,7 @@ class ParagonIE_Sodium_Compat
|
|
2634 |
* native library for that.
|
2635 |
*
|
2636 |
* @param string|null $var
|
|
|
2637 |
*
|
2638 |
* @return void
|
2639 |
* @throws SodiumException (Unless libsodium is installed)
|
@@ -2646,6 +2650,7 @@ class ParagonIE_Sodium_Compat
|
|
2646 |
ParagonIE_Sodium_Core_Util::declareScalarType($var, 'string', 1);
|
2647 |
|
2648 |
if (self::useNewSodiumAPI()) {
|
|
|
2649 |
sodium_memzero($var);
|
2650 |
return;
|
2651 |
}
|
@@ -2749,6 +2754,42 @@ class ParagonIE_Sodium_Compat
|
|
2749 |
return random_int(0, 65535);
|
2750 |
}
|
2751 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2752 |
/**
|
2753 |
* This emulates libsodium's version_string() function, except ours is
|
2754 |
* prefixed with 'polyfill-'.
|
144 |
*
|
145 |
* @param string $left The left operand; must be a string
|
146 |
* @param string $right The right operand; must be a string
|
147 |
+
* @return int If < 0 if the left operand is less than the right
|
148 |
+
* If = 0 if both strings are equal
|
149 |
+
* If > 0 if the right operand is less than the left
|
150 |
* @throws SodiumException
|
151 |
* @throws TypeError
|
152 |
* @psalm-suppress MixedArgument
|
675 |
* @param string $key Encryption key
|
676 |
* @param bool $dontFallback Don't fallback to ext/sodium
|
677 |
*
|
678 |
+
* @return string|bool The original plaintext message
|
679 |
* @throws SodiumException
|
680 |
* @throws TypeError
|
681 |
* @psalm-suppress MixedArgument
|
1303 |
/**
|
1304 |
* Get the final BLAKE2b hash output for a given context.
|
1305 |
*
|
1306 |
+
* @param string $ctx BLAKE2 hashing context. Generated by crypto_generichash_init().
|
1307 |
+
* @param int $length Hash output size.
|
1308 |
+
* @return string Final BLAKE2b hash.
|
1309 |
* @throws SodiumException
|
1310 |
* @throws TypeError
|
1311 |
* @psalm-suppress MixedArgument
|
1312 |
+
* @psalm-suppress ReferenceConstraintViolation
|
1313 |
*/
|
1314 |
public static function crypto_generichash_final(&$ctx, $length = self::CRYPTO_GENERICHASH_BYTES)
|
1315 |
{
|
1382 |
/**
|
1383 |
* Update a BLAKE2b hashing context with additional data.
|
1384 |
*
|
1385 |
+
* @param string $ctx BLAKE2 hashing context. Generated by crypto_generichash_init().
|
1386 |
+
* $ctx is passed by reference and gets updated in-place.
|
1387 |
+
* @param-out string $ctx
|
1388 |
* @param string $message The message to append to the existing hash state.
|
1389 |
* @return void
|
1390 |
* @throws SodiumException
|
1391 |
* @throws TypeError
|
1392 |
* @psalm-suppress MixedArgument
|
1393 |
+
* @psalm-suppress ReferenceConstraintViolation
|
1394 |
*/
|
1395 |
public static function crypto_generichash_update(&$ctx, $message)
|
1396 |
{
|
2637 |
* native library for that.
|
2638 |
*
|
2639 |
* @param string|null $var
|
2640 |
+
* @param-out string|null $var
|
2641 |
*
|
2642 |
* @return void
|
2643 |
* @throws SodiumException (Unless libsodium is installed)
|
2650 |
ParagonIE_Sodium_Core_Util::declareScalarType($var, 'string', 1);
|
2651 |
|
2652 |
if (self::useNewSodiumAPI()) {
|
2653 |
+
/** @psalm-suppress MixedArgument */
|
2654 |
sodium_memzero($var);
|
2655 |
return;
|
2656 |
}
|
2754 |
return random_int(0, 65535);
|
2755 |
}
|
2756 |
|
2757 |
+
/**
|
2758 |
+
* Runtime testing method for 32-bit platforms.
|
2759 |
+
*
|
2760 |
+
* Usage: If runtime_speed_test() returns FALSE, then our 32-bit
|
2761 |
+
* implementation is to slow to use safely without risking timeouts.
|
2762 |
+
* If this happens, install sodium from PECL to get acceptable
|
2763 |
+
* performance.
|
2764 |
+
*
|
2765 |
+
* @param int $iterations Number of multiplications to attempt
|
2766 |
+
* @param int $maxTimeout Milliseconds
|
2767 |
+
* @return bool TRUE if we're fast enough, FALSE is not
|
2768 |
+
* @throws SodiumException
|
2769 |
+
*/
|
2770 |
+
public static function runtime_speed_test($iterations, $maxTimeout)
|
2771 |
+
{
|
2772 |
+
if (self::polyfill_is_fast()) {
|
2773 |
+
return true;
|
2774 |
+
}
|
2775 |
+
/** @var float $end */
|
2776 |
+
$end = 0.0;
|
2777 |
+
/** @var float $start */
|
2778 |
+
$start = microtime(true);
|
2779 |
+
/** @var ParagonIE_Sodium_Core32_Int64 $a */
|
2780 |
+
$a = ParagonIE_Sodium_Core32_Int64::fromInt(random_int(3, 1 << 16));
|
2781 |
+
for ($i = 0; $i < $iterations; ++$i) {
|
2782 |
+
/** @var ParagonIE_Sodium_Core32_Int64 $b */
|
2783 |
+
$b = ParagonIE_Sodium_Core32_Int64::fromInt(random_int(3, 1 << 16));
|
2784 |
+
$a->mulInt64($b);
|
2785 |
+
}
|
2786 |
+
/** @var float $end */
|
2787 |
+
$end = microtime(true);
|
2788 |
+
/** @var int $diff */
|
2789 |
+
$diff = (int) ceil(($end - $start) * 1000);
|
2790 |
+
return $diff < $maxTimeout;
|
2791 |
+
}
|
2792 |
+
|
2793 |
/**
|
2794 |
* This emulates libsodium's version_string() function, except ours is
|
2795 |
* prefixed with 'polyfill-'.
|
vendor/paragonie/sodium_compat/src/Core/BLAKE2b.php
CHANGED
@@ -256,6 +256,7 @@ abstract class ParagonIE_Sodium_Core_BLAKE2b extends ParagonIE_Sodium_Core_Util
|
|
256 |
if (++$i > $maxLength) {
|
257 |
return;
|
258 |
}
|
|
|
259 |
$u[$uIdx] >>= 8;
|
260 |
}
|
261 |
}
|
@@ -642,7 +643,7 @@ abstract class ParagonIE_Sodium_Core_BLAKE2b extends ParagonIE_Sodium_Core_Util
|
|
642 |
/**
|
643 |
* @internal You should not use this directly from another application
|
644 |
*
|
645 |
-
* @param SplFixedArray
|
646 |
* @return string
|
647 |
* @throws TypeError
|
648 |
* @psalm-suppress MixedArgument
|
256 |
if (++$i > $maxLength) {
|
257 |
return;
|
258 |
}
|
259 |
+
/** @psalm-suppress MixedOperand */
|
260 |
$u[$uIdx] >>= 8;
|
261 |
}
|
262 |
}
|
643 |
/**
|
644 |
* @internal You should not use this directly from another application
|
645 |
*
|
646 |
+
* @param SplFixedArray $ctx
|
647 |
* @return string
|
648 |
* @throws TypeError
|
649 |
* @psalm-suppress MixedArgument
|
vendor/paragonie/sodium_compat/src/Core/ChaCha20/Ctx.php
CHANGED
@@ -83,9 +83,8 @@ class ParagonIE_Sodium_Core_ChaCha20_Ctx extends ParagonIE_Sodium_Core_Util impl
|
|
83 |
/**
|
84 |
* @internal You should not use this directly from another application
|
85 |
*
|
86 |
-
* @param
|
87 |
* @return bool
|
88 |
-
* @psalm-suppress MixedArrayOffset
|
89 |
*/
|
90 |
public function offsetExists($offset)
|
91 |
{
|
@@ -95,7 +94,7 @@ class ParagonIE_Sodium_Core_ChaCha20_Ctx extends ParagonIE_Sodium_Core_Util impl
|
|
95 |
/**
|
96 |
* @internal You should not use this directly from another application
|
97 |
*
|
98 |
-
* @param
|
99 |
* @return void
|
100 |
* @psalm-suppress MixedArrayOffset
|
101 |
*/
|
@@ -107,7 +106,7 @@ class ParagonIE_Sodium_Core_ChaCha20_Ctx extends ParagonIE_Sodium_Core_Util impl
|
|
107 |
/**
|
108 |
* @internal You should not use this directly from another application
|
109 |
*
|
110 |
-
* @param
|
111 |
* @return mixed|null
|
112 |
* @psalm-suppress MixedArrayOffset
|
113 |
*/
|
83 |
/**
|
84 |
* @internal You should not use this directly from another application
|
85 |
*
|
86 |
+
* @param int $offset
|
87 |
* @return bool
|
|
|
88 |
*/
|
89 |
public function offsetExists($offset)
|
90 |
{
|
94 |
/**
|
95 |
* @internal You should not use this directly from another application
|
96 |
*
|
97 |
+
* @param int $offset
|
98 |
* @return void
|
99 |
* @psalm-suppress MixedArrayOffset
|
100 |
*/
|
106 |
/**
|
107 |
* @internal You should not use this directly from another application
|
108 |
*
|
109 |
+
* @param int $offset
|
110 |
* @return mixed|null
|
111 |
* @psalm-suppress MixedArrayOffset
|
112 |
*/
|
vendor/paragonie/sodium_compat/src/Core/Curve25519/Fe.php
CHANGED
@@ -12,7 +12,7 @@ if (class_exists('ParagonIE_Sodium_Core_Curve25519_Fe', false)) {
|
|
12 |
class ParagonIE_Sodium_Core_Curve25519_Fe implements ArrayAccess
|
13 |
{
|
14 |
/**
|
15 |
-
* @var array
|
16 |
*/
|
17 |
protected $container = array();
|
18 |
|
@@ -24,7 +24,7 @@ class ParagonIE_Sodium_Core_Curve25519_Fe implements ArrayAccess
|
|
24 |
/**
|
25 |
* @internal You should not use this directly from another application
|
26 |
*
|
27 |
-
* @param array $array
|
28 |
* @param bool $save_indexes
|
29 |
* @return self
|
30 |
*/
|
@@ -37,6 +37,7 @@ class ParagonIE_Sodium_Core_Curve25519_Fe implements ArrayAccess
|
|
37 |
$keys = range(0, $count - 1);
|
38 |
}
|
39 |
$array = array_values($array);
|
|
|
40 |
|
41 |
$obj = new ParagonIE_Sodium_Core_Curve25519_Fe();
|
42 |
if ($save_indexes) {
|
@@ -54,8 +55,8 @@ class ParagonIE_Sodium_Core_Curve25519_Fe implements ArrayAccess
|
|
54 |
/**
|
55 |
* @internal You should not use this directly from another application
|
56 |
*
|
57 |
-
* @param
|
58 |
-
* @param
|
59 |
* @return void
|
60 |
* @psalm-suppress MixedArrayOffset
|
61 |
*/
|
@@ -74,7 +75,7 @@ class ParagonIE_Sodium_Core_Curve25519_Fe implements ArrayAccess
|
|
74 |
/**
|
75 |
* @internal You should not use this directly from another application
|
76 |
*
|
77 |
-
* @param
|
78 |
* @return bool
|
79 |
* @psalm-suppress MixedArrayOffset
|
80 |
*/
|
@@ -86,7 +87,7 @@ class ParagonIE_Sodium_Core_Curve25519_Fe implements ArrayAccess
|
|
86 |
/**
|
87 |
* @internal You should not use this directly from another application
|
88 |
*
|
89 |
-
* @param
|
90 |
* @return void
|
91 |
* @psalm-suppress MixedArrayOffset
|
92 |
*/
|
@@ -98,15 +99,16 @@ class ParagonIE_Sodium_Core_Curve25519_Fe implements ArrayAccess
|
|
98 |
/**
|
99 |
* @internal You should not use this directly from another application
|
100 |
*
|
101 |
-
* @param
|
102 |
-
* @return
|
103 |
* @psalm-suppress MixedArrayOffset
|
104 |
*/
|
105 |
public function offsetGet($offset)
|
106 |
{
|
107 |
-
|
108 |
-
|
109 |
-
|
|
|
110 |
}
|
111 |
|
112 |
/**
|
12 |
class ParagonIE_Sodium_Core_Curve25519_Fe implements ArrayAccess
|
13 |
{
|
14 |
/**
|
15 |
+
* @var array<int, int>
|
16 |
*/
|
17 |
protected $container = array();
|
18 |
|
24 |
/**
|
25 |
* @internal You should not use this directly from another application
|
26 |
*
|
27 |
+
* @param array<int, int> $array
|
28 |
* @param bool $save_indexes
|
29 |
* @return self
|
30 |
*/
|
37 |
$keys = range(0, $count - 1);
|
38 |
}
|
39 |
$array = array_values($array);
|
40 |
+
/** @var array<int, int> $keys */
|
41 |
|
42 |
$obj = new ParagonIE_Sodium_Core_Curve25519_Fe();
|
43 |
if ($save_indexes) {
|
55 |
/**
|
56 |
* @internal You should not use this directly from another application
|
57 |
*
|
58 |
+
* @param int|null $offset
|
59 |
+
* @param int $value
|
60 |
* @return void
|
61 |
* @psalm-suppress MixedArrayOffset
|
62 |
*/
|
75 |
/**
|
76 |
* @internal You should not use this directly from another application
|
77 |
*
|
78 |
+
* @param int $offset
|
79 |
* @return bool
|
80 |
* @psalm-suppress MixedArrayOffset
|
81 |
*/
|
87 |
/**
|
88 |
* @internal You should not use this directly from another application
|
89 |
*
|
90 |
+
* @param int $offset
|
91 |
* @return void
|
92 |
* @psalm-suppress MixedArrayOffset
|
93 |
*/
|
99 |
/**
|
100 |
* @internal You should not use this directly from another application
|
101 |
*
|
102 |
+
* @param int $offset
|
103 |
+
* @return int
|
104 |
* @psalm-suppress MixedArrayOffset
|
105 |
*/
|
106 |
public function offsetGet($offset)
|
107 |
{
|
108 |
+
if (!isset($this->container[$offset])) {
|
109 |
+
$this->container[$offset] = 0;
|
110 |
+
}
|
111 |
+
return (int) ($this->container[$offset]);
|
112 |
}
|
113 |
|
114 |
/**
|
vendor/paragonie/sodium_compat/src/Core/Util.php
CHANGED
@@ -817,7 +817,7 @@ abstract class ParagonIE_Sodium_Core_Util
|
|
817 |
} else {
|
818 |
$sub = (string) substr($str, $start, $length);
|
819 |
}
|
820 |
-
if (
|
821 |
return $sub;
|
822 |
}
|
823 |
return '';
|
817 |
} else {
|
818 |
$sub = (string) substr($str, $start, $length);
|
819 |
}
|
820 |
+
if ($sub !== '') {
|
821 |
return $sub;
|
822 |
}
|
823 |
return '';
|
vendor/paragonie/sodium_compat/src/Core32/BLAKE2b.php
CHANGED
@@ -574,7 +574,7 @@ abstract class ParagonIE_Sodium_Core32_BLAKE2b extends ParagonIE_Sodium_Core_Uti
|
|
574 |
/**
|
575 |
* @internal You should not use this directly from another application
|
576 |
*
|
577 |
-
* @param SplFixedArray
|
578 |
* @return string
|
579 |
* @throws TypeError
|
580 |
* @psalm-suppress MixedArgument
|
574 |
/**
|
575 |
* @internal You should not use this directly from another application
|
576 |
*
|
577 |
+
* @param SplFixedArray $ctx
|
578 |
* @return string
|
579 |
* @throws TypeError
|
580 |
* @psalm-suppress MixedArgument
|
vendor/paragonie/sodium_compat/src/Core32/ChaCha20/Ctx.php
CHANGED
@@ -89,7 +89,7 @@ class ParagonIE_Sodium_Core32_ChaCha20_Ctx extends ParagonIE_Sodium_Core32_Util
|
|
89 |
/**
|
90 |
* @internal You should not use this directly from another application
|
91 |
*
|
92 |
-
* @param
|
93 |
* @return bool
|
94 |
* @psalm-suppress MixedArrayOffset
|
95 |
*/
|
@@ -101,7 +101,7 @@ class ParagonIE_Sodium_Core32_ChaCha20_Ctx extends ParagonIE_Sodium_Core32_Util
|
|
101 |
/**
|
102 |
* @internal You should not use this directly from another application
|
103 |
*
|
104 |
-
* @param
|
105 |
* @return void
|
106 |
* @psalm-suppress MixedArrayOffset
|
107 |
*/
|
@@ -113,7 +113,7 @@ class ParagonIE_Sodium_Core32_ChaCha20_Ctx extends ParagonIE_Sodium_Core32_Util
|
|
113 |
/**
|
114 |
* @internal You should not use this directly from another application
|
115 |
*
|
116 |
-
* @param
|
117 |
* @return mixed|null
|
118 |
* @psalm-suppress MixedArrayOffset
|
119 |
*/
|
89 |
/**
|
90 |
* @internal You should not use this directly from another application
|
91 |
*
|
92 |
+
* @param int $offset
|
93 |
* @return bool
|
94 |
* @psalm-suppress MixedArrayOffset
|
95 |
*/
|
101 |
/**
|
102 |
* @internal You should not use this directly from another application
|
103 |
*
|
104 |
+
* @param int $offset
|
105 |
* @return void
|
106 |
* @psalm-suppress MixedArrayOffset
|
107 |
*/
|
113 |
/**
|
114 |
* @internal You should not use this directly from another application
|
115 |
*
|
116 |
+
* @param int $offset
|
117 |
* @return mixed|null
|
118 |
* @psalm-suppress MixedArrayOffset
|
119 |
*/
|
vendor/paragonie/sodium_compat/src/Core32/Int32.php
CHANGED
@@ -150,6 +150,136 @@ class ParagonIE_Sodium_Core32_Int32
|
|
150 |
);
|
151 |
}
|
152 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
/**
|
154 |
* @param int $int
|
155 |
* @param int $size
|
@@ -161,6 +291,9 @@ class ParagonIE_Sodium_Core32_Int32
|
|
161 |
{
|
162 |
ParagonIE_Sodium_Core32_Util::declareScalarType($int, 'int', 1);
|
163 |
ParagonIE_Sodium_Core32_Util::declareScalarType($size, 'int', 2);
|
|
|
|
|
|
|
164 |
/** @var int $int */
|
165 |
$int = (int) $int;
|
166 |
/** @var int $size */
|
@@ -218,6 +351,9 @@ class ParagonIE_Sodium_Core32_Int32
|
|
218 |
public function mulInt32(ParagonIE_Sodium_Core32_Int32 $int, $size = 0)
|
219 |
{
|
220 |
ParagonIE_Sodium_Core32_Util::declareScalarType($size, 'int', 2);
|
|
|
|
|
|
|
221 |
if (!$size) {
|
222 |
$size = 31;
|
223 |
}
|
@@ -491,7 +627,7 @@ class ParagonIE_Sodium_Core32_Int32
|
|
491 |
/** @var int $c */
|
492 |
return $this->shiftLeft(-$c);
|
493 |
} else {
|
494 |
-
if (
|
495 |
throw new TypeError();
|
496 |
}
|
497 |
/** @var int $c */
|
150 |
);
|
151 |
}
|
152 |
|
153 |
+
/**
|
154 |
+
* @param array<int, int> $a
|
155 |
+
* @param array<int, int> $b
|
156 |
+
* @param int $baseLog2
|
157 |
+
* @return array<int, int>
|
158 |
+
*/
|
159 |
+
public function multiplyLong(array $a, array $b, $baseLog2 = 16)
|
160 |
+
{
|
161 |
+
$a_l = count($a);
|
162 |
+
$b_l = count($b);
|
163 |
+
/** @var array<int, int> $r */
|
164 |
+
$r = array_fill(0, $a_l + $b_l + 1, 0);
|
165 |
+
$base = 1 << $baseLog2;
|
166 |
+
for ($i = 0; $i < $a_l; ++$i) {
|
167 |
+
$a_i = $a[$i];
|
168 |
+
for ($j = 0; $j < $a_l; ++$j) {
|
169 |
+
$b_j = $b[$j];
|
170 |
+
$product = ($a_i * $b_j) + $r[$i + $j];
|
171 |
+
$carry = ($product >> $baseLog2 & 0xffff);
|
172 |
+
$r[$i + $j] = ($product - (int) ($carry * $base)) & 0xffff;
|
173 |
+
$r[$i + $j + 1] += $carry;
|
174 |
+
}
|
175 |
+
}
|
176 |
+
return array_slice($r, 0, 5);
|
177 |
+
}
|
178 |
+
|
179 |
+
/**
|
180 |
+
* @param int $int
|
181 |
+
* @return ParagonIE_Sodium_Core32_Int32
|
182 |
+
*/
|
183 |
+
public function mulIntFast($int)
|
184 |
+
{
|
185 |
+
// Handle negative numbers
|
186 |
+
$aNeg = ($this->limbs[0] >> 15) & 1;
|
187 |
+
$bNeg = ($int >> 31) & 1;
|
188 |
+
$a = array_reverse($this->limbs);
|
189 |
+
$b = array(
|
190 |
+
$int & 0xffff,
|
191 |
+
($int >> 16) & 0xffff
|
192 |
+
);
|
193 |
+
if ($aNeg) {
|
194 |
+
for ($i = 0; $i < 2; ++$i) {
|
195 |
+
$a[$i] = ($a[$i] ^ 0xffff) & 0xffff;
|
196 |
+
}
|
197 |
+
++$a[0];
|
198 |
+
}
|
199 |
+
if ($bNeg) {
|
200 |
+
for ($i = 0; $i < 2; ++$i) {
|
201 |
+
$b[$i] = ($b[$i] ^ 0xffff) & 0xffff;
|
202 |
+
}
|
203 |
+
++$b[0];
|
204 |
+
}
|
205 |
+
// Multiply
|
206 |
+
$res = $this->multiplyLong($a, $b);
|
207 |
+
|
208 |
+
// Re-apply negation to results
|
209 |
+
if ($aNeg !== $bNeg) {
|
210 |
+
for ($i = 0; $i < 2; ++$i) {
|
211 |
+
$res[$i] = (0xffff ^ $res[$i]) & 0xffff;
|
212 |
+
}
|
213 |
+
// Handle integer overflow
|
214 |
+
$c = 1;
|
215 |
+
for ($i = 0; $i < 2; ++$i) {
|
216 |
+
$res[$i] += $c;
|
217 |
+
$c = $res[$i] >> 16;
|
218 |
+
$res[$i] &= 0xffff;
|
219 |
+
}
|
220 |
+
}
|
221 |
+
|
222 |
+
// Return our values
|
223 |
+
$return = new ParagonIE_Sodium_Core32_Int32();
|
224 |
+
$return->limbs = array(
|
225 |
+
$res[1] & 0xffff,
|
226 |
+
$res[0] & 0xffff
|
227 |
+
);
|
228 |
+
if (count($res) > 2) {
|
229 |
+
$return->overflow = $res[2] & 0xffff;
|
230 |
+
}
|
231 |
+
$return->unsignedInt = $this->unsignedInt;
|
232 |
+
return $return;
|
233 |
+
}
|
234 |
+
|
235 |
+
/**
|
236 |
+
* @param ParagonIE_Sodium_Core32_Int32 $right
|
237 |
+
* @return ParagonIE_Sodium_Core32_Int32
|
238 |
+
*/
|
239 |
+
public function mulInt32Fast(ParagonIE_Sodium_Core32_Int32 $right)
|
240 |
+
{
|
241 |
+
$aNeg = ($this->limbs[0] >> 15) & 1;
|
242 |
+
$bNeg = ($right->limbs[0] >> 15) & 1;
|
243 |
+
|
244 |
+
$a = array_reverse($this->limbs);
|
245 |
+
$b = array_reverse($right->limbs);
|
246 |
+
if ($aNeg) {
|
247 |
+
for ($i = 0; $i < 2; ++$i) {
|
248 |
+
$a[$i] = ($a[$i] ^ 0xffff) & 0xffff;
|
249 |
+
}
|
250 |
+
++$a[0];
|
251 |
+
}
|
252 |
+
if ($bNeg) {
|
253 |
+
for ($i = 0; $i < 2; ++$i) {
|
254 |
+
$b[$i] = ($b[$i] ^ 0xffff) & 0xffff;
|
255 |
+
}
|
256 |
+
++$b[0];
|
257 |
+
}
|
258 |
+
$res = $this->multiplyLong($a, $b);
|
259 |
+
if ($aNeg !== $bNeg) {
|
260 |
+
if ($aNeg !== $bNeg) {
|
261 |
+
for ($i = 0; $i < 2; ++$i) {
|
262 |
+
$res[$i] = ($res[$i] ^ 0xffff) & 0xffff;
|
263 |
+
}
|
264 |
+
$c = 1;
|
265 |
+
for ($i = 0; $i < 2; ++$i) {
|
266 |
+
$res[$i] += $c;
|
267 |
+
$c = $res[$i] >> 16;
|
268 |
+
$res[$i] &= 0xffff;
|
269 |
+
}
|
270 |
+
}
|
271 |
+
}
|
272 |
+
$return = new ParagonIE_Sodium_Core32_Int32();
|
273 |
+
$return->limbs = array(
|
274 |
+
$res[1] & 0xffff,
|
275 |
+
$res[0] & 0xffff
|
276 |
+
);
|
277 |
+
if (count($res) > 2) {
|
278 |
+
$return->overflow = $res[2];
|
279 |
+
}
|
280 |
+
return $return;
|
281 |
+
}
|
282 |
+
|
283 |
/**
|
284 |
* @param int $int
|
285 |
* @param int $size
|
291 |
{
|
292 |
ParagonIE_Sodium_Core32_Util::declareScalarType($int, 'int', 1);
|
293 |
ParagonIE_Sodium_Core32_Util::declareScalarType($size, 'int', 2);
|
294 |
+
if (ParagonIE_Sodium_Compat::$fastMult) {
|
295 |
+
return $this->mulIntFast((int) $int);
|
296 |
+
}
|
297 |
/** @var int $int */
|
298 |
$int = (int) $int;
|
299 |
/** @var int $size */
|
351 |
public function mulInt32(ParagonIE_Sodium_Core32_Int32 $int, $size = 0)
|
352 |
{
|
353 |
ParagonIE_Sodium_Core32_Util::declareScalarType($size, 'int', 2);
|
354 |
+
if (ParagonIE_Sodium_Compat::$fastMult) {
|
355 |
+
return $this->mulInt32Fast($int);
|
356 |
+
}
|
357 |
if (!$size) {
|
358 |
$size = 31;
|
359 |
}
|
627 |
/** @var int $c */
|
628 |
return $this->shiftLeft(-$c);
|
629 |
} else {
|
630 |
+
if (!is_int($c)) {
|
631 |
throw new TypeError();
|
632 |
}
|
633 |
/** @var int $c */
|
vendor/paragonie/sodium_compat/src/Core32/Int64.php
CHANGED
@@ -205,6 +205,9 @@ class ParagonIE_Sodium_Core32_Int64
|
|
205 |
*/
|
206 |
public function mulInt($int = 0, $size = 0)
|
207 |
{
|
|
|
|
|
|
|
208 |
ParagonIE_Sodium_Core32_Util::declareScalarType($int, 'int', 1);
|
209 |
ParagonIE_Sodium_Core32_Util::declareScalarType($size, 'int', 2);
|
210 |
/** @var int $int */
|
@@ -268,11 +271,11 @@ class ParagonIE_Sodium_Core32_Int64
|
|
268 |
$a3 &= 0xffff;
|
269 |
|
270 |
$int >>= 1;
|
271 |
-
$return->limbs[0] = $ret0;
|
272 |
-
$return->limbs[1] = $ret1;
|
273 |
-
$return->limbs[2] = $ret2;
|
274 |
-
$return->limbs[3] = $ret3;
|
275 |
}
|
|
|
|
|
|
|
|
|
276 |
return $return;
|
277 |
}
|
278 |
|
@@ -317,6 +320,142 @@ class ParagonIE_Sodium_Core32_Int64
|
|
317 |
);
|
318 |
}
|
319 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
320 |
/**
|
321 |
* @param ParagonIE_Sodium_Core32_Int64 $int
|
322 |
* @param int $size
|
@@ -327,6 +466,9 @@ class ParagonIE_Sodium_Core32_Int64
|
|
327 |
*/
|
328 |
public function mulInt64(ParagonIE_Sodium_Core32_Int64 $int, $size = 0)
|
329 |
{
|
|
|
|
|
|
|
330 |
ParagonIE_Sodium_Core32_Util::declareScalarType($size, 'int', 2);
|
331 |
if (!$size) {
|
332 |
$size = 63;
|
@@ -566,7 +708,7 @@ class ParagonIE_Sodium_Core32_Int64
|
|
566 |
/** @var int $c */
|
567 |
return $this->shiftRight(-$c);
|
568 |
} else {
|
569 |
-
if (
|
570 |
throw new TypeError();
|
571 |
}
|
572 |
/** @var int $carry */
|
@@ -591,10 +733,11 @@ class ParagonIE_Sodium_Core32_Int64
|
|
591 |
public function shiftRight($c = 0)
|
592 |
{
|
593 |
ParagonIE_Sodium_Core32_Util::declareScalarType($c, 'int', 1);
|
|
|
|
|
594 |
$return = new ParagonIE_Sodium_Core32_Int64();
|
595 |
$return->unsignedInt = $this->unsignedInt;
|
596 |
$c &= 63;
|
597 |
-
/** @var int $c */
|
598 |
|
599 |
$negative = -(($this->limbs[0] >> 15) & 1);
|
600 |
if ($c >= 16) {
|
205 |
*/
|
206 |
public function mulInt($int = 0, $size = 0)
|
207 |
{
|
208 |
+
if (ParagonIE_Sodium_Compat::$fastMult) {
|
209 |
+
return $this->mulIntFast($int);
|
210 |
+
}
|
211 |
ParagonIE_Sodium_Core32_Util::declareScalarType($int, 'int', 1);
|
212 |
ParagonIE_Sodium_Core32_Util::declareScalarType($size, 'int', 2);
|
213 |
/** @var int $int */
|
271 |
$a3 &= 0xffff;
|
272 |
|
273 |
$int >>= 1;
|
|
|
|
|
|
|
|
|
274 |
}
|
275 |
+
$return->limbs[0] = $ret0;
|
276 |
+
$return->limbs[1] = $ret1;
|
277 |
+
$return->limbs[2] = $ret2;
|
278 |
+
$return->limbs[3] = $ret3;
|
279 |
return $return;
|
280 |
}
|
281 |
|
320 |
);
|
321 |
}
|
322 |
|
323 |
+
/**
|
324 |
+
* @param array<int, int> $a
|
325 |
+
* @param array<int, int> $b
|
326 |
+
* @param int $baseLog2
|
327 |
+
* @return array<int, int>
|
328 |
+
*/
|
329 |
+
public function multiplyLong(array $a, array $b, $baseLog2 = 16)
|
330 |
+
{
|
331 |
+
$a_l = count($a);
|
332 |
+
$b_l = count($b);
|
333 |
+
/** @var array<int, int> $r */
|
334 |
+
$r = array_fill(0, $a_l + $b_l + 1, 0);
|
335 |
+
$base = 1 << $baseLog2;
|
336 |
+
for ($i = 0; $i < $a_l; ++$i) {
|
337 |
+
$a_i = $a[$i];
|
338 |
+
for ($j = 0; $j < $a_l; ++$j) {
|
339 |
+
$b_j = $b[$j];
|
340 |
+
$product = ($a_i * $b_j) + $r[$i + $j];
|
341 |
+
$carry = ($product >> $baseLog2 & 0xffff);
|
342 |
+
$r[$i + $j] = ($product - (int) ($carry * $base)) & 0xffff;
|
343 |
+
$r[$i + $j + 1] += $carry;
|
344 |
+
}
|
345 |
+
}
|
346 |
+
return array_slice($r, 0, 5);
|
347 |
+
}
|
348 |
+
|
349 |
+
/**
|
350 |
+
* @param int $int
|
351 |
+
* @return ParagonIE_Sodium_Core32_Int64
|
352 |
+
*/
|
353 |
+
public function mulIntFast($int)
|
354 |
+
{
|
355 |
+
// Handle negative numbers
|
356 |
+
$aNeg = ($this->limbs[0] >> 15) & 1;
|
357 |
+
$bNeg = ($int >> 31) & 1;
|
358 |
+
$a = array_reverse($this->limbs);
|
359 |
+
$b = array(
|
360 |
+
$int & 0xffff,
|
361 |
+
($int >> 16) & 0xffff,
|
362 |
+
-$bNeg & 0xffff,
|
363 |
+
-$bNeg & 0xffff
|
364 |
+
);
|
365 |
+
if ($aNeg) {
|
366 |
+
for ($i = 0; $i < 4; ++$i) {
|
367 |
+
$a[$i] = ($a[$i] ^ 0xffff) & 0xffff;
|
368 |
+
}
|
369 |
+
++$a[0];
|
370 |
+
}
|
371 |
+
if ($bNeg) {
|
372 |
+
for ($i = 0; $i < 4; ++$i) {
|
373 |
+
$b[$i] = ($b[$i] ^ 0xffff) & 0xffff;
|
374 |
+
}
|
375 |
+
++$b[0];
|
376 |
+
}
|
377 |
+
// Multiply
|
378 |
+
$res = $this->multiplyLong($a, $b);
|
379 |
+
|
380 |
+
// Re-apply negation to results
|
381 |
+
if ($aNeg !== $bNeg) {
|
382 |
+
for ($i = 0; $i < 4; ++$i) {
|
383 |
+
$res[$i] = (0xffff ^ $res[$i]) & 0xffff;
|
384 |
+
}
|
385 |
+
// Handle integer overflow
|
386 |
+
$c = 1;
|
387 |
+
for ($i = 0; $i < 4; ++$i) {
|
388 |
+
$res[$i] += $c;
|
389 |
+
$c = $res[$i] >> 16;
|
390 |
+
$res[$i] &= 0xffff;
|
391 |
+
}
|
392 |
+
}
|
393 |
+
|
394 |
+
// Return our values
|
395 |
+
$return = new ParagonIE_Sodium_Core32_Int64();
|
396 |
+
$return->limbs = array(
|
397 |
+
$res[3] & 0xffff,
|
398 |
+
$res[2] & 0xffff,
|
399 |
+
$res[1] & 0xffff,
|
400 |
+
$res[0] & 0xffff
|
401 |
+
);
|
402 |
+
if (count($res) > 4) {
|
403 |
+
$return->overflow = $res[4] & 0xffff;
|
404 |
+
}
|
405 |
+
$return->unsignedInt = $this->unsignedInt;
|
406 |
+
return $return;
|
407 |
+
}
|
408 |
+
|
409 |
+
/**
|
410 |
+
* @param ParagonIE_Sodium_Core32_Int64 $right
|
411 |
+
* @return ParagonIE_Sodium_Core32_Int64
|
412 |
+
*/
|
413 |
+
public function mulInt64Fast(ParagonIE_Sodium_Core32_Int64 $right)
|
414 |
+
{
|
415 |
+
$aNeg = ($this->limbs[0] >> 15) & 1;
|
416 |
+
$bNeg = ($right->limbs[0] >> 15) & 1;
|
417 |
+
|
418 |
+
$a = array_reverse($this->limbs);
|
419 |
+
$b = array_reverse($right->limbs);
|
420 |
+
if ($aNeg) {
|
421 |
+
for ($i = 0; $i < 4; ++$i) {
|
422 |
+
$a[$i] = ($a[$i] ^ 0xffff) & 0xffff;
|
423 |
+
}
|
424 |
+
++$a[0];
|
425 |
+
}
|
426 |
+
if ($bNeg) {
|
427 |
+
for ($i = 0; $i < 4; ++$i) {
|
428 |
+
$b[$i] = ($b[$i] ^ 0xffff) & 0xffff;
|
429 |
+
}
|
430 |
+
++$b[0];
|
431 |
+
}
|
432 |
+
$res = $this->multiplyLong($a, $b);
|
433 |
+
if ($aNeg !== $bNeg) {
|
434 |
+
if ($aNeg !== $bNeg) {
|
435 |
+
for ($i = 0; $i < 4; ++$i) {
|
436 |
+
$res[$i] = ($res[$i] ^ 0xffff) & 0xffff;
|
437 |
+
}
|
438 |
+
$c = 1;
|
439 |
+
for ($i = 0; $i < 4; ++$i) {
|
440 |
+
$res[$i] += $c;
|
441 |
+
$c = $res[$i] >> 16;
|
442 |
+
$res[$i] &= 0xffff;
|
443 |
+
}
|
444 |
+
}
|
445 |
+
}
|
446 |
+
$return = new ParagonIE_Sodium_Core32_Int64();
|
447 |
+
$return->limbs = array(
|
448 |
+
$res[3] & 0xffff,
|
449 |
+
$res[2] & 0xffff,
|
450 |
+
$res[1] & 0xffff,
|
451 |
+
$res[0] & 0xffff
|
452 |
+
);
|
453 |
+
if (count($res) > 4) {
|
454 |
+
$return->overflow = $res[4];
|
455 |
+
}
|
456 |
+
return $return;
|
457 |
+
}
|
458 |
+
|
459 |
/**
|
460 |
* @param ParagonIE_Sodium_Core32_Int64 $int
|
461 |
* @param int $size
|
466 |
*/
|
467 |
public function mulInt64(ParagonIE_Sodium_Core32_Int64 $int, $size = 0)
|
468 |
{
|
469 |
+
if (ParagonIE_Sodium_Compat::$fastMult) {
|
470 |
+
return $this->mulInt64Fast($int);
|
471 |
+
}
|
472 |
ParagonIE_Sodium_Core32_Util::declareScalarType($size, 'int', 2);
|
473 |
if (!$size) {
|
474 |
$size = 63;
|
708 |
/** @var int $c */
|
709 |
return $this->shiftRight(-$c);
|
710 |
} else {
|
711 |
+
if (!is_int($c)) {
|
712 |
throw new TypeError();
|
713 |
}
|
714 |
/** @var int $carry */
|
733 |
public function shiftRight($c = 0)
|
734 |
{
|
735 |
ParagonIE_Sodium_Core32_Util::declareScalarType($c, 'int', 1);
|
736 |
+
$c = (int) $c;
|
737 |
+
/** @var int $c */
|
738 |
$return = new ParagonIE_Sodium_Core32_Int64();
|
739 |
$return->unsignedInt = $this->unsignedInt;
|
740 |
$c &= 63;
|
|
|
741 |
|
742 |
$negative = -(($this->limbs[0] >> 15) & 1);
|
743 |
if ($c >= 16) {
|
vendor/paragonie/sodium_compat/src/Core32/X25519.php
CHANGED
@@ -102,58 +102,48 @@ abstract class ParagonIE_Sodium_Core32_X25519 extends ParagonIE_Sodium_Core32_Cu
|
|
102 |
*/
|
103 |
public static function fe_mul121666(ParagonIE_Sodium_Core32_Curve25519_Fe $f)
|
104 |
{
|
105 |
-
/** @var array<int,
|
106 |
$h = array();
|
107 |
for ($i = 0; $i < 10; ++$i) {
|
108 |
$h[$i] = $f[$i]->toInt64()->mulInt(121666, 17);
|
109 |
}
|
110 |
|
111 |
-
/** @var ParagonIE_Sodium_Core32_Int32 $carry9 */
|
112 |
$carry9 = $h[9]->addInt(1 << 24)->shiftRight(25);
|
113 |
$h[0] = $h[0]->addInt64($carry9->mulInt(19, 5));
|
114 |
$h[9] = $h[9]->subInt64($carry9->shiftLeft(25));
|
115 |
|
116 |
-
/** @var ParagonIE_Sodium_Core32_Int32 $carry1 */
|
117 |
$carry1 = $h[1]->addInt(1 << 24)->shiftRight(25);
|
118 |
$h[2] = $h[2]->addInt64($carry1);
|
119 |
$h[1] = $h[1]->subInt64($carry1->shiftLeft(25));
|
120 |
|
121 |
-
/** @var ParagonIE_Sodium_Core32_Int32 $carry3 */
|
122 |
$carry3 = $h[3]->addInt(1 << 24)->shiftRight(25);
|
123 |
$h[4] = $h[4]->addInt64($carry3);
|
124 |
$h[3] = $h[3]->subInt64($carry3->shiftLeft(25));
|
125 |
|
126 |
-
/** @var ParagonIE_Sodium_Core32_Int32 $carry5 */
|
127 |
$carry5 = $h[5]->addInt(1 << 24)->shiftRight(25);
|
128 |
$h[6] = $h[6]->addInt64($carry5);
|
129 |
$h[5] = $h[5]->subInt64($carry5->shiftLeft(25));
|
130 |
|
131 |
-
/** @var ParagonIE_Sodium_Core32_Int32 $carry7 */
|
132 |
$carry7 = $h[7]->addInt(1 << 24)->shiftRight(25);
|
133 |
$h[8] = $h[8]->addInt64($carry7);
|
134 |
$h[7] = $h[7]->subInt64($carry7->shiftLeft(25));
|
135 |
|
136 |
-
/** @var ParagonIE_Sodium_Core32_Int32 $carry0 */
|
137 |
$carry0 = $h[0]->addInt(1 << 25)->shiftRight(26);
|
138 |
$h[1] = $h[1]->addInt64($carry0);
|
139 |
$h[0] = $h[0]->subInt64($carry0->shiftLeft(26));
|
140 |
|
141 |
-
/** @var ParagonIE_Sodium_Core32_Int32 $carry2 */
|
142 |
$carry2 = $h[2]->addInt(1 << 25)->shiftRight(26);
|
143 |
$h[3] = $h[3]->addInt64($carry2);
|
144 |
$h[2] = $h[2]->subInt64($carry2->shiftLeft(26));
|
145 |
|
146 |
-
/** @var ParagonIE_Sodium_Core32_Int32 $carry4 */
|
147 |
$carry4 = $h[4]->addInt(1 << 25)->shiftRight(26);
|
148 |
$h[5] = $h[5]->addInt64($carry4);
|
149 |
$h[4] = $h[4]->subInt64($carry4->shiftLeft(26));
|
150 |
|
151 |
-
/** @var ParagonIE_Sodium_Core32_Int32 $carry6 */
|
152 |
$carry6 = $h[6]->addInt(1 << 25)->shiftRight(26);
|
153 |
$h[7] = $h[7]->addInt64($carry6);
|
154 |
$h[6] = $h[6]->subInt64($carry6->shiftLeft(26));
|
155 |
|
156 |
-
/** @var ParagonIE_Sodium_Core32_Int32 $carry8 */
|
157 |
$carry8 = $h[8]->addInt(1 << 25)->shiftRight(26);
|
158 |
$h[9] = $h[9]->addInt64($carry8);
|
159 |
$h[8] = $h[8]->subInt64($carry8->shiftLeft(26));
|
102 |
*/
|
103 |
public static function fe_mul121666(ParagonIE_Sodium_Core32_Curve25519_Fe $f)
|
104 |
{
|
105 |
+
/** @var array<int, ParagonIE_Sodium_Core32_Int64> $h */
|
106 |
$h = array();
|
107 |
for ($i = 0; $i < 10; ++$i) {
|
108 |
$h[$i] = $f[$i]->toInt64()->mulInt(121666, 17);
|
109 |
}
|
110 |
|
|
|
111 |
$carry9 = $h[9]->addInt(1 << 24)->shiftRight(25);
|
112 |
$h[0] = $h[0]->addInt64($carry9->mulInt(19, 5));
|
113 |
$h[9] = $h[9]->subInt64($carry9->shiftLeft(25));
|
114 |
|
|
|
115 |
$carry1 = $h[1]->addInt(1 << 24)->shiftRight(25);
|
116 |
$h[2] = $h[2]->addInt64($carry1);
|
117 |
$h[1] = $h[1]->subInt64($carry1->shiftLeft(25));
|
118 |
|
|
|
119 |
$carry3 = $h[3]->addInt(1 << 24)->shiftRight(25);
|
120 |
$h[4] = $h[4]->addInt64($carry3);
|
121 |
$h[3] = $h[3]->subInt64($carry3->shiftLeft(25));
|
122 |
|
|
|
123 |
$carry5 = $h[5]->addInt(1 << 24)->shiftRight(25);
|
124 |
$h[6] = $h[6]->addInt64($carry5);
|
125 |
$h[5] = $h[5]->subInt64($carry5->shiftLeft(25));
|
126 |
|
|
|
127 |
$carry7 = $h[7]->addInt(1 << 24)->shiftRight(25);
|
128 |
$h[8] = $h[8]->addInt64($carry7);
|
129 |
$h[7] = $h[7]->subInt64($carry7->shiftLeft(25));
|
130 |
|
|
|
131 |
$carry0 = $h[0]->addInt(1 << 25)->shiftRight(26);
|
132 |
$h[1] = $h[1]->addInt64($carry0);
|
133 |
$h[0] = $h[0]->subInt64($carry0->shiftLeft(26));
|
134 |
|
|
|
135 |
$carry2 = $h[2]->addInt(1 << 25)->shiftRight(26);
|
136 |
$h[3] = $h[3]->addInt64($carry2);
|
137 |
$h[2] = $h[2]->subInt64($carry2->shiftLeft(26));
|
138 |
|
|
|
139 |
$carry4 = $h[4]->addInt(1 << 25)->shiftRight(26);
|
140 |
$h[5] = $h[5]->addInt64($carry4);
|
141 |
$h[4] = $h[4]->subInt64($carry4->shiftLeft(26));
|
142 |
|
|
|
143 |
$carry6 = $h[6]->addInt(1 << 25)->shiftRight(26);
|
144 |
$h[7] = $h[7]->addInt64($carry6);
|
145 |
$h[6] = $h[6]->subInt64($carry6->shiftLeft(26));
|
146 |
|
|
|
147 |
$carry8 = $h[8]->addInt(1 << 25)->shiftRight(26);
|
148 |
$h[9] = $h[9]->addInt64($carry8);
|
149 |
$h[8] = $h[8]->subInt64($carry8->shiftLeft(26));
|
vendor/paragonie/sodium_compat/src/File.php
CHANGED
@@ -590,7 +590,6 @@ class ParagonIE_Sodium_File extends ParagonIE_Sodium_Core_Util
|
|
590 |
$az[0] = self::intToChr(self::chrToInt($az[0]) & 248);
|
591 |
$az[31] = self::intToChr((self::chrToInt($az[31]) & 63) | 64);
|
592 |
|
593 |
-
/** @var resource $hs */
|
594 |
$hs = hash_init('sha512');
|
595 |
hash_update($hs, self::substr($az, 32, 32));
|
596 |
/** @var resource $hs */
|
@@ -610,7 +609,6 @@ class ParagonIE_Sodium_File extends ParagonIE_Sodium_Core_Util
|
|
610 |
ParagonIE_Sodium_Core_Ed25519::ge_scalarmult_base($nonce)
|
611 |
);
|
612 |
|
613 |
-
/** @var resource $hs */
|
614 |
$hs = hash_init('sha512');
|
615 |
hash_update($hs, self::substr($sig, 0, 32));
|
616 |
hash_update($hs, self::substr($pk, 0, 32));
|
@@ -719,7 +717,6 @@ class ParagonIE_Sodium_File extends ParagonIE_Sodium_Core_Util
|
|
719 |
/** @var ParagonIE_Sodium_Core_Curve25519_Ge_P3 $A */
|
720 |
$A = ParagonIE_Sodium_Core_Ed25519::ge_frombytes_negate_vartime($publicKey);
|
721 |
|
722 |
-
/** @var resource $hs */
|
723 |
$hs = hash_init('sha512');
|
724 |
hash_update($hs, self::substr($sig, 0, 32));
|
725 |
hash_update($hs, self::substr($publicKey, 0, 32));
|
@@ -1079,7 +1076,7 @@ class ParagonIE_Sodium_File extends ParagonIE_Sodium_Core_Util
|
|
1079 |
* @param resource|object $hash
|
1080 |
* @param resource $fp
|
1081 |
* @param int $size
|
1082 |
-
* @return
|
1083 |
* @throws SodiumException
|
1084 |
* @throws TypeError
|
1085 |
* @psalm-suppress PossiblyInvalidArgument
|
@@ -1095,12 +1092,12 @@ class ParagonIE_Sodium_File extends ParagonIE_Sodium_Core_Util
|
|
1095 |
if (!is_resource($hash)) {
|
1096 |
throw new TypeError('Argument 1 must be a resource, ' . gettype($hash) . ' given.');
|
1097 |
}
|
1098 |
-
|
1099 |
} else {
|
1100 |
if (!is_object($hash)) {
|
1101 |
throw new TypeError('Argument 1 must be an object (PHP 7.2+), ' . gettype($hash) . ' given.');
|
1102 |
}
|
1103 |
}
|
|
|
1104 |
if (!is_resource($fp)) {
|
1105 |
throw new TypeError('Argument 2 must be a resource, ' . gettype($fp) . ' given.');
|
1106 |
}
|
@@ -1167,7 +1164,6 @@ class ParagonIE_Sodium_File extends ParagonIE_Sodium_Core_Util
|
|
1167 |
$az[0] = self::intToChr(self::chrToInt($az[0]) & 248);
|
1168 |
$az[31] = self::intToChr((self::chrToInt($az[31]) & 63) | 64);
|
1169 |
|
1170 |
-
/** @var resource $hs */
|
1171 |
$hs = hash_init('sha512');
|
1172 |
hash_update($hs, self::substr($az, 32, 32));
|
1173 |
/** @var resource $hs */
|
@@ -1187,7 +1183,6 @@ class ParagonIE_Sodium_File extends ParagonIE_Sodium_Core_Util
|
|
1187 |
ParagonIE_Sodium_Core32_Ed25519::ge_scalarmult_base($nonce)
|
1188 |
);
|
1189 |
|
1190 |
-
/** @var resource $hs */
|
1191 |
$hs = hash_init('sha512');
|
1192 |
hash_update($hs, self::substr($sig, 0, 32));
|
1193 |
hash_update($hs, self::substr($pk, 0, 32));
|
@@ -1272,7 +1267,6 @@ class ParagonIE_Sodium_File extends ParagonIE_Sodium_Core_Util
|
|
1272 |
/** @var ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $A */
|
1273 |
$A = ParagonIE_Sodium_Core32_Ed25519::ge_frombytes_negate_vartime($publicKey);
|
1274 |
|
1275 |
-
/** @var resource $hs */
|
1276 |
$hs = hash_init('sha512');
|
1277 |
hash_update($hs, self::substr($sig, 0, 32));
|
1278 |
hash_update($hs, self::substr($publicKey, 0, 32));
|
590 |
$az[0] = self::intToChr(self::chrToInt($az[0]) & 248);
|
591 |
$az[31] = self::intToChr((self::chrToInt($az[31]) & 63) | 64);
|
592 |
|
|
|
593 |
$hs = hash_init('sha512');
|
594 |
hash_update($hs, self::substr($az, 32, 32));
|
595 |
/** @var resource $hs */
|
609 |
ParagonIE_Sodium_Core_Ed25519::ge_scalarmult_base($nonce)
|
610 |
);
|
611 |
|
|
|
612 |
$hs = hash_init('sha512');
|
613 |
hash_update($hs, self::substr($sig, 0, 32));
|
614 |
hash_update($hs, self::substr($pk, 0, 32));
|
717 |
/** @var ParagonIE_Sodium_Core_Curve25519_Ge_P3 $A */
|
718 |
$A = ParagonIE_Sodium_Core_Ed25519::ge_frombytes_negate_vartime($publicKey);
|
719 |
|
|
|
720 |
$hs = hash_init('sha512');
|
721 |
hash_update($hs, self::substr($sig, 0, 32));
|
722 |
hash_update($hs, self::substr($publicKey, 0, 32));
|
1076 |
* @param resource|object $hash
|
1077 |
* @param resource $fp
|
1078 |
* @param int $size
|
1079 |
+
* @return resource|object Resource on PHP < 7.2, HashContext object on PHP >= 7.2
|
1080 |
* @throws SodiumException
|
1081 |
* @throws TypeError
|
1082 |
* @psalm-suppress PossiblyInvalidArgument
|
1092 |
if (!is_resource($hash)) {
|
1093 |
throw new TypeError('Argument 1 must be a resource, ' . gettype($hash) . ' given.');
|
1094 |
}
|
|
|
1095 |
} else {
|
1096 |
if (!is_object($hash)) {
|
1097 |
throw new TypeError('Argument 1 must be an object (PHP 7.2+), ' . gettype($hash) . ' given.');
|
1098 |
}
|
1099 |
}
|
1100 |
+
|
1101 |
if (!is_resource($fp)) {
|
1102 |
throw new TypeError('Argument 2 must be a resource, ' . gettype($fp) . ' given.');
|
1103 |
}
|
1164 |
$az[0] = self::intToChr(self::chrToInt($az[0]) & 248);
|
1165 |
$az[31] = self::intToChr((self::chrToInt($az[31]) & 63) | 64);
|
1166 |
|
|
|
1167 |
$hs = hash_init('sha512');
|
1168 |
hash_update($hs, self::substr($az, 32, 32));
|
1169 |
/** @var resource $hs */
|
1183 |
ParagonIE_Sodium_Core32_Ed25519::ge_scalarmult_base($nonce)
|
1184 |
);
|
1185 |
|
|
|
1186 |
$hs = hash_init('sha512');
|
1187 |
hash_update($hs, self::substr($sig, 0, 32));
|
1188 |
hash_update($hs, self::substr($pk, 0, 32));
|
1267 |
/** @var ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $A */
|
1268 |
$A = ParagonIE_Sodium_Core32_Ed25519::ge_frombytes_negate_vartime($publicKey);
|
1269 |
|
|
|
1270 |
$hs = hash_init('sha512');
|
1271 |
hash_update($hs, self::substr($sig, 0, 32));
|
1272 |
hash_update($hs, self::substr($publicKey, 0, 32));
|
wordfence.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Wordfence Security
|
|
4 |
Plugin URI: http://www.wordfence.com/
|
5 |
Description: Wordfence Security - Anti-virus, Firewall and Malware Scan
|
6 |
Author: Wordfence
|
7 |
-
Version: 7.3.
|
8 |
Author URI: http://www.wordfence.com/
|
9 |
Network: true
|
10 |
*/
|
@@ -15,8 +15,8 @@ if(defined('WP_INSTALLING') && WP_INSTALLING){
|
|
15 |
if (!defined('ABSPATH')) {
|
16 |
exit;
|
17 |
}
|
18 |
-
define('WORDFENCE_VERSION', '7.3.
|
19 |
-
define('WORDFENCE_BUILD_NUMBER', '
|
20 |
define('WORDFENCE_BASENAME', function_exists('plugin_basename') ? plugin_basename(__FILE__) :
|
21 |
basename(dirname(__FILE__)) . '/' . basename(__FILE__));
|
22 |
|
4 |
Plugin URI: http://www.wordfence.com/
|
5 |
Description: Wordfence Security - Anti-virus, Firewall and Malware Scan
|
6 |
Author: Wordfence
|
7 |
+
Version: 7.3.2
|
8 |
Author URI: http://www.wordfence.com/
|
9 |
Network: true
|
10 |
*/
|
15 |
if (!defined('ABSPATH')) {
|
16 |
exit;
|
17 |
}
|
18 |
+
define('WORDFENCE_VERSION', '7.3.2');
|
19 |
+
define('WORDFENCE_BUILD_NUMBER', '1558031354');
|
20 |
define('WORDFENCE_BASENAME', function_exists('plugin_basename') ? plugin_basename(__FILE__) :
|
21 |
basename(dirname(__FILE__)) . '/' . basename(__FILE__));
|
22 |
|