Skip to content

Commit a4ffc38

Browse files
committed
fix(federatedfilesharing): sign token-exchange request with RFC 9421
The outbound POST to the remote /api/v1/access-token endpoint was signed using bare OCMSignatoryManager, which falls through to the draft-cavage path because no rfc9421.format option is set. Wrap the manager in Rfc9421SignatoryManager so the exchange request is signed with the Ed25519 key and RFC 9421 signature base, matching what OCMDiscoveryService::prepareOcmPayload already does for OCM endpoints when the remote advertises the http-sig capability. Receiving TokenController auto-detects RFC 9421 vs draft-cavage via the Signature-Input header, so no inbound change is needed. Signed-off-by: Micke Nordin <kano@sunet.se>
1 parent 26669ae commit a4ffc38

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use OC\AppFramework\Http;
1010
use OC\Files\Filesystem;
1111
use OC\OCM\OCMSignatoryManager;
12+
use OC\OCM\Rfc9421SignatoryManager;
1213
use OCA\FederatedFileSharing\AddressHandler;
1314
use OCA\FederatedFileSharing\FederatedShareProvider;
1415
use OCA\Federation\TrustedServers;
@@ -759,7 +760,7 @@ private function exchangeToken(string $remote, #[SensitiveParameter] string $sha
759760

760761
try {
761762
$options = $this->signatureManager->signOutgoingRequestIClientPayload(
762-
$this->signatoryManager,
763+
new Rfc9421SignatoryManager($this->signatoryManager),
763764
$options,
764765
'post',
765766
$tokenEndpoint

0 commit comments

Comments
 (0)