RINO 2 based on php-encryption

reenable RINO 1 functions, add a deprecation note.
use by default RINO 2 , with crypto from php-encryption
fallback to RINO 1 for old nodes.
This commit is contained in:
Fabrixxm 2015-06-23 16:13:09 +02:00
parent 7d83a19fd4
commit 6fbb02fb93
11 changed files with 1038 additions and 32 deletions

View file

@ -185,8 +185,9 @@ function salmon_key($pubkey) {
}
/** disable rino
if(! function_exists('aes_decrypt')) {
// DEPRECATED IN 3.4.1
function aes_decrypt($val,$ky)
{
$key="\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
@ -200,6 +201,7 @@ function aes_decrypt($val,$ky)
if(! function_exists('aes_encrypt')) {
// DEPRECATED IN 3.4.1
function aes_encrypt($val,$ky)
{
$key="\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
@ -210,7 +212,6 @@ function aes_encrypt($val,$ky)
$val=str_pad($val, (16*(floor(strlen($val) / 16)+(strlen($val) % 16==0?2:1))), chr(16-(strlen($val) % 16)));
return mcrypt_encrypt($enc, $key, $val, $mode, mcrypt_create_iv( mcrypt_get_iv_size($enc, $mode), MCRYPT_DEV_URANDOM));
}}
**/
function pkcs5_pad ($text, $blocksize)
{