{
$owner = User::getOwnerDataById($uid);
+ if (empty($owner)) {
+ Logger::error('No owner data found, the deletion message cannot be processed.', ['user' => $uid]);
+ return false;
+ }
+
+ if (empty($owner['uprvkey'])) {
+ Logger::error('No private key for owner found, the deletion message cannot be processed.', ['user' => $uid]);
+ return false;
+ }
+
$data = ['@context' => ActivityPub::CONTEXT,
'id' => System::baseUrl() . '/activity/' . System::createGUID(),
'type' => 'Delete',
public static function rsaSign($data, $key, $alg = 'sha256')
{
if (empty($key)) {
- logger::warning('Empty key parameter', ['callstack' => System::callstack()]);
+ Logger::warning('Empty key parameter', ['callstack' => System::callstack()]);
}
openssl_sign($data, $sig, $key, (($alg == 'sha1') ? OPENSSL_ALGO_SHA1 : $alg));
return $sig;
public static function rsaVerify($data, $sig, $key, $alg = 'sha256')
{
if (empty($key)) {
- logger::warning('Empty key parameter', ['callstack' => System::callstack()]);
+ Logger::warning('Empty key parameter', ['callstack' => System::callstack()]);
}
return openssl_verify($data, $sig, $key, (($alg == 'sha1') ? OPENSSL_ALGO_SHA1 : $alg));
}