|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* This file is part of the tiqr project. |
|
4
|
|
|
* |
|
5
|
|
|
* The tiqr project aims to provide an open implementation for |
|
6
|
|
|
* authentication using mobile devices. It was initiated by |
|
7
|
|
|
* SURFnet and developed by Egeniq. |
|
8
|
|
|
* |
|
9
|
|
|
* More information: http://www.tiqr.org |
|
10
|
|
|
* |
|
11
|
|
|
* @author Peter Verhage <[email protected]> |
|
12
|
|
|
* |
|
13
|
|
|
* @package tiqr |
|
14
|
|
|
* |
|
15
|
|
|
* @license New BSD License - See LICENSE file for details. |
|
16
|
|
|
* |
|
17
|
|
|
* @copyright (C) 2010-2012 SURFnet BV |
|
18
|
|
|
*/ |
|
19
|
|
|
|
|
20
|
|
|
use Psr\Log\LoggerInterface; |
|
21
|
|
|
|
|
22
|
1 |
|
require_once 'Tiqr/UserSecretStorage/Encryption/Interface.php'; |
|
23
|
|
|
|
|
24
|
|
|
/** |
|
25
|
|
|
* Class implementing a factory for user storage encryption. |
|
26
|
|
|
* |
|
27
|
|
|
* @author peter |
|
28
|
|
|
*/ |
|
29
|
|
|
class Tiqr_UserStorage_Encryption |
|
30
|
|
|
{ |
|
31
|
|
|
/** |
|
32
|
|
|
* Get an encryption handler of a certain type (default: 'file') |
|
33
|
|
|
* |
|
34
|
|
|
* @param String $type The type of storage to create. Supported |
|
35
|
|
|
* types are 'dummy', 'mcrypt' or the full class name. |
|
36
|
|
|
* @param array $options The options to pass to the storage |
|
37
|
|
|
* instance. See the documentation |
|
38
|
|
|
* in the Encryption subdirectory for |
|
39
|
|
|
* options per type. |
|
40
|
|
|
* |
|
41
|
|
|
* @return Tiqr_UserStorage_Encryption_Interface |
|
|
|
|
|
|
42
|
|
|
*/ |
|
43
|
10 |
|
public static function getEncryption(LoggerInterface $logger, $type="dummy", $options=array()) |
|
44
|
|
|
{ |
|
45
|
10 |
|
$logger->info(sprintf('Using %s as UserStorage encryption type', $type)); |
|
46
|
10 |
|
switch ($type) { |
|
47
|
10 |
|
case "dummy": |
|
48
|
10 |
|
require_once("Tiqr/UserSecretStorage/Encryption/Dummy.php"); |
|
49
|
10 |
|
$instance = new Tiqr_UserSecretStorage_Encryption_Dummy($options); |
|
50
|
10 |
|
break; |
|
51
|
|
|
case "mcrypt": |
|
52
|
|
|
require_once("Tiqr/UserSecretStorage/Encryption/Mcrypt.php"); |
|
53
|
|
|
$instance = new Tiqr_UserSecretStorage_Encryption_Mcrypt($options); |
|
54
|
|
|
break; |
|
55
|
|
|
default: |
|
56
|
|
|
$instance = new $type($options); |
|
57
|
|
|
} |
|
58
|
|
|
|
|
59
|
10 |
|
return $instance; |
|
|
|
|
|
|
60
|
|
|
} |
|
61
|
|
|
} |
|
62
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths