StorageTest.php 18.9 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php

/**
 * ownCloud
 *
 * @copyright (C) 2015 ownCloud, Inc.
 *
 * @author Bjoern Schiessle <schiessle@owncloud.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
 *
 * You should have received a copy of the GNU Affero General Public
 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
 */

namespace Test\Encryption\Keys;

use OC\Encryption\Keys\Storage;
27
28
use OC\Encryption\Util;
use OC\Files\View;
29
use Test\TestCase;
30
31
32
use Test\Traits\UserTrait;
use OCP\IUser;
use OCP\IUserSession;
33

34
35
36
37
38
39
40
/**
 * Class StorageTest
 *
 * @group DB
 *
 * @package Test\Encryption\Keys
 */
41
42
class StorageTest extends TestCase {

43
44
	use UserTrait;

45
46
47
	/** @var Storage */
	protected $storage;

48
	/** @var \PHPUnit_Framework_MockObject_MockObject | Util */
49
50
	protected $util;

51
	/** @var \PHPUnit_Framework_MockObject_MockObject | View */
52
53
	protected $view;

54
55
56
	/** @var \PHPUnit_Framework_MockObject_MockObject */
	protected $config;

57
58
59
60
61
62
63
64
65
66
67
	public function setUp() {
		parent::setUp();

		$this->util = $this->getMockBuilder('OC\Encryption\Util')
			->disableOriginalConstructor()
			->getMock();

		$this->view = $this->getMockBuilder('OC\Files\View')
			->disableOriginalConstructor()
			->getMock();

68
69
70
71
		$this->config = $this->getMockBuilder('OCP\IConfig')
			->disableOriginalConstructor()
			->getMock();

72
73
74
75
76
77
78
79
		$user = $this->createMock(IUser::class);
		$user->method('getUID')->willReturn('user1');
		$userSession = $this->createMock(IUserSession::class);
		$userSession->method('getUser')->willReturn($user);

		$this->createUser('user1', '123456');
		$this->createUser('user2', '123456');
		$this->storage = new Storage($this->view, $this->util, $userSession);
80
81
82
83
84
	}

	public function testSetFileKey() {
		$this->util->expects($this->any())
			->method('getUidAndFilename')
Thomas Müller's avatar
Thomas Müller committed
85
			->willReturn(['user1', '/files/foo.txt']);
86
87
88
89
90
91
92
93
94
95
96
97
98
		$this->util->expects($this->any())
			->method('stripPartialFileExtension')
			->willReturnArgument(0);
		$this->util->expects($this->any())
			->method('isSystemWideMountPoint')
			->willReturn(false);
		$this->view->expects($this->once())
			->method('file_put_contents')
			->with($this->equalTo('/user1/files_encryption/keys/files/foo.txt/encModule/fileKey'),
				$this->equalTo('key'))
			->willReturn(strlen('key'));

		$this->assertTrue(
99
			$this->storage->setFileKey('user1/files/foo.txt', 'fileKey', 'key', 'encModule')
100
101
102
		);
	}

103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
	public function dataTestGetFileKey() {
		return [
			['/files/foo.txt', '/files/foo.txt', true, 'key'],
			['/files/foo.txt.ocTransferId2111130212.part', '/files/foo.txt', true, 'key'],
			['/files/foo.txt.ocTransferId2111130212.part', '/files/foo.txt', false, 'key2'],
		];
	}

	/**
	 * @dataProvider dataTestGetFileKey
	 *
	 * @param string $path
	 * @param string $strippedPartialName
	 * @param bool $originalKeyExists
	 * @param string $expectedKeyContent
	 */
119
	public function testGetFileKey($path, $strippedPartialName, $originalKeyExists, $expectedKeyContent) {
120
121
		$this->util->expects($this->any())
			->method('getUidAndFilename')
122
123
124
125
			->willReturnMap([
				['user1/files/foo.txt', ['user1', '/files/foo.txt']],
				['user1/files/foo.txt.ocTransferId2111130212.part', ['user1', '/files/foo.txt.ocTransferId2111130212.part']],
			]);
126
127
128
		// we need to strip away the part file extension in order to reuse a
		// existing key if it exists, otherwise versions will break
		$this->util->expects($this->once())
129
			->method('stripPartialFileExtension')
130
			->willReturn('user1' . $strippedPartialName);
131
132
133
134
		$this->util->expects($this->any())
			->method('isSystemWideMountPoint')
			->willReturn(false);

135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
		$this->view->expects($this->at(0))
			->method('file_exists')
			->with($this->equalTo('/user1/files_encryption/keys' . $strippedPartialName . '/encModule/fileKey'))
			->willReturn($originalKeyExists);

		if (!$originalKeyExists) {
			$this->view->expects($this->at(1))
				->method('file_exists')
				->with($this->equalTo('/user1/files_encryption/keys' . $path . '/encModule/fileKey'))
				->willReturn(true);

			$this->view->expects($this->once())
				->method('file_get_contents')
				->with($this->equalTo('/user1/files_encryption/keys' . $path . '/encModule/fileKey'))
				->willReturn('key2');
		} else {
			$this->view->expects($this->once())
				->method('file_get_contents')
				->with($this->equalTo('/user1/files_encryption/keys' . $strippedPartialName . '/encModule/fileKey'))
				->willReturn('key');
		}

		$this->assertSame($expectedKeyContent,
			$this->storage->getFileKey('user1' . $path, 'fileKey', 'encModule')
159
160
161
162
163
164
		);
	}

	public function testSetFileKeySystemWide() {
		$this->util->expects($this->any())
			->method('getUidAndFilename')
Thomas Müller's avatar
Thomas Müller committed
165
			->willReturn(['user1', '/files/foo.txt']);
166
167
168
169
170
171
172
173
174
175
176
177
178
		$this->util->expects($this->any())
			->method('isSystemWideMountPoint')
			->willReturn(true);
		$this->util->expects($this->any())
			->method('stripPartialFileExtension')
			->willReturnArgument(0);
		$this->view->expects($this->once())
			->method('file_put_contents')
			->with($this->equalTo('/files_encryption/keys/files/foo.txt/encModule/fileKey'),
				$this->equalTo('key'))
			->willReturn(strlen('key'));

		$this->assertTrue(
179
			$this->storage->setFileKey('user1/files/foo.txt', 'fileKey', 'key', 'encModule')
180
181
182
183
184
185
		);
	}

	public function testGetFileKeySystemWide() {
		$this->util->expects($this->any())
			->method('getUidAndFilename')
Thomas Müller's avatar
Thomas Müller committed
186
			->willReturn(['user1', '/files/foo.txt']);
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
		$this->util->expects($this->any())
			->method('stripPartialFileExtension')
			->willReturnArgument(0);
		$this->util->expects($this->any())
			->method('isSystemWideMountPoint')
			->willReturn(true);
		$this->view->expects($this->once())
			->method('file_get_contents')
			->with($this->equalTo('/files_encryption/keys/files/foo.txt/encModule/fileKey'))
			->willReturn('key');
		$this->view->expects($this->once())
			->method('file_exists')
			->with($this->equalTo('/files_encryption/keys/files/foo.txt/encModule/fileKey'))
			->willReturn(true);

		$this->assertSame('key',
203
			$this->storage->getFileKey('user1/files/foo.txt', 'fileKey', 'encModule')
204
205
206
207
208
209
210
211
212
213
214
		);
	}

	public function testSetSystemUserKey() {
		$this->view->expects($this->once())
			->method('file_put_contents')
			->with($this->equalTo('/files_encryption/encModule/shareKey_56884'),
				$this->equalTo('key'))
			->willReturn(strlen('key'));

		$this->assertTrue(
215
			$this->storage->setSystemUserKey('shareKey_56884', 'key', 'encModule')
216
217
218
219
220
221
222
223
224
225
226
		);
	}

	public function testSetUserKey() {
		$this->view->expects($this->once())
			->method('file_put_contents')
			->with($this->equalTo('/user1/files_encryption/encModule/user1.publicKey'),
				$this->equalTo('key'))
			->willReturn(strlen('key'));

		$this->assertTrue(
227
			$this->storage->setUserKey('user1', 'publicKey', 'key', 'encModule')
228
229
230
231
232
233
234
235
236
237
238
239
240
241
		);
	}

	public function testGetSystemUserKey() {
		$this->view->expects($this->once())
			->method('file_get_contents')
			->with($this->equalTo('/files_encryption/encModule/shareKey_56884'))
			->willReturn('key');
		$this->view->expects($this->once())
			->method('file_exists')
			->with($this->equalTo('/files_encryption/encModule/shareKey_56884'))
			->willReturn(true);

		$this->assertSame('key',
242
			$this->storage->getSystemUserKey('shareKey_56884', 'encModule')
243
244
245
246
247
248
249
250
251
252
253
254
255
256
		);
	}

	public function testGetUserKey() {
		$this->view->expects($this->once())
			->method('file_get_contents')
			->with($this->equalTo('/user1/files_encryption/encModule/user1.publicKey'))
			->willReturn('key');
		$this->view->expects($this->once())
			->method('file_exists')
			->with($this->equalTo('/user1/files_encryption/encModule/user1.publicKey'))
			->willReturn(true);

		$this->assertSame('key',
257
			$this->storage->getUserKey('user1', 'publicKey', 'encModule')
258
259
260
		);
	}

261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
	public function testGetUserKeyShared() {
		$this->view->expects($this->once())
			->method('file_get_contents')
			->with($this->equalTo('/user2/files_encryption/encModule/user2.publicKey'))
			->willReturn('key');
		$this->view->expects($this->once())
			->method('file_exists')
			->with($this->equalTo('/user2/files_encryption/encModule/user2.publicKey'))
			->willReturn(true);

		$this->assertFalse($this->isUserHomeMounted('user2'));

		$this->assertSame('key',
			$this->storage->getUserKey('user2', 'publicKey', 'encModule')
		);

		$this->assertTrue($this->isUserHomeMounted('user2'));
	}

	/**
	 * Returns whether the home of the given user was mounted
	 *
	 * @param string $userId
	 * @return boolean true if mounted, false otherwise
	 */
	private function isUserHomeMounted($userId) {
		// verify that user2's FS got mounted when retrieving the key
		$mountManager = \OC::$server->getMountManager();
		$mounts = $mountManager->getAll();
		$mounts = array_filter($mounts, function($mount) use ($userId) {
			return ($mount->getMountPoint() === "/$userId/");
		});

		return !empty($mounts);
	}

297
	public function testDeleteUserKey() {
298
299
300
301
		$this->view->expects($this->once())
			->method('file_exists')
			->with($this->equalTo('/user1/files_encryption/encModule/user1.publicKey'))
			->willReturn(true);
302
303
304
305
306
307
		$this->view->expects($this->once())
			->method('unlink')
			->with($this->equalTo('/user1/files_encryption/encModule/user1.publicKey'))
			->willReturn(true);

		$this->assertTrue(
308
			$this->storage->deleteUserKey('user1', 'publicKey', 'encModule')
309
310
311
312
		);
	}

	public function testDeleteSystemUserKey() {
313
314
315
316
		$this->view->expects($this->once())
			->method('file_exists')
			->with($this->equalTo('/files_encryption/encModule/shareKey_56884'))
			->willReturn(true);
317
318
319
320
321
322
		$this->view->expects($this->once())
			->method('unlink')
			->with($this->equalTo('/files_encryption/encModule/shareKey_56884'))
			->willReturn(true);

		$this->assertTrue(
323
			$this->storage->deleteSystemUserKey('shareKey_56884', 'encModule')
324
325
326
327
328
329
		);
	}

	public function testDeleteFileKeySystemWide() {
		$this->util->expects($this->any())
			->method('getUidAndFilename')
Thomas Müller's avatar
Thomas Müller committed
330
			->willReturn(['user1', '/files/foo.txt']);
331
332
333
334
335
336
		$this->util->expects($this->any())
			->method('stripPartialFileExtension')
			->willReturnArgument(0);
		$this->util->expects($this->any())
			->method('isSystemWideMountPoint')
			->willReturn(true);
337
338
339
340
		$this->view->expects($this->once())
			->method('file_exists')
			->with($this->equalTo('/files_encryption/keys/files/foo.txt/encModule/fileKey'))
			->willReturn(true);
341
342
343
344
345
346
		$this->view->expects($this->once())
			->method('unlink')
			->with($this->equalTo('/files_encryption/keys/files/foo.txt/encModule/fileKey'))
			->willReturn(true);

		$this->assertTrue(
347
			$this->storage->deleteFileKey('user1/files/foo.txt', 'fileKey', 'encModule')
348
349
350
351
352
353
		);
	}

	public function testDeleteFileKey() {
		$this->util->expects($this->any())
			->method('getUidAndFilename')
Thomas Müller's avatar
Thomas Müller committed
354
			->willReturn(['user1', '/files/foo.txt']);
355
356
357
358
359
360
		$this->util->expects($this->any())
			->method('stripPartialFileExtension')
			->willReturnArgument(0);
		$this->util->expects($this->any())
			->method('isSystemWideMountPoint')
			->willReturn(false);
361
362
363
364
		$this->view->expects($this->once())
			->method('file_exists')
			->with($this->equalTo('/user1/files_encryption/keys/files/foo.txt/encModule/fileKey'))
			->willReturn(true);
365
366
367
368
369
370
		$this->view->expects($this->once())
			->method('unlink')
			->with($this->equalTo('/user1/files_encryption/keys/files/foo.txt/encModule/fileKey'))
			->willReturn(true);

		$this->assertTrue(
371
			$this->storage->deleteFileKey('user1/files/foo.txt', 'fileKey', 'encModule')
372
373
374
		);
	}

Bjoern Schiessle's avatar
Bjoern Schiessle committed
375
376
377
	/**
	 * @dataProvider dataProviderCopyRename
	 */
378
	public function testRenameKeys($source, $target, $systemWideMountSource, $systemWideMountTarget, $expectedSource, $expectedTarget) {
Bjoern Schiessle's avatar
Bjoern Schiessle committed
379
380
381
382
383
384
385
386
387
388
389
390
391
392
		$this->view->expects($this->any())
			->method('file_exists')
			->willReturn(true);
		$this->view->expects($this->any())
			->method('is_dir')
			->willReturn(true);
		$this->view->expects($this->once())
			->method('rename')
			->with(
				$this->equalTo($expectedSource),
				$this->equalTo($expectedTarget))
			->willReturn(true);
		$this->util->expects($this->any())
			->method('getUidAndFilename')
Thomas Müller's avatar
Thomas Müller committed
393
			->will($this->returnCallback([$this, 'getUidAndFilenameCallback']));
Bjoern Schiessle's avatar
Bjoern Schiessle committed
394
395
		$this->util->expects($this->any())
			->method('isSystemWideMountPoint')
396
397
398
399
400
401
			->willReturnCallback(function($path, $owner) use ($systemWideMountSource, $systemWideMountTarget) {
				if(strpos($path, 'source.txt') !== false) {
					return $systemWideMountSource;
				}
				return $systemWideMountTarget;
			});
Bjoern Schiessle's avatar
Bjoern Schiessle committed
402

403
		$this->storage->renameKeys($source, $target);
Bjoern Schiessle's avatar
Bjoern Schiessle committed
404
405
406
407
408
	}

	/**
	 * @dataProvider dataProviderCopyRename
	 */
409
	public function testCopyKeys($source, $target, $systemWideMountSource, $systemWideMountTarget , $expectedSource, $expectedTarget) {
Bjoern Schiessle's avatar
Bjoern Schiessle committed
410
411
412
413
414
415
416
417
418
419
420
421
422
423
		$this->view->expects($this->any())
			->method('file_exists')
			->willReturn(true);
		$this->view->expects($this->any())
			->method('is_dir')
			->willReturn(true);
		$this->view->expects($this->once())
			->method('copy')
			->with(
				$this->equalTo($expectedSource),
				$this->equalTo($expectedTarget))
			->willReturn(true);
		$this->util->expects($this->any())
			->method('getUidAndFilename')
Thomas Müller's avatar
Thomas Müller committed
424
			->will($this->returnCallback([$this, 'getUidAndFilenameCallback']));
Bjoern Schiessle's avatar
Bjoern Schiessle committed
425
426
		$this->util->expects($this->any())
			->method('isSystemWideMountPoint')
427
428
429
430
431
432
			->willReturnCallback(function($path, $owner) use ($systemWideMountSource, $systemWideMountTarget) {
				if(strpos($path, 'source.txt') !== false) {
					return $systemWideMountSource;
				}
				return $systemWideMountTarget;
			});
Bjoern Schiessle's avatar
Bjoern Schiessle committed
433

434
		$this->storage->copyKeys($source, $target);
Bjoern Schiessle's avatar
Bjoern Schiessle committed
435
436
437
438
439
440
441
442
	}

	public function getUidAndFilenameCallback() {
		$args = func_get_args();

		$path = $args[0];
		$parts = explode('/', $path);

Thomas Müller's avatar
Thomas Müller committed
443
		return [$parts[1], '/' . implode('/', array_slice($parts, 2))];
Bjoern Schiessle's avatar
Bjoern Schiessle committed
444
445
446
	}

	public function dataProviderCopyRename() {
Thomas Müller's avatar
Thomas Müller committed
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
		return [
			['/user1/files/source.txt', '/user1/files/target.txt', false, false,
				'/user1/files_encryption/keys/files/source.txt/', '/user1/files_encryption/keys/files/target.txt/'],
			['/user1/files/foo/source.txt', '/user1/files/target.txt', false, false,
				'/user1/files_encryption/keys/files/foo/source.txt/', '/user1/files_encryption/keys/files/target.txt/'],
			['/user1/files/source.txt', '/user1/files/foo/target.txt', false, false,
				'/user1/files_encryption/keys/files/source.txt/', '/user1/files_encryption/keys/files/foo/target.txt/'],
			['/user1/files/source.txt', '/user1/files/foo/target.txt', true, true,
				'/files_encryption/keys/files/source.txt/', '/files_encryption/keys/files/foo/target.txt/'],
			['/user1/files/source.txt', '/user1/files/target.txt', false, true,
				'/user1/files_encryption/keys/files/source.txt/', '/files_encryption/keys/files/target.txt/'],
			['/user1/files/source.txt', '/user1/files/target.txt', true, false,
				'/files_encryption/keys/files/source.txt/', '/user1/files_encryption/keys/files/target.txt/'],

			['/user2/files/source.txt', '/user1/files/target.txt', false, false,
				'/user2/files_encryption/keys/files/source.txt/', '/user1/files_encryption/keys/files/target.txt/'],
			['/user2/files/foo/source.txt', '/user1/files/target.txt', false, false,
				'/user2/files_encryption/keys/files/foo/source.txt/', '/user1/files_encryption/keys/files/target.txt/'],
			['/user2/files/source.txt', '/user1/files/foo/target.txt', false, false,
				'/user2/files_encryption/keys/files/source.txt/', '/user1/files_encryption/keys/files/foo/target.txt/'],
			['/user2/files/source.txt', '/user1/files/foo/target.txt', true, true,
				'/files_encryption/keys/files/source.txt/', '/files_encryption/keys/files/foo/target.txt/'],
			['/user2/files/source.txt', '/user1/files/target.txt', false, true,
				'/user2/files_encryption/keys/files/source.txt/', '/files_encryption/keys/files/target.txt/'],
			['/user2/files/source.txt', '/user1/files/target.txt', true, false,
				'/files_encryption/keys/files/source.txt/', '/user1/files_encryption/keys/files/target.txt/'],
		];
474
	}
475

476
477
478
479
480
	/**
	 * @dataProvider dataTestGetPathToKeys
	 *
	 * @param string $path
	 * @param boolean $systemWideMountPoint
481
	 * @param string $storageRoot
482
483
	 * @param string $expected
	 */
484
485
486
	public function testGetPathToKeys($path, $systemWideMountPoint, $storageRoot, $expected) {

		$this->invokePrivate($this->storage, 'root_dir', [$storageRoot]);
487
488
489

		$this->util->expects($this->any())
			->method('getUidAndFilename')
Thomas Müller's avatar
Thomas Müller committed
490
			->will($this->returnCallback([$this, 'getUidAndFilenameCallback']));
491
492
493
494
495
		$this->util->expects($this->any())
			->method('isSystemWideMountPoint')
			->willReturn($systemWideMountPoint);

		$this->assertSame($expected,
496
			self::invokePrivate($this->storage, 'getPathToKeys', [$path])
497
498
499
500
		);
	}

	public function dataTestGetPathToKeys() {
501
502
503
504
505
506
		return [
			['/user1/files/source.txt', false, '', '/user1/files_encryption/keys/files/source.txt/'],
			['/user1/files/source.txt', true, '', '/files_encryption/keys/files/source.txt/'],
			['/user1/files/source.txt', false, 'storageRoot', '/storageRoot/user1/files_encryption/keys/files/source.txt/'],
			['/user1/files/source.txt', true, 'storageRoot', '/storageRoot/files_encryption/keys/files/source.txt/'],
		];
Bjoern Schiessle's avatar
Bjoern Schiessle committed
507
508
	}

509
510
511
512
513
514
515
516
517
	public function testKeySetPreparation() {
		$this->view->expects($this->any())
			->method('file_exists')
			->willReturn(false);
		$this->view->expects($this->any())
			->method('is_dir')
			->willReturn(false);
		$this->view->expects($this->any())
			->method('mkdir')
Thomas Müller's avatar
Thomas Müller committed
518
			->will($this->returnCallback([$this, 'mkdirCallback']));
519

Thomas Müller's avatar
Thomas Müller committed
520
		$this->mkdirStack = [
521
522
523
			'/user1/files_encryption/keys/foo',
			'/user1/files_encryption/keys',
			'/user1/files_encryption',
Thomas Müller's avatar
Thomas Müller committed
524
			'/user1'];
525

Thomas Müller's avatar
Thomas Müller committed
526
		self::invokePrivate($this->storage, 'keySetPreparation', ['/user1/files_encryption/keys/foo']);
527
528
529
530
531
532
533
534
	}

	public function mkdirCallback() {
		$args = func_get_args();
		$expected = array_pop($this->mkdirStack);
		$this->assertSame($expected, $args[0]);
	}

535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
	/**
	 * @dataProvider dataTestGetFileKeyDir
	 *
	 * @param bool $isSystemWideMountPoint
	 * @param string $storageRoot
	 * @param string $expected
	 */
	public function testGetFileKeyDir($isSystemWideMountPoint, $storageRoot, $expected) {

		$path = '/user1/files/foo/bar.txt';
		$owner = 'user1';
		$relativePath = '/foo/bar.txt';

		$this->invokePrivate($this->storage, 'root_dir', [$storageRoot]);

		$this->util->expects($this->once())->method('isSystemWideMountPoint')
			->willReturn($isSystemWideMountPoint);
		$this->util->expects($this->once())->method('getUidAndFilename')
			->with($path)->willReturn([$owner, $relativePath]);

		$this->assertSame($expected,
			$this->invokePrivate($this->storage, 'getFileKeyDir', ['OC_DEFAULT_MODULE', $path])
		);

	}

	public function dataTestGetFileKeyDir() {
		return [
			[false, '', '/user1/files_encryption/keys/foo/bar.txt/OC_DEFAULT_MODULE/'],
			[true, '', '/files_encryption/keys/foo/bar.txt/OC_DEFAULT_MODULE/'],
			[false, 'newStorageRoot', '/newStorageRoot/user1/files_encryption/keys/foo/bar.txt/OC_DEFAULT_MODULE/'],
			[true, 'newStorageRoot', '/newStorageRoot/files_encryption/keys/foo/bar.txt/OC_DEFAULT_MODULE/'],
		];
	}

570
}