-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathPageProtectionSettings.php
128 lines (94 loc) · 3.32 KB
/
PageProtectionSettings.php
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?php
/* This file contains setting for PageProtectionPlus */
/* You should NOT modify this file, use LocalSettings instead */
/* after reading the comments, which can tell you about names. */
require_once("LocalSettings.php");
/* The user will be allowed to use these ciphers' */
/* names when encrypting pages. */
/* For defaults (user not decided) the order has */
/* meaning. Please put most preferred ciphers at */
/* the top. It may be overriden by the variable */
/* called $wgPreferredCiphers place in the file */
/* LocalSettings.php */
$PageProtectionPreferredCiphers = array(
'rijndael-256' => true,
'blowfish' => true,
'tripledes' => true,
'saferplus' => true,
'serpent' => true,
'loki97' => true,
'cast-256' => true,
'rsa' => true,
'plaintext' => true,
);
/* Note, that each one of the ciphers will use */
/* RSA to encrypt the random key before putting */
/* it to the database. However, the 'rsa' means */
/* here, that the users are allowed to use pure */
/* RSA encryption (hard for your CPU), which */
/* will use smaller, second key called 'lite'. */
/* Enabled cryptographic engines. */
require_once("engines/CryptRSA.php");
require_once("engines/CryptBlowfish.php");
require_once("engines/Plain.php");
require_once("engines/MCrypt.php"); //this should be the last
/* RSA default key size in bits. */
$PageProtectionRSAKeySize = 2048;
/* RSA default 'lite' key size in bits. */
$PageProtectionRSALiteKeySize = 512;
/* RSA keys directory. */
/* It may be overriden by $wgPEMdir variable */
/* placed in LocalSettings.php */
$PageProtectionRSAKeyDir = "keys";
/* RSA default key filename. */
/* It may be overriden by $wgPEMfile variable */
/* placed in LocalSettings.php */
$PageProtectionRSAKeyFile = "default.pem";
/* RSA default 'lite' key filename. */
/* It may be overriden by $wgPEMlite_file */
/* variable placed in LocalSettings.php */
$PageProtectionRSALiteKeyFile = "lite.pem";
/* RSA compatible key filename. */
/* This file should contain the PEM key pair */
/* used in PageProtection version < 1.5 */
$PageProtectionRSACompatFile = "compat.pem";
/************************************************/
/* overridings.. */
/************************************************/
if (isset($wgPEMsize) && is_int($wgPEMsize)) {
$PageProtectionRSAKeySize = $wgPEMsize;
}
if (!isset($PageProtectionRSAKeySize) ||
!is_int($PageProtectionRSAKeySize) ||
$PageProtectionRSAKeySize <= 1) {
$PageProtectionRSAKeySize = 2048;
}
if (isset($wgPEMlite_size) && is_int($wgPEMlite_size)) {
$PageProtectionRSALiteKeySize = $wgPEMlite_size;
}
if (!isset($PageProtectionRSALiteKeySize) ||
!is_int($PageProtectionRSALiteKeySize)||
$PageProtectionRSALiteKeySize <= 1) {
$PageProtectionRSALiteKeySize = 256;
}
if (isset($wgPEMfile) &&
$wgPEMfile !== false &&
$wgPEMfile != '') {
$PageProtectionRSAKeyFile = $wgPEMfile;
}
if (isset($wgPEMlite_file) &&
$wgPEMlite_file !== false &&
$wgPEMlite_file != '') {
$PageProtectionRSALiteKeyFile = $wgPEMlite_file;
}
if (isset($wgPEMdir) &&
$wgPEMdir !== false &&
$wgPEMdir !== '') {
$PageProtectionRSAKeyDir = $wgPEMdir;
}
if (isset($wgPreferredCiphers) &&
$wgPreferredCiphers !== false &&
is_array($wgPreferredCiphers)) {
$PageProtectionPreferredCiphers = $wgPreferredCiphers;
}
?>