aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/OCM
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/OCM')
-rw-r--r--lib/private/OCM/Model/OCMProvider.php4
-rw-r--r--lib/private/OCM/OCMSignatoryManager.php21
2 files changed, 21 insertions, 4 deletions
diff --git a/lib/private/OCM/Model/OCMProvider.php b/lib/private/OCM/Model/OCMProvider.php
index 32068efe3eb..fb13b7c0f93 100644
--- a/lib/private/OCM/Model/OCMProvider.php
+++ b/lib/private/OCM/Model/OCMProvider.php
@@ -183,7 +183,9 @@ class OCMProvider implements IOCMProvider {
$this->setResourceTypes($resources);
// import details about the remote request signing public key, if available
- $signatory = new Signatory($data['publicKey']['keyId'] ?? '', $data['publicKey']['publicKeyPem'] ?? '');
+ $signatory = new Signatory();
+ $signatory->setKeyId($data['publicKey']['keyId'] ?? '');
+ $signatory->setPublicKey($data['publicKey']['publicKeyPem'] ?? '');
if ($signatory->getKeyId() !== '' && $signatory->getPublicKey() !== '') {
$this->setSignatory($signatory);
}
diff --git a/lib/private/OCM/OCMSignatoryManager.php b/lib/private/OCM/OCMSignatoryManager.php
index 909952a6b37..6b6917bcd4b 100644
--- a/lib/private/OCM/OCMSignatoryManager.php
+++ b/lib/private/OCM/OCMSignatoryManager.php
@@ -9,7 +9,9 @@ declare(strict_types=1);
namespace OC\OCM;
+use NCU\Security\Signature\Enum\DigestAlgorithm;
use NCU\Security\Signature\Enum\SignatoryType;
+use NCU\Security\Signature\Enum\SignatureAlgorithm;
use NCU\Security\Signature\Exceptions\IdentityNotFoundException;
use NCU\Security\Signature\ISignatoryManager;
use NCU\Security\Signature\ISignatureManager;
@@ -61,7 +63,15 @@ class OCMSignatoryManager implements ISignatoryManager {
* @since 31.0.0
*/
public function getOptions(): array {
- return [];
+ return [
+ 'algorithm' => SignatureAlgorithm::RSA_SHA512,
+ 'digestAlgorithm' => DigestAlgorithm::SHA512,
+ 'extraSignatureHeaders' => [],
+ 'ttl' => 300,
+ 'dateHeader' => 'D, d M Y H:i:s T',
+ 'ttlSignatory' => 86400 * 3,
+ 'bodyMaxSize' => 50000,
+ ];
}
/**
@@ -92,7 +102,12 @@ class OCMSignatoryManager implements ISignatoryManager {
}
$keyPair = $this->identityProofManager->getAppKey('core', 'ocm_external');
- return new Signatory($keyId, $keyPair->getPublic(), $keyPair->getPrivate(), local: true);
+ $signatory = new Signatory(true);
+ $signatory->setKeyId($keyId);
+ $signatory->setPublicKey($keyPair->getPublic());
+ $signatory->setPrivateKey($keyPair->getPrivate());
+ return $signatory;
+
}
/**
@@ -148,7 +163,7 @@ class OCMSignatoryManager implements ISignatoryManager {
public function getRemoteSignatoryFromHost(string $host): ?Signatory {
$ocmProvider = $this->ocmDiscoveryService->discover($host, true);
$signatory = $ocmProvider->getSignatory();
- $signatory?->setType(SignatoryType::TRUSTED);
+ $signatory?->setSignatoryType(SignatoryType::TRUSTED);
return $signatory;
}
}