aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/controller/ajaxcontroller.php
diff options
context:
space:
mode:
authorRobin McCorkell <rmccorkell@owncloud.com>2015-09-13 19:38:22 +0100
committerRobin McCorkell <rmccorkell@owncloud.com>2015-09-13 19:38:22 +0100
commit0dc71813354407fad8fa1db113d75cad78dfc12f (patch)
treeb34b739c2035808f08b8d92dac5ff1a40977b6ea /apps/files_external/controller/ajaxcontroller.php
parent2e7d50b7233dd812a0cca8bdc433fbfa41b8b31e (diff)
parent442f5269ef229afa09cbe1e06b2a73bb9656e8c4 (diff)
downloadnextcloud-server-0dc71813354407fad8fa1db113d75cad78dfc12f.tar.gz
nextcloud-server-0dc71813354407fad8fa1db113d75cad78dfc12f.zip
Merge pull request #18441 from owncloud/ext-backends.advanced
Migrate advanced external storage backends to new registration API [part 3]
Diffstat (limited to 'apps/files_external/controller/ajaxcontroller.php')
-rw-r--r--apps/files_external/controller/ajaxcontroller.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/apps/files_external/controller/ajaxcontroller.php b/apps/files_external/controller/ajaxcontroller.php
index cb2de432286..c285cd34e70 100644
--- a/apps/files_external/controller/ajaxcontroller.php
+++ b/apps/files_external/controller/ajaxcontroller.php
@@ -25,19 +25,19 @@ namespace OCA\Files_External\Controller;
use OCP\AppFramework\Controller;
use OCP\IRequest;
use OCP\AppFramework\Http\JSONResponse;
-use phpseclib\Crypt\RSA;
+use OCA\Files_External\Lib\Auth\PublicKey\RSA;
class AjaxController extends Controller {
- public function __construct($appName, IRequest $request) {
+ /** @var RSA */
+ private $rsaMechanism;
+
+ public function __construct($appName, IRequest $request, RSA $rsaMechanism) {
parent::__construct($appName, $request);
+ $this->rsaMechanism = $rsaMechanism;
}
private function generateSshKeys() {
- $rsa = new RSA();
- $rsa->setPublicKeyFormat(RSA::PUBLIC_FORMAT_OPENSSH);
- $rsa->setPassword(\OC::$server->getConfig()->getSystemValue('secret', ''));
-
- $key = $rsa->createKey();
+ $key = $this->rsaMechanism->createKey();
// Replace the placeholder label with a more meaningful one
$key['publicKey'] = str_replace('phpseclib-generated-key', gethostname(), $key['publickey']);