Avoid PHP warning with a missing key

pull/4935/head
Michael 2018-04-26 20:41:06 +00:00
rodzic a0c5a84ce8
commit 4957ab8fbb
1 zmienionych plików z 8 dodań i 0 usunięć

Wyświetl plik

@ -832,6 +832,10 @@ class Diaspora
if (isset($parent_author_signature)) {
$key = self::key($msg["author"]);
if (empty($key)) {
logger("No key found for parent author ".$msg["author"], LOGGER_DEBUG);
return false;
}
if (!Crypto::rsaVerify($signed_data, $parent_author_signature, $key, "sha256")) {
logger("No valid parent author signature for parent author ".$msg["author"]. " in type ".$type." - signed data: ".$signed_data." - Message: ".$msg["message"]." - Signature ".$parent_author_signature, LOGGER_DEBUG);
@ -840,6 +844,10 @@ class Diaspora
}
$key = self::key($fields->author);
if (empty($key)) {
logger("No key found for author ".$fields->author, LOGGER_DEBUG);
return false;
}
if (!Crypto::rsaVerify($signed_data, $author_signature, $key, "sha256")) {
logger("No valid author signature for author ".$fields->author. " in type ".$type." - signed data: ".$signed_data." - Message: ".$msg["message"]." - Signature ".$author_signature, LOGGER_DEBUG);