WordPress.org

Make WordPress Core

Changeset 44953


Ignore:
Timestamp:
03/21/2019 04:55:21 AM (5 months ago)
Author:
tellyworth
Message:

General: Add sodium_compat library for crypto APIs in PHP < 7.2

This adds a pure PHP implementation of the cryptographic functions supported in PHP 7.2+. It provides the necessary backwards compatibility required to support signature verification and other security features going forward across all supported PHP versions.

Props paragoninitiativeenterprises
Fixes #45806. See #39309.

Location:
trunk/src/wp-includes
Files:
107 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/compat.php

    r43220 r44953  
    443443    require ABSPATH . WPINC . '/random_compat/random.php';
    444444}
     445// sodium_crypto_box was introduced in PHP 7.2
     446if ( ! function_exists( 'sodium_crypto_box' ) ) {
     447    require ABSPATH . WPINC . '/sodium_compat/autoload.php';
     448}
    445449
    446450if ( ! function_exists( 'array_replace_recursive' ) ) :
Note: See TracChangeset for help on using the changeset viewer.