aboutsummaryrefslogtreecommitdiffstats
path: root/apps/encryption/tests
Commit message (Collapse)AuthorAgeFilesLines
* Adapt test to fixed command output.Côme Chilliet2022-08-041-3/+14
| | | | | | | No user and non-existing user are now correctly treated as two separated cases Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Remove at() matcher use from encryption testsCôme Chilliet2022-05-243-33/+43
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Save encrypted files in binary formatplumbeo2022-05-041-9/+14
| | | | | | | | | | | | | Default to the more space-efficient binary encoding for newly encrypted files instead of the traditional base64 encoding, eliminating the 33% overhead. The new option 'encryption.use_legacy_encoding' allows to force the legacy encoding format if needed. Files encoded in the old format remain readable. Based on https://github.com/owncloud/encryption/pull/224 and https://github.com/owncloud/core/pull/38249 by karakayasemi. Signed-off-by: plumbeo <plumbeo@users.noreply.github.com>
* Fix tests on PHP 8.1 for encryption, files_sharing, files_version,Côme Chilliet2021-12-161-1/+4
| | | | | | files_trashbin and theming apps Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Fix encrypted version to 0 when finding unencrypted fileVincent Petry2021-08-261-0/+40
| | | | | | | | | | | | Whenever the command is run and a "legacy cipher" seems to be detected when the legacy option is disabled, it's highly likely that the file is actually unencrypted but the database contains a encrypted version higher than 0 for some reason. The command now detects this case and automatically sets the encrypted version to 0 so that the file can be read again. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
* Prevent running FixEncryptedVersion without master keyVincent Petry2021-06-291-0/+46
| | | | | | | Return an error when running occ encryption:fix-encrypted-version when master key encryption is not enabled. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
* Fix FixEncryptedVersionTest testVincent Petry2021-06-291-153/+80
| | | | | | | Fixed setup to use EncryptionTrait like other existing tests. Fix expectations to not rely on side effects from previous test cases. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
* Downstream FixEncryptedVersionTestVincent Petry2021-06-291-0/+373
| | | | Signed-off-by: Vincent Petry <vincent@nextcloud.com>
* Update php licensesJohn Molakvoæ (skjnldsv)2021-06-0416-17/+1
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Fix testMorris Jobke2021-05-201-1/+1
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Update all license headers for Nextcloud 21Christoph Wurst2020-12-162-2/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Remove unused dependencies in encryption app setupMorris Jobke2020-11-231-10/+1
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Format code to a single space around binary operatorsChristoph Wurst2020-10-053-5/+5
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update the license headers for Nextcloud 20Christoph Wurst2020-08-243-1/+3
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Merge pull request #22018 from nextcloud/bugfix/noid/harden-key-generationMorris Jobke2020-08-192-5/+51
|\ | | | | Harden SSE key generation
| * Test for locking state in key generationJulius Härtl2020-08-142-5/+51
| | | | | | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* | Make legacy cipher opt inRoeland Jago Douma2020-08-192-11/+22
|/ | | | | | | | * Systems that upgrade have this enabled by default * New systems disable it * We'll have to add some wargning in the setup checks if this is enabled Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Change PHPDoc type hint from PHPUnit_Framework_MockObject_MockObject to ↵Morris Jobke2020-08-1214-100/+100
| | | | | | \PHPUnit\Framework\MockObject\MockObject Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Update license headers for 19Christoph Wurst2020-04-291-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Add visibility to all methods and position of static keywordChristoph Wurst2020-04-101-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Format control structures, classes, methods and functionChristoph Wurst2020-04-1015-65/+4
| | | | | | | | | | | | | | | To continue this formatting madness, here's a tiny patch that adds unified formatting for control structures like if and loops as well as classes, their methods and anonymous functions. This basically forces the constructs to start on the same line. This is not exactly what PSR2 wants, but I think we can have a few exceptions with "our" style. The starting of braces on the same line is pracrically standard for our code. This also removes and empty lines from method/function bodies at the beginning and end. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use elseif instead of else ifChristoph Wurst2020-04-101-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Unify function spacing to PSR2 recommendationChristoph Wurst2020-04-096-12/+12
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use exactly one empty line after the namespace declarationChristoph Wurst2020-04-0913-13/+0
| | | | | | For PSR2 Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Fix (array) indent style to always use one tabChristoph Wurst2020-04-091-2/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update the license headers for Nextcloud 19Christoph Wurst2020-03-3110-0/+10
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Merge pull request #20170 from nextcloud/techdebt/remove-unused-importsChristoph Wurst2020-03-271-2/+0
|\ | | | | Remove unused imports
| * Remove unused importsChristoph Wurst2020-03-251-2/+0
| | | | | | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* | Use the short array syntax, everywhereChristoph Wurst2020-03-263-62/+62
| | | | | | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* | Use the shorter phpunit syntax for mocked return valuesChristoph Wurst2020-03-258-20/+20
|/ | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update license headersChristoph Wurst2019-12-0516-18/+22
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* TO REVERT LATER: fix UserHooksTestRoeland Jago Douma2019-11-271-2/+2
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Mode to modern phpunitRoeland Jago Douma2019-11-279-50/+46
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Make phpunit8 compatibleRoeland Jago Douma2019-11-2716-17/+17
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Some php-cs fixesRoeland Jago Douma2019-11-2214-16/+3
| | | | | | | | | | | * Order the imports * No leading slash on imports * Empty line before namespace * One line per import * Empty after imports * Emmpty line at bottom of file Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix wrongly mixed mock objects in encryption testsJoas Schilling2019-09-154-73/+53
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Remove deprecated functions from SecureRandomRoeland Jago Douma2018-12-071-2/+0
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* skip already encrypted files on encrypt all commandBjoern Schiessle2018-10-241-0/+33
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* add occ command to recover encrypted files in case of password lostBjoern Schiessle2018-08-161-9/+8
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* Fix encryption admin section testsJulius Härtl2018-08-021-2/+2
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* this was a migration step to ownCloud 8.0 to restructure the encryption ↵Bjoern Schiessle2018-03-022-604/+6
| | | | | | folder which is no longer needed Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* Class "ProgressBar" is declared "final" and cannot be mocked.Joas Schilling2018-01-251-2/+4
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix risky tests without assertionsJoas Schilling2018-01-252-4/+4
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Update license headersMorris Jobke2017-11-0617-0/+37
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Use ::class in test mocks of encryption appMorris Jobke2017-10-2614-77/+125
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Use ::class in test mocksMorris Jobke2017-10-2410-25/+43
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Use DI for IAppManager to encryption migrationMorris Jobke2017-10-241-7/+9
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* print generated encryption key passwords directly after generating the keys ↵Kenneth Newwood2017-09-111-2/+2
| | | | | | so that errors during the encryption do not lead to a potentially massive data loss Signed-off-by: Kenneth Newwood <kenneth@newwood.name>
* adjust encryption tests to the new master key defaultBjoern Schiessle2017-07-061-1/+1
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* improve status messagesBjoern Schiessle2017-07-061-1/+7
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>