Skip to content

Commit a6fe37b

Browse files
authored
Add footnote about actor/keyId resolution during HTTP Signature processing (#1840)
* Add footnote about actor/keyId resolution during HTTP Signature processing * Use list for key types
1 parent d1df78f commit a6fe37b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

content/en/spec/security.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Mastodon verifies the signature using the following algorithm:
131131

132132
* Split `Signature:` into its separate parameters.
133133
* Construct the signature string from the value of `headers`.
134-
* Fetch the `keyId` and resolve to an actor's `publicKey`.
134+
* Fetch the `keyId`[^keyId] and resolve to an actor's `publicKey`.
135135
* RSA-SHA256 hash the signature string and compare to the Base64-decoded `signature` as decrypted by `publicKey[publicKeyPem]`.
136136
* Use the `Date:` header to check that the signed request was made within the past 12 hours.
137137

@@ -205,3 +205,7 @@ To verify a signature, Mastodon uses the following algorithm:
205205
* Strip `type`, `id`, and `signatureValue` from the `signature`, leaving only `signature[creator]` and `signature[created]`.
206206
* Base64-decode the `signatureValue` and verify it against the public key in `signature[creator]`.
207207

208+
[^keyId]: The `keyId` does not reference the `publicKeyPem` property (the key material). It is a URI for the `publicKey` object associated with the actor. That public key object has an owner property that must be the URI of the owning actor. The extracted `keyId` value is processed as follows:
209+
210+
* When the `keyId` is an actor and fragment (`actor#key`), the owner points back to the same document (actor).
211+
* When the `keyId` is a key (`/key`), the owner points back to some actor, and that actor should point back to the same key (establishing a bi-directional claim).

0 commit comments

Comments
 (0)