mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 00:35:30 +00:00
bloody hell... php version incompatibility with openssl - openssl no longer accepts a string as an algorithm. Earlier versions didn't recognise sha256. So we'll look to see if the algorithm constant for sha256 is defined and if so we'll use that instead of the string.
This commit is contained in:
parent
a6987134e5
commit
817d146123
2 changed files with 12 additions and 1 deletions
7
boot.php
7
boot.php
|
@ -1393,6 +1393,13 @@ function fix_system_urls($oldurl,$newurl) {
|
|||
dbesc($oldurl)
|
||||
);
|
||||
|
||||
|
||||
$z = q("update profile set photo = '%s', thumb = '%s' where uid = %d",
|
||||
dbesc(str_replace($oldurl,$newurl,$rr['xchan_photo_l'])),
|
||||
dbesc(str_replace($oldurl,$newurl,$rr['xchan_photo_m'])),
|
||||
intval($rr['channel_id'])
|
||||
);
|
||||
|
||||
proc_run('php', 'include/notifier.php', 'refresh_all', $rr['channel_id']);
|
||||
|
||||
}
|
||||
|
|
|
@ -4,6 +4,8 @@ function rsa_sign($data,$key,$alg = 'sha256') {
|
|||
if(! $key)
|
||||
return 'no key';
|
||||
$sig = '';
|
||||
if(defined(OPENSSL_ALGO_SHA256) && $alg === 'sha256')
|
||||
$alg = OPENSSL_ALGO_SHA256;
|
||||
openssl_sign($data,$sig,$key,$alg);
|
||||
return $sig;
|
||||
}
|
||||
|
@ -13,6 +15,8 @@ function rsa_verify($data,$sig,$key,$alg = 'sha256') {
|
|||
if(! $key)
|
||||
return false;
|
||||
|
||||
if(defined(OPENSSL_ALGO_SHA256) && $alg === 'sha256')
|
||||
$alg = OPENSSL_ALGO_SHA256;
|
||||
$verify = openssl_verify($data,$sig,$key,$alg);
|
||||
return $verify;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue