From 76abc08dd445998bbf77ea0019f85900fa37eb50 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Thu, 4 Oct 2018 17:41:17 -0400 Subject: [PATCH] [WIP] Start implementing request signing on inbox delivery --- includes/server/deliver.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/includes/server/deliver.php b/includes/server/deliver.php index e7f5853..3b422ab 100644 --- a/includes/server/deliver.php +++ b/includes/server/deliver.php @@ -132,4 +132,17 @@ function post_activity_to_inboxes( $activity, $recipients ) { } } } + +function get_signing_string( $inbox_url ) { + $now = new \DateTime( 'now', new \DateTimeZone('GMT') ); + $now_str = $now->format( 'D, d M Y H:i:s T' ); + $parsed = parse_url( $inbox_url ); + return "(request-target): post $parsed[path] +host: $parsed[host] +date: $now_str" +} + +function signature_header( $inbox_url, $actor_id ) { + // TODO +} ?>