|
@@ 136-139 (lines=4) @@
|
| 133 |
|
* @throws OCSForbiddenException |
| 134 |
|
*/ |
| 135 |
|
public function requestSharedSecret($url, $token) { |
| 136 |
|
if ($this->trustedServers->isTrustedServer($url) === false) { |
| 137 |
|
$this->logger->error('remote server not trusted (' . $url . ') while requesting shared secret', ['app' => 'federation']); |
| 138 |
|
throw new OCSForbiddenException(); |
| 139 |
|
} |
| 140 |
|
|
| 141 |
|
// if both server initiated the exchange of the shared secret the greater |
| 142 |
|
// token wins |
|
@@ 184-187 (lines=4) @@
|
| 181 |
|
* @throws OCSForbiddenException |
| 182 |
|
*/ |
| 183 |
|
public function getSharedSecret($url, $token) { |
| 184 |
|
if ($this->trustedServers->isTrustedServer($url) === false) { |
| 185 |
|
$this->logger->error('remote server not trusted (' . $url . ') while getting shared secret', ['app' => 'federation']); |
| 186 |
|
throw new OCSForbiddenException(); |
| 187 |
|
} |
| 188 |
|
|
| 189 |
|
if ($this->isValidToken($url, $token) === false) { |
| 190 |
|
$expectedToken = $this->dbHandler->getToken($url); |