Commit dc52a8ff authored by mmn's avatar mmn

Don't ensureProfile before we verify signature

parent 00b2bddc
......@@ -49,14 +49,15 @@ class SalmonAction extends Action
$entry = $magic_env->getPayload(); // Not cryptographically verified yet!
$this->activity = new Activity($entry->documentElement);
$oprofile = $this->ensureProfile();
$profile = Profile::fromUri($this->activity->actor->id);
assert($profile instanceof Profile);
} catch (Exception $e) {
common_debug('Salmon envelope parsing failed with: '.$e->getMessage());
$this->clientError($e->getMessage());
}
// Cryptographic verification test
if (!$magic_env->verify($oprofile->localProfile())) {
if (!$magic_env->verify($profile)) {
common_log(LOG_DEBUG, "Salmon signature verification failed.");
// TRANS: Client error.
$this->clientError(_m('Salmon signature verification failed.'));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment