Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .phan/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* @author Patrick Jahns <github@patrickjahns.de>
*
* @copyright Copyright (c) 2018, ownCloud GmbH
* @copyright Copyright (c) 2019, ownCloud GmbH
* @license GPL-2.0
*
* This program is free software; you can redistribute it and/or modify it
Expand Down
2 changes: 1 addition & 1 deletion appinfo/Migrations/Version20170913113840.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* @author Sujith Haridasan <sharidasan@owncloud.com>
*
* @copyright Copyright (c) 2017, ownCloud GmbH
* @copyright Copyright (c) 2019, ownCloud GmbH
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion appinfo/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @author Clark Tomlinson <fallen013@gmail.com>
* @author Thomas Müller <thomas.mueller@tmit.eu>
*
* @copyright Copyright (c) 2017, ownCloud GmbH
* @copyright Copyright (c) 2019, ownCloud GmbH
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @author Clark Tomlinson <fallen013@gmail.com>
* @author Thomas Müller <thomas.mueller@tmit.eu>
*
* @copyright Copyright (c) 2017, ownCloud GmbH
* @copyright Copyright (c) 2019, ownCloud GmbH
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion css/settings-admin.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @author Björn Schießle <schiessle@owncloud.com>
*
* @copyright Copyright (c) 2015, ownCloud, Inc.
* @copyright Copyright (c) 2019, ownCloud GmbH
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @author Clark Tomlinson <fallen013@gmail.com>
* @author Thomas Müller <thomas.mueller@tmit.eu>
*
* @copyright Copyright (c) 2017, ownCloud GmbH
* @copyright Copyright (c) 2019, ownCloud GmbH
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
Expand Down
18 changes: 9 additions & 9 deletions lib/Command/FixEncryptedVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,24 @@ protected function configure() {
parent::configure();

$this
->setName('encryption:fixencryptedversion')
->setName('encryption:fix-encrypted-version')
->setDescription('Fix the encrypted version if the encrypted file(s) are not downloadable.')
->addArgument(
'user',
InputArgument::REQUIRED,
'The user id whose files needs fix'
'The id of the user whose files need fixing'
);
}

protected function execute(InputInterface $input, OutputInterface $output) {
$user = $input->getArgument('user');

if ($user === null) {
$output->writeln("<error>No user provided.</error>\n");
$output->writeln("<error>No user id provided.</error>\n");
}

if ($this->userManager->get($user) === null) {
$output->writeln("<error>User $user does not exist. Please provide a valid user id</error>");
$output->writeln("<error>User id $user does not exist. Please provide a valid user id</error>");
return 1;
}
$this->walkUserFolder($user, $output);
Expand Down Expand Up @@ -142,7 +142,7 @@ private function correctEncryptedVersion($path, OutputInterface $output) {
$fileCache = $cache->get($fileId);

if ($storage->instanceOfStorage('OCA\Files_Sharing\ISharedStorage')) {
$output->writeln("<info>The file: $path is a share. Hence kindly fix this by running the script under the owner of share</info>");
$output->writeln("<info>The file: $path is a share. Hence kindly fix this by running the script for the owner of share</info>");
return true;
}

Expand All @@ -154,17 +154,17 @@ private function correctEncryptedVersion($path, OutputInterface $output) {
$cache->put($fileCache->getPath(), $cacheInfo);
$output->writeln("<info>Decrement the encrypted version to $encryptedVersion</info>");
if ($this->verifyFileContent($path, $output, false) === true) {
$output->writeln("<info>Fixed the file $path with version " . $encryptedVersion . "</info>");
$output->writeln("<info>Fixed the file: $path with version " . $encryptedVersion . "</info>");
return true;
}
$encryptedVersion--;
}

//So decrementing did not worked. Now lets increment. Max increment is till 5
//So decrementing did not work. Now lets increment. Max increment is till 5
$increment = 1;
while ($increment <= 5) {
/**
* The wrongEncryptedVersion would not be incremented so nothing to worry here.
* The wrongEncryptedVersion would not be incremented so nothing to worry about here.
* Only the newEncryptedVersion is incremented.
* For example if the wrong encrypted version is 4 then
* cycle1 -> newEncryptedVersion = 5 ( 4 + 1)
Expand All @@ -177,7 +177,7 @@ private function correctEncryptedVersion($path, OutputInterface $output) {
$cache->put($fileCache->getPath(), $cacheInfo);
$output->writeln("<info>Increment the encrypted version to $newEncryptedVersion</info>");
if ($this->verifyFileContent($path, $output, false) === true) {
$output->writeln("<info>Fixed the file $path with version " . $newEncryptedVersion . "</info>");
$output->writeln("<info>Fixed the file: $path with version " . $newEncryptedVersion . "</info>");
return true;
}
$increment++;
Expand Down
2 changes: 1 addition & 1 deletion lib/Command/HSMDaemon.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* @author Jörn Friedrich Dreyer <jfd@butonic.de>
*
* @copyright Copyright (c) 2017, ownCloud GmbH
* @copyright Copyright (c) 2019, ownCloud GmbH
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion lib/Command/MigrateKeys.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @author Björn Schießle <bjoern@schiessle.org>
* @author Thomas Müller <thomas.mueller@tmit.eu>
*
* @copyright Copyright (c) 2017, ownCloud GmbH
* @copyright Copyright (c) 2019, ownCloud GmbH
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion lib/Command/RecreateMasterKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* @author Sujith Haridasan <sharidasan@owncloud.com>
*
* @copyright Copyright (c) 2017, ownCloud GmbH
* @copyright Copyright (c) 2019, ownCloud GmbH
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion lib/Command/SelectEncryptionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* @author Björn Schießle <bjoern@schiessle.org>
*
* @copyright Copyright (c) 2017, ownCloud GmbH
* @copyright Copyright (c) 2019, ownCloud GmbH
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/RecoveryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @author Clark Tomlinson <fallen013@gmail.com>
* @author Lukas Reschke <lukas@statuscode.ch>
*
* @copyright Copyright (c) 2017, ownCloud GmbH
* @copyright Copyright (c) 2019, ownCloud GmbH
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
Expand Down
6 changes: 3 additions & 3 deletions lib/Controller/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @author Björn Schießle <bjoern@schiessle.org>
* @author Joas Schilling <coding@schilljs.com>
*
* @copyright Copyright (c) 2017, ownCloud GmbH
* @copyright Copyright (c) 2019, ownCloud GmbH
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -140,11 +140,11 @@ public function updatePrivateKeyPassword($oldPassword, $newPassword) {
if ($result === true) {
$this->session->setStatus(Session::INIT_SUCCESSFUL);
return new DataResponse(
['message' => (string)$this->l->t('Private key password successfully updated.')]
['message' => (string) $this->l->t('Private key password successfully updated.')]
);
} else {
return new DataResponse(
['message' => (string)$errorMessage],
['message' => (string) $errorMessage],
Http::STATUS_BAD_REQUEST
);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/StatusController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @author Björn Schießle <bjoern@schiessle.org>
* @author Thomas Müller <thomas.mueller@tmit.eu>
*
* @copyright Copyright (c) 2017, ownCloud GmbH
* @copyright Copyright (c) 2019, ownCloud GmbH
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion lib/Crypto/Crypt.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Lukas Reschke <lukas@statuscode.ch>
* @author Thomas Müller <thomas.mueller@tmit.eu>
*
* @copyright Copyright (c) 2017, ownCloud GmbH
* @copyright Copyright (c) 2019, ownCloud GmbH
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion lib/Crypto/CryptHSM.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Lukas Reschke <lukas@statuscode.ch>
* @author Thomas Müller <thomas.mueller@tmit.eu>
*
* @copyright Copyright (c) 2017, ownCloud GmbH
* @copyright Copyright (c) 2019, ownCloud GmbH
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion lib/Crypto/DecryptAll.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* @author Björn Schießle <bjoern@schiessle.org>
*
* @copyright Copyright (c) 2017, ownCloud GmbH
* @copyright Copyright (c) 2019, ownCloud GmbH
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
Expand Down
13 changes: 11 additions & 2 deletions lib/Crypto/EncryptAll.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @author Roeland Jago Douma <rullzer@owncloud.com>
* @author Thomas Müller <thomas.mueller@tmit.eu>
*
* @copyright Copyright (c) 2017, ownCloud GmbH
* @copyright Copyright (c) 2019, ownCloud GmbH
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -289,7 +289,7 @@ protected function encryptUsersFiles($uid, ProgressBar $progress, $userCount) {
*/
protected function encryptFile($path) {
$source = $path;
$target = $path . '.encrypted.' . \time() . '.part';
$target = $path . '.encrypted.' . $this->getTimeStamp() . '.part';

try {
$version = $this->keyManager->getVersion($source, $this->rootView);
Expand Down Expand Up @@ -381,6 +381,15 @@ protected function setupUserFS($uid) {
\OC_Util::setupFS($uid);
}

/**
* get current timestamp
*
* @return int
*/
protected function getTimeStamp() {
return \time();
}

/**
* generate one time password for the user and store it in a array
*
Expand Down
4 changes: 2 additions & 2 deletions lib/Crypto/Encryption.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @author Lukas Reschke <lukas@statuscode.ch>
* @author Thomas Müller <thomas.mueller@tmit.eu>
*
* @copyright Copyright (c) 2017, ownCloud GmbH
* @copyright Copyright (c) 2019, ownCloud GmbH
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -162,7 +162,7 @@ public function getDisplayName() {
* @param array $header contains the header data read from the file
* @param array $accessList who has access to the file contains the key 'users' and 'public'
* @param string|null $sourceFileOfRename Either false or the name of source file to be renamed.
* This is helpful for revision increment during move operation between storage.
* This is helpful for revision increment during move operation between storage.
*
* @return array $header contain data as key-value pairs which should be
* written to the header, in case of a write operation
Expand Down
2 changes: 1 addition & 1 deletion lib/Exceptions/MultiKeyDecryptException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* @author Thomas Müller <thomas.mueller@tmit.eu>
*
* @copyright Copyright (c) 2017, ownCloud GmbH
* @copyright Copyright (c) 2019, ownCloud GmbH
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion lib/Exceptions/MultiKeyEncryptException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* @author Thomas Müller <thomas.mueller@tmit.eu>
*
* @copyright Copyright (c) 2017, ownCloud GmbH
* @copyright Copyright (c) 2019, ownCloud GmbH
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion lib/Exceptions/PrivateKeyMissingException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @author Clark Tomlinson <fallen013@gmail.com>
* @author Thomas Müller <thomas.mueller@tmit.eu>
*
* @copyright Copyright (c) 2017, ownCloud GmbH
* @copyright Copyright (c) 2019, ownCloud GmbH
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion lib/Exceptions/PublicKeyMissingException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* @author Thomas Müller <thomas.mueller@tmit.eu>
*
* @copyright Copyright (c) 2017, ownCloud GmbH
* @copyright Copyright (c) 2019, ownCloud GmbH
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion lib/HookManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @author Björn Schießle <bjoern@schiessle.org>
* @author Clark Tomlinson <fallen013@gmail.com>
*
* @copyright Copyright (c) 2017, ownCloud GmbH
* @copyright Copyright (c) 2019, ownCloud GmbH
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion lib/Hooks/Contracts/IHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* @author Clark Tomlinson <fallen013@gmail.com>
*
* @copyright Copyright (c) 2017, ownCloud GmbH
* @copyright Copyright (c) 2019, ownCloud GmbH
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
Expand Down
4 changes: 2 additions & 2 deletions lib/Hooks/UserHooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @author Thomas Müller <thomas.mueller@tmit.eu>
* @author Vincent Petry <pvince81@owncloud.com>
*
* @copyright Copyright (c) 2017, ownCloud GmbH
* @copyright Copyright (c) 2019, ownCloud GmbH
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -240,7 +240,7 @@ public function preSetPassphrase($params) {
public function setPassphrase($params) {
$privateKey = null;
$user = null;
//Check if a session is there or not
//Check if the session is there or not
if ($this->user->getUser() !== null) {
// Get existing decrypted private key
$privateKey = $this->session->getPrivateKey();
Expand Down
2 changes: 1 addition & 1 deletion lib/JWT.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* @author Jörn Friedrich Dreyer <jfd@butonic.de>
*
* @copyright Copyright (c) 2017, ownCloud GmbH
* @copyright Copyright (c) 2019, ownCloud GmbH
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion lib/KeyManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Thomas Müller <thomas.mueller@tmit.eu>
* @author Vincent Petry <pvince81@owncloud.com>
*
* @copyright Copyright (c) 2017, ownCloud GmbH
* @copyright Copyright (c) 2019, ownCloud GmbH
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion lib/Migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @author Robin Appelman <icewind@owncloud.com>
* @author Vincent Petry <pvince81@owncloud.com>
*
* @copyright Copyright (c) 2017, ownCloud GmbH
* @copyright Copyright (c) 2019, ownCloud GmbH
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion lib/Panels/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* @author Tom Needham <tom@owncloud.com>
*
* @copyright Copyright (c) 2017, ownCloud GmbH
* @copyright Copyright (c) 2019, ownCloud GmbH
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion lib/Panels/Personal.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* @author Tom Needham <tom@owncloud.com>
*
* @copyright Copyright (c) 2017, ownCloud GmbH
* @copyright Copyright (c) 2019, ownCloud GmbH
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
Expand Down
Loading