Completed
Push — development ( 8fd89f...6a24df )
by Nils
07:31
created
libraries/Authentication/TwoFactorAuth/Providers/Qr/QRicketProvider.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,11 +26,11 @@
 block discarded – undo
26 26
     {
27 27
         switch (strtolower($this->format))
28 28
         {
29
-        	case 'p':
29
+            case 'p':
30 30
                 return 'image/png';
31
-        	case 'g':
31
+            case 'g':
32 32
                 return 'image/gif';
33
-        	case 'j':
33
+            case 'j':
34 34
                 return 'image/jpeg';
35 35
         }
36 36
         throw new QRException(sprintf('Unknown MIME-type: %s', $this->format));
Please login to merge, or discard this patch.
includes/libraries/Authentication/Yubico/Yubico.php 1 patch
Indentation   +412 added lines, -412 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@  discard block
 block discarded – undo
1 1
 <?php
2
-  /**
3
-   * Class for verifying Yubico One-Time-Passcodes
4
-   *
5
-   * @category    Auth
6
-   * @package     Auth_Yubico
7
-   * @author      Simon Josefsson <[email protected]>, Olov Danielson <[email protected]>
8
-   * @copyright   2007-2015 Yubico AB
9
-   * @license     http://opensource.org/licenses/bsd-license.php New BSD License
10
-   * @version     2.0
11
-   * @link        http://www.yubico.com/
12
-   */
2
+    /**
3
+     * Class for verifying Yubico One-Time-Passcodes
4
+     *
5
+     * @category    Auth
6
+     * @package     Auth_Yubico
7
+     * @author      Simon Josefsson <[email protected]>, Olov Danielson <[email protected]>
8
+     * @copyright   2007-2015 Yubico AB
9
+     * @license     http://opensource.org/licenses/bsd-license.php New BSD License
10
+     * @version     2.0
11
+     * @link        http://www.yubico.com/
12
+     */
13 13
 
14 14
 require_once 'PEAR.php';
15 15
 
@@ -34,340 +34,340 @@  discard block
 block discarded – undo
34 34
  */
35 35
 class Auth_Yubico
36 36
 {
37
-	/**#@+
37
+    /**#@+
38 38
 	 * @access private
39 39
 	 */
40 40
 
41
-	/**
42
-	 * Yubico client ID
43
-	 * @var string
44
-	 */
45
-	var $_id;
46
-
47
-	/**
48
-	 * Yubico client key
49
-	 * @var string
50
-	 */
51
-	var $_key;
52
-
53
-	/**
54
-	 * URL part of validation server
55
-	 * @var string
56
-	 */
57
-	var $_url;
58
-
59
-	/**
60
-	 * List with URL part of validation servers
61
-	 * @var array
62
-	 */
63
-	var $_url_list;
64
-
65
-	/**
66
-	 * index to _url_list
67
-	 * @var int
68
-	 */
69
-	var $_url_index;
70
-
71
-	/**
72
-	 * Last query to server
73
-	 * @var string
74
-	 */
75
-	var $_lastquery;
76
-
77
-	/**
78
-	 * Response from server
79
-	 * @var string
80
-	 */
81
-	var $_response;
82
-
83
-	/**
84
-	 * Flag whether to use https or not.
85
-	 * @var boolean
86
-	 */
87
-	var $_https;
88
-
89
-	/**
90
-	 * Flag whether to verify HTTPS server certificates or not.
91
-	 * @var boolean
92
-	 */
93
-	var $_httpsverify;
94
-
95
-	/**
96
-	 * Constructor
97
-	 *
98
-	 * Sets up the object
99
-	 * @param    string  $id     The client identity
100
-	 * @param    string  $key    The client MAC key (optional)
101
-	 * @param    boolean $https  Flag whether to use https (optional)
102
-	 * @param    boolean $httpsverify  Flag whether to use verify HTTPS
103
-	 *                                 server certificates (optional,
104
-	 *                                 default true)
105
-	 * @access public
106
-	 */
107
-	public function __construct($id, $key = '', $https = 0, $httpsverify = 1)
108
-	{
109
-		$this->_id =  $id;
110
-		$this->_key = base64_decode($key);
111
-		$this->_https = $https;
112
-		$this->_httpsverify = $httpsverify;
113
-	}
114
-
115
-	/**
116
-	 * Specify to use a different URL part for verification.
117
-	 * The default is "api.yubico.com/wsapi/verify".
118
-	 *
119
-	 * @param  string $url  New server URL part to use
120
-	 * @access public
121
-	 */
122
-	function setURLpart($url)
123
-	{
124
-		$this->_url = $url;
125
-	}
126
-
127
-	/**
128
-	 * Get URL part to use for validation.
129
-	 *
130
-	 * @return string  Server URL part
131
-	 * @access public
132
-	 */
133
-	function getURLpart()
134
-	{
135
-		if ($this->_url) {
136
-			return $this->_url;
137
-		} else {
138
-			return "api.yubico.com/wsapi/verify";
139
-		}
140
-	}
141
-
142
-
143
-	/**
144
-	 * Get next URL part from list to use for validation.
145
-	 *
146
-	 * @return mixed string with URL part of false if no more URLs in list
147
-	 * @access public
148
-	 */
149
-	function getNextURLpart()
150
-	{
151
-	  if ($this->_url_list) $url_list=$this->_url_list;
152
-	  else $url_list=array('api.yubico.com/wsapi/2.0/verify',
153
-			       'api2.yubico.com/wsapi/2.0/verify', 
154
-			       'api3.yubico.com/wsapi/2.0/verify', 
155
-			       'api4.yubico.com/wsapi/2.0/verify',
156
-			       'api5.yubico.com/wsapi/2.0/verify');
41
+    /**
42
+     * Yubico client ID
43
+     * @var string
44
+     */
45
+    var $_id;
46
+
47
+    /**
48
+     * Yubico client key
49
+     * @var string
50
+     */
51
+    var $_key;
52
+
53
+    /**
54
+     * URL part of validation server
55
+     * @var string
56
+     */
57
+    var $_url;
58
+
59
+    /**
60
+     * List with URL part of validation servers
61
+     * @var array
62
+     */
63
+    var $_url_list;
64
+
65
+    /**
66
+     * index to _url_list
67
+     * @var int
68
+     */
69
+    var $_url_index;
70
+
71
+    /**
72
+     * Last query to server
73
+     * @var string
74
+     */
75
+    var $_lastquery;
76
+
77
+    /**
78
+     * Response from server
79
+     * @var string
80
+     */
81
+    var $_response;
82
+
83
+    /**
84
+     * Flag whether to use https or not.
85
+     * @var boolean
86
+     */
87
+    var $_https;
88
+
89
+    /**
90
+     * Flag whether to verify HTTPS server certificates or not.
91
+     * @var boolean
92
+     */
93
+    var $_httpsverify;
94
+
95
+    /**
96
+     * Constructor
97
+     *
98
+     * Sets up the object
99
+     * @param    string  $id     The client identity
100
+     * @param    string  $key    The client MAC key (optional)
101
+     * @param    boolean $https  Flag whether to use https (optional)
102
+     * @param    boolean $httpsverify  Flag whether to use verify HTTPS
103
+     *                                 server certificates (optional,
104
+     *                                 default true)
105
+     * @access public
106
+     */
107
+    public function __construct($id, $key = '', $https = 0, $httpsverify = 1)
108
+    {
109
+        $this->_id =  $id;
110
+        $this->_key = base64_decode($key);
111
+        $this->_https = $https;
112
+        $this->_httpsverify = $httpsverify;
113
+    }
114
+
115
+    /**
116
+     * Specify to use a different URL part for verification.
117
+     * The default is "api.yubico.com/wsapi/verify".
118
+     *
119
+     * @param  string $url  New server URL part to use
120
+     * @access public
121
+     */
122
+    function setURLpart($url)
123
+    {
124
+        $this->_url = $url;
125
+    }
126
+
127
+    /**
128
+     * Get URL part to use for validation.
129
+     *
130
+     * @return string  Server URL part
131
+     * @access public
132
+     */
133
+    function getURLpart()
134
+    {
135
+        if ($this->_url) {
136
+            return $this->_url;
137
+        } else {
138
+            return "api.yubico.com/wsapi/verify";
139
+        }
140
+    }
141
+
142
+
143
+    /**
144
+     * Get next URL part from list to use for validation.
145
+     *
146
+     * @return mixed string with URL part of false if no more URLs in list
147
+     * @access public
148
+     */
149
+    function getNextURLpart()
150
+    {
151
+        if ($this->_url_list) $url_list=$this->_url_list;
152
+        else $url_list=array('api.yubico.com/wsapi/2.0/verify',
153
+                    'api2.yubico.com/wsapi/2.0/verify', 
154
+                    'api3.yubico.com/wsapi/2.0/verify', 
155
+                    'api4.yubico.com/wsapi/2.0/verify',
156
+                    'api5.yubico.com/wsapi/2.0/verify');
157 157
 	  
158
-	  if ($this->_url_index>=count($url_list)) return false;
159
-	  else return $url_list[$this->_url_index++];
160
-	}
161
-
162
-	/**
163
-	 * Resets index to URL list
164
-	 *
165
-	 * @access public
166
-	 */
167
-	function URLreset()
168
-	{
169
-	  $this->_url_index=0;
170
-	}
171
-
172
-	/**
173
-	 * Add another URLpart.
174
-	 *
175
-	 * @access public
176
-	 */
177
-	function addURLpart($URLpart) 
178
-	{
179
-	  $this->_url_list[]=$URLpart;
180
-	}
158
+        if ($this->_url_index>=count($url_list)) return false;
159
+        else return $url_list[$this->_url_index++];
160
+    }
161
+
162
+    /**
163
+     * Resets index to URL list
164
+     *
165
+     * @access public
166
+     */
167
+    function URLreset()
168
+    {
169
+        $this->_url_index=0;
170
+    }
171
+
172
+    /**
173
+     * Add another URLpart.
174
+     *
175
+     * @access public
176
+     */
177
+    function addURLpart($URLpart) 
178
+    {
179
+        $this->_url_list[]=$URLpart;
180
+    }
181 181
 	
182
-	/**
183
-	 * Return the last query sent to the server, if any.
184
-	 *
185
-	 * @return string  Request to server
186
-	 * @access public
187
-	 */
188
-	function getLastQuery()
189
-	{
190
-		return $this->_lastquery;
191
-	}
192
-
193
-	/**
194
-	 * Return the last data received from the server, if any.
195
-	 *
196
-	 * @return string  Output from server
197
-	 * @access public
198
-	 */
199
-	function getLastResponse()
200
-	{
201
-		return $this->_response;
202
-	}
203
-
204
-	/**
205
-	 * Parse input string into password, yubikey prefix,
206
-	 * ciphertext, and OTP.
207
-	 *
208
-	 * @param  string    Input string to parse
209
-	 * @param  string    Optional delimiter re-class, default is '[:]'
210
-	 * @return array     Keyed array with fields
211
-	 * @access public
212
-	 */
213
-	function parsePasswordOTP($str, $delim = '[:]')
214
-	{
215
-	  if (!preg_match("/^((.*)" . $delim . ")?" .
216
-			  "(([cbdefghijklnrtuv]{0,16})" .
217
-			  "([cbdefghijklnrtuv]{32}))$/i",
218
-			  $str, $matches)) {
219
-	    /* Dvorak? */
220
-	    if (!preg_match("/^((.*)" . $delim . ")?" .
221
-			    "(([jxe\.uidchtnbpygk]{0,16})" .
222
-			    "([jxe\.uidchtnbpygk]{32}))$/i",
223
-			    $str, $matches)) {
224
-	      return false;
225
-	    } else {
226
-	      $ret['otp'] = strtr($matches[3], "jxe.uidchtnbpygk", "cbdefghijklnrtuv");
227
-	    }
228
-	  } else {
229
-	    $ret['otp'] = $matches[3];
230
-	  }
231
-	  $ret['password'] = $matches[2];
232
-	  $ret['prefix'] = $matches[4];
233
-	  $ret['ciphertext'] = $matches[5];
234
-	  return $ret;
235
-	}
236
-
237
-	/* TODO? Add functions to get parsed parts of server response? */
238
-
239
-	/**
240
-	 * Parse parameters from last response
241
-	 *
242
-	 * example: getParameters("timestamp", "sessioncounter", "sessionuse");
243
-	 *
244
-	 * @param  array @parameters  Array with strings representing
245
-	 *                            parameters to parse
246
-	 * @return array  parameter array from last response
247
-	 * @access public
248
-	 */
249
-	function getParameters($parameters)
250
-	{
251
-	  if ($parameters == null) {
252
-	    $parameters = array('timestamp', 'sessioncounter', 'sessionuse');
253
-	  }
254
-	  $param_array = array();
255
-	  foreach ($parameters as $param) {
256
-	    if(!preg_match("/" . $param . "=([0-9]+)/", $this->_response, $out)) {
257
-	      return PEAR::raiseError('Could not parse parameter ' . $param . ' from response');
258
-	    }
259
-	    $param_array[$param]=$out[1];
260
-	  }
261
-	  return $param_array;
262
-	}
263
-
264
-	/**
265
-	 * Verify Yubico OTP against multiple URLs
266
-	 * Protocol specification 2.0 is used to construct validation requests
267
-	 *
268
-	 * @param string $token        Yubico OTP
269
-	 * @param int $use_timestamp   1=>send request with &timestamp=1 to
270
-	 *                             get timestamp and session information
271
-	 *                             in the response
272
-	 * @param boolean $wait_for_all  If true, wait until all
273
-	 *                               servers responds (for debugging)
274
-	 * @param string $sl           Sync level in percentage between 0
275
-	 *                             and 100 or "fast" or "secure".
276
-	 * @param int $timeout         Max number of seconds to wait
277
-	 *                             for responses
278
-	 * @return mixed               PEAR error on error, true otherwise
279
-	 * @access public
280
-	 */
281
-	function verify($token, $use_timestamp=null, $wait_for_all=False,
282
-			$sl=null, $timeout=null)
283
-	{
284
-	  /* Construct parameters string */
285
-	  $ret = $this->parsePasswordOTP($token);
286
-	  if (!$ret) {
287
-	    return PEAR::raiseError('Could not parse Yubikey OTP');
288
-	  }
289
-	  $params = array('id'=>$this->_id, 
290
-			  'otp'=>$ret['otp'],
291
-			  'nonce'=>md5(uniqid(rand())));
292
-	  /* Take care of protocol version 2 parameters */
293
-	  if ($use_timestamp) $params['timestamp'] = 1;
294
-	  if ($sl) $params['sl'] = $sl;
295
-	  if ($timeout) $params['timeout'] = $timeout;
296
-	  ksort($params);
297
-	  $parameters = '';
298
-	  foreach($params as $p=>$v) $parameters .= "&" . $p . "=" . $v;
299
-	  $parameters = ltrim($parameters, "&");
182
+    /**
183
+     * Return the last query sent to the server, if any.
184
+     *
185
+     * @return string  Request to server
186
+     * @access public
187
+     */
188
+    function getLastQuery()
189
+    {
190
+        return $this->_lastquery;
191
+    }
192
+
193
+    /**
194
+     * Return the last data received from the server, if any.
195
+     *
196
+     * @return string  Output from server
197
+     * @access public
198
+     */
199
+    function getLastResponse()
200
+    {
201
+        return $this->_response;
202
+    }
203
+
204
+    /**
205
+     * Parse input string into password, yubikey prefix,
206
+     * ciphertext, and OTP.
207
+     *
208
+     * @param  string    Input string to parse
209
+     * @param  string    Optional delimiter re-class, default is '[:]'
210
+     * @return array     Keyed array with fields
211
+     * @access public
212
+     */
213
+    function parsePasswordOTP($str, $delim = '[:]')
214
+    {
215
+        if (!preg_match("/^((.*)" . $delim . ")?" .
216
+                "(([cbdefghijklnrtuv]{0,16})" .
217
+                "([cbdefghijklnrtuv]{32}))$/i",
218
+                $str, $matches)) {
219
+        /* Dvorak? */
220
+        if (!preg_match("/^((.*)" . $delim . ")?" .
221
+                "(([jxe\.uidchtnbpygk]{0,16})" .
222
+                "([jxe\.uidchtnbpygk]{32}))$/i",
223
+                $str, $matches)) {
224
+            return false;
225
+        } else {
226
+            $ret['otp'] = strtr($matches[3], "jxe.uidchtnbpygk", "cbdefghijklnrtuv");
227
+        }
228
+        } else {
229
+        $ret['otp'] = $matches[3];
230
+        }
231
+        $ret['password'] = $matches[2];
232
+        $ret['prefix'] = $matches[4];
233
+        $ret['ciphertext'] = $matches[5];
234
+        return $ret;
235
+    }
236
+
237
+    /* TODO? Add functions to get parsed parts of server response? */
238
+
239
+    /**
240
+     * Parse parameters from last response
241
+     *
242
+     * example: getParameters("timestamp", "sessioncounter", "sessionuse");
243
+     *
244
+     * @param  array @parameters  Array with strings representing
245
+     *                            parameters to parse
246
+     * @return array  parameter array from last response
247
+     * @access public
248
+     */
249
+    function getParameters($parameters)
250
+    {
251
+        if ($parameters == null) {
252
+        $parameters = array('timestamp', 'sessioncounter', 'sessionuse');
253
+        }
254
+        $param_array = array();
255
+        foreach ($parameters as $param) {
256
+        if(!preg_match("/" . $param . "=([0-9]+)/", $this->_response, $out)) {
257
+            return PEAR::raiseError('Could not parse parameter ' . $param . ' from response');
258
+        }
259
+        $param_array[$param]=$out[1];
260
+        }
261
+        return $param_array;
262
+    }
263
+
264
+    /**
265
+     * Verify Yubico OTP against multiple URLs
266
+     * Protocol specification 2.0 is used to construct validation requests
267
+     *
268
+     * @param string $token        Yubico OTP
269
+     * @param int $use_timestamp   1=>send request with &timestamp=1 to
270
+     *                             get timestamp and session information
271
+     *                             in the response
272
+     * @param boolean $wait_for_all  If true, wait until all
273
+     *                               servers responds (for debugging)
274
+     * @param string $sl           Sync level in percentage between 0
275
+     *                             and 100 or "fast" or "secure".
276
+     * @param int $timeout         Max number of seconds to wait
277
+     *                             for responses
278
+     * @return mixed               PEAR error on error, true otherwise
279
+     * @access public
280
+     */
281
+    function verify($token, $use_timestamp=null, $wait_for_all=False,
282
+            $sl=null, $timeout=null)
283
+    {
284
+        /* Construct parameters string */
285
+        $ret = $this->parsePasswordOTP($token);
286
+        if (!$ret) {
287
+        return PEAR::raiseError('Could not parse Yubikey OTP');
288
+        }
289
+        $params = array('id'=>$this->_id, 
290
+                'otp'=>$ret['otp'],
291
+                'nonce'=>md5(uniqid(rand())));
292
+        /* Take care of protocol version 2 parameters */
293
+        if ($use_timestamp) $params['timestamp'] = 1;
294
+        if ($sl) $params['sl'] = $sl;
295
+        if ($timeout) $params['timeout'] = $timeout;
296
+        ksort($params);
297
+        $parameters = '';
298
+        foreach($params as $p=>$v) $parameters .= "&" . $p . "=" . $v;
299
+        $parameters = ltrim($parameters, "&");
300 300
 	  
301
-	  /* Generate signature. */
302
-	  if($this->_key <> "") {
303
-	    $signature = base64_encode(hash_hmac('sha1', $parameters,
304
-						 $this->_key, true));
305
-	    $signature = preg_replace('/\+/', '%2B', $signature);
306
-	    $parameters .= '&h=' . $signature;
307
-	  }
308
-
309
-	  /* Generate and prepare request. */
310
-	  $this->_lastquery=null;
311
-	  $this->URLreset();
312
-	  $mh = curl_multi_init();
313
-	  $ch = array();
314
-	  while($URLpart=$this->getNextURLpart()) 
315
-	    {
316
-	      /* Support https. */
317
-	      if ($this->_https) {
318
-		$query = "https://";
319
-	      } else {
320
-		$query = "http://";
321
-	      }
322
-	      $query .= $URLpart . "?" . $parameters;
323
-
324
-	      if ($this->_lastquery) { $this->_lastquery .= " "; }
325
-	      $this->_lastquery .= $query;
301
+        /* Generate signature. */
302
+        if($this->_key <> "") {
303
+        $signature = base64_encode(hash_hmac('sha1', $parameters,
304
+                            $this->_key, true));
305
+        $signature = preg_replace('/\+/', '%2B', $signature);
306
+        $parameters .= '&h=' . $signature;
307
+        }
308
+
309
+        /* Generate and prepare request. */
310
+        $this->_lastquery=null;
311
+        $this->URLreset();
312
+        $mh = curl_multi_init();
313
+        $ch = array();
314
+        while($URLpart=$this->getNextURLpart()) 
315
+        {
316
+            /* Support https. */
317
+            if ($this->_https) {
318
+        $query = "https://";
319
+            } else {
320
+        $query = "http://";
321
+            }
322
+            $query .= $URLpart . "?" . $parameters;
323
+
324
+            if ($this->_lastquery) { $this->_lastquery .= " "; }
325
+            $this->_lastquery .= $query;
326 326
 	      
327
-	      $handle = curl_init($query);
328
-	      curl_setopt($handle, CURLOPT_USERAGENT, "PEAR Auth_Yubico");
329
-	      curl_setopt($handle, CURLOPT_RETURNTRANSFER, 1);
330
-	      if (!$this->_httpsverify) {
331
-		curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, 0);
332
-		curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, 0);
333
-	      }
334
-	      curl_setopt($handle, CURLOPT_FAILONERROR, true);
335
-	      /* If timeout is set, we better apply it here as well
327
+            $handle = curl_init($query);
328
+            curl_setopt($handle, CURLOPT_USERAGENT, "PEAR Auth_Yubico");
329
+            curl_setopt($handle, CURLOPT_RETURNTRANSFER, 1);
330
+            if (!$this->_httpsverify) {
331
+        curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, 0);
332
+        curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, 0);
333
+            }
334
+            curl_setopt($handle, CURLOPT_FAILONERROR, true);
335
+            /* If timeout is set, we better apply it here as well
336 336
 	         in case the validation server fails to follow it. 
337 337
 	      */ 
338
-	      if ($timeout) curl_setopt($handle, CURLOPT_TIMEOUT, $timeout);
339
-	      curl_multi_add_handle($mh, $handle);
338
+            if ($timeout) curl_setopt($handle, CURLOPT_TIMEOUT, $timeout);
339
+            curl_multi_add_handle($mh, $handle);
340 340
 	      
341
-	      $ch[(int)$handle] = $handle;
342
-	    }
343
-
344
-	  /* Execute and read request. */
345
-	  $this->_response=null;
346
-	  $replay=False;
347
-	  $valid=False;
348
-	  do {
349
-	    /* Let curl do its work. */
350
-	    while (($mrc = curl_multi_exec($mh, $active))
351
-		   == CURLM_CALL_MULTI_PERFORM)
352
-	      ;
353
-
354
-	    while ($info = curl_multi_info_read($mh)) {
355
-	      if ($info['result'] == CURLE_OK) {
356
-
357
-		/* We have a complete response from one server. */
358
-
359
-		$str = curl_multi_getcontent($info['handle']);
360
-		$cinfo = curl_getinfo ($info['handle']);
341
+            $ch[(int)$handle] = $handle;
342
+        }
343
+
344
+        /* Execute and read request. */
345
+        $this->_response=null;
346
+        $replay=False;
347
+        $valid=False;
348
+        do {
349
+        /* Let curl do its work. */
350
+        while (($mrc = curl_multi_exec($mh, $active))
351
+            == CURLM_CALL_MULTI_PERFORM)
352
+            ;
353
+
354
+        while ($info = curl_multi_info_read($mh)) {
355
+            if ($info['result'] == CURLE_OK) {
356
+
357
+        /* We have a complete response from one server. */
358
+
359
+        $str = curl_multi_getcontent($info['handle']);
360
+        $cinfo = curl_getinfo ($info['handle']);
361 361
 		
362
-		if ($wait_for_all) { # Better debug info
363
-		  $this->_response .= 'URL=' . $cinfo['url'] ."\n"
364
-		    . $str . "\n";
365
-		}
362
+        if ($wait_for_all) { # Better debug info
363
+            $this->_response .= 'URL=' . $cinfo['url'] ."\n"
364
+            . $str . "\n";
365
+        }
366 366
 
367
-		if (preg_match("/status=([a-zA-Z0-9_]+)/", $str, $out)) {
368
-		  $status = $out[1];
367
+        if (preg_match("/status=([a-zA-Z0-9_]+)/", $str, $out)) {
368
+            $status = $out[1];
369 369
 
370
-		  /* 
370
+            /* 
371 371
 		   * There are 3 cases.
372 372
 		   *
373 373
 		   * 1. OTP or Nonce values doesn't match - ignore
@@ -379,92 +379,92 @@  discard block
 block discarded – undo
379 379
 		   *
380 380
 		   * 3. Return if status=OK or status=REPLAYED_OTP.
381 381
 		   */
382
-		  if (!preg_match("/otp=".$params['otp']."/", $str) ||
383
-		      !preg_match("/nonce=".$params['nonce']."/", $str)) {
384
-		    /* Case 1. Ignore response. */
385
-		  } 
386
-		  elseif ($this->_key <> "") {
387
-		    /* Case 2. Verify signature first */
388
-		    $rows = explode("\r\n", trim($str));
389
-		    $response=array();
390
-		    while (list($key, $val) = each($rows)) {
391
-		      /* = is also used in BASE64 encoding so we only replace the first = by # which is not used in BASE64 */
392
-		      $val = preg_replace('/=/', '#', $val, 1);
393
-		      $row = explode("#", $val);
394
-		      $response[$row[0]] = $row[1];
395
-		    }
382
+            if (!preg_match("/otp=".$params['otp']."/", $str) ||
383
+              !preg_match("/nonce=".$params['nonce']."/", $str)) {
384
+            /* Case 1. Ignore response. */
385
+            } 
386
+            elseif ($this->_key <> "") {
387
+            /* Case 2. Verify signature first */
388
+            $rows = explode("\r\n", trim($str));
389
+            $response=array();
390
+            while (list($key, $val) = each($rows)) {
391
+                /* = is also used in BASE64 encoding so we only replace the first = by # which is not used in BASE64 */
392
+                $val = preg_replace('/=/', '#', $val, 1);
393
+                $row = explode("#", $val);
394
+                $response[$row[0]] = $row[1];
395
+            }
396 396
 		    
397
-		    $parameters=array('nonce','otp', 'sessioncounter', 'sessionuse', 'sl', 'status', 't', 'timeout', 'timestamp');
398
-		    sort($parameters);
399
-		    $check=Null;
400
-		    foreach ($parameters as $param) {
401
-		      if (array_key_exists($param, $response)) {
402
-			if ($check) $check = $check . '&';
403
-			$check = $check . $param . '=' . $response[$param];
404
-		      }
405
-		    }
406
-
407
-		    $checksignature =
408
-		      base64_encode(hash_hmac('sha1', utf8_encode($check),
409
-					      $this->_key, true));
410
-
411
-		    if($response['h'] == $checksignature) {
412
-		      if ($status == 'REPLAYED_OTP') {
413
-			if (!$wait_for_all) { $this->_response = $str; }
414
-			$replay=True;
415
-		      } 
416
-		      if ($status == 'OK') {
417
-			if (!$wait_for_all) { $this->_response = $str; }
418
-			$valid=True;
419
-		      }
420
-		    }
421
-		  } else {
422
-		    /* Case 3. We check the status directly */
423
-		    if ($status == 'REPLAYED_OTP') {
424
-		      if (!$wait_for_all) { $this->_response = $str; }
425
-		      $replay=True;
426
-		    } 
427
-		    if ($status == 'OK') {
428
-		      if (!$wait_for_all) { $this->_response = $str; }
429
-		      $valid=True;
430
-		    }
431
-		  }
432
-		}
433
-		if (!$wait_for_all && ($valid || $replay)) 
434
-		  {
435
-		    /* We have status=OK or status=REPLAYED_OTP, return. */
436
-		    foreach ($ch as $h) {
437
-		      curl_multi_remove_handle($mh, $h);
438
-		      curl_close($h);
439
-		    }
440
-		    curl_multi_close($mh);
441
-		    if ($replay) return PEAR::raiseError('REPLAYED_OTP');
442
-		    if ($valid) return true;
443
-		    return PEAR::raiseError($status);
444
-		  }
397
+            $parameters=array('nonce','otp', 'sessioncounter', 'sessionuse', 'sl', 'status', 't', 'timeout', 'timestamp');
398
+            sort($parameters);
399
+            $check=Null;
400
+            foreach ($parameters as $param) {
401
+                if (array_key_exists($param, $response)) {
402
+            if ($check) $check = $check . '&';
403
+            $check = $check . $param . '=' . $response[$param];
404
+                }
405
+            }
406
+
407
+            $checksignature =
408
+                base64_encode(hash_hmac('sha1', utf8_encode($check),
409
+                            $this->_key, true));
410
+
411
+            if($response['h'] == $checksignature) {
412
+                if ($status == 'REPLAYED_OTP') {
413
+            if (!$wait_for_all) { $this->_response = $str; }
414
+            $replay=True;
415
+                } 
416
+                if ($status == 'OK') {
417
+            if (!$wait_for_all) { $this->_response = $str; }
418
+            $valid=True;
419
+                }
420
+            }
421
+            } else {
422
+            /* Case 3. We check the status directly */
423
+            if ($status == 'REPLAYED_OTP') {
424
+                if (!$wait_for_all) { $this->_response = $str; }
425
+                $replay=True;
426
+            } 
427
+            if ($status == 'OK') {
428
+                if (!$wait_for_all) { $this->_response = $str; }
429
+                $valid=True;
430
+            }
431
+            }
432
+        }
433
+        if (!$wait_for_all && ($valid || $replay)) 
434
+            {
435
+            /* We have status=OK or status=REPLAYED_OTP, return. */
436
+            foreach ($ch as $h) {
437
+                curl_multi_remove_handle($mh, $h);
438
+                curl_close($h);
439
+            }
440
+            curl_multi_close($mh);
441
+            if ($replay) return PEAR::raiseError('REPLAYED_OTP');
442
+            if ($valid) return true;
443
+            return PEAR::raiseError($status);
444
+            }
445 445
 		
446
-		curl_multi_remove_handle($mh, $info['handle']);
447
-		curl_close($info['handle']);
448
-		unset ($ch[(int)$info['handle']]);
449
-	      }
450
-	      curl_multi_select($mh);
451
-	    }
452
-	  } while ($active);
453
-
454
-	  /* Typically this is only reached for wait_for_all=true or
446
+        curl_multi_remove_handle($mh, $info['handle']);
447
+        curl_close($info['handle']);
448
+        unset ($ch[(int)$info['handle']]);
449
+            }
450
+            curl_multi_select($mh);
451
+        }
452
+        } while ($active);
453
+
454
+        /* Typically this is only reached for wait_for_all=true or
455 455
 	   * when the timeout is reached and there is no
456 456
 	   * OK/REPLAYED_REQUEST answer (think firewall).
457 457
 	   */
458 458
 
459
-	  foreach ($ch as $h) {
460
-	    curl_multi_remove_handle ($mh, $h);
461
-	    curl_close ($h);
462
-	  }
463
-	  curl_multi_close ($mh);
459
+        foreach ($ch as $h) {
460
+        curl_multi_remove_handle ($mh, $h);
461
+        curl_close ($h);
462
+        }
463
+        curl_multi_close ($mh);
464 464
 	  
465
-	  if ($replay) return PEAR::raiseError('REPLAYED_OTP');
466
-	  if ($valid) return true;
467
-	  return PEAR::raiseError('NO_VALID_ANSWER');
468
-	}
465
+        if ($replay) return PEAR::raiseError('REPLAYED_OTP');
466
+        if ($valid) return true;
467
+        return PEAR::raiseError('NO_VALID_ANSWER');
468
+    }
469 469
 }
470 470
 ?>
Please login to merge, or discard this patch.
includes/libraries/Authentication/agses/axs/AXSErrorcodes.inc.php 1 patch
Indentation   +380 added lines, -380 removed lines patch added patch discarded remove patch
@@ -2,448 +2,448 @@
 block discarded – undo
2 2
 
3 3
 class AXSErrorcodes {
4 4
 	
5
-	// Global Integer Return Values used in all methods that return Integers
6
-	// and are called from the outside world (webservices, etc.)
7
-	// List of returnvalue ranges:
8
-	// x	> 0			: Positive Result (true with more infos (depending on application)
9
-	// x	== 0		: Default FALSE
10
-	// x	< 0			: Negative Result (normally false, but with more infos)
11
-	// x	== -100		: No Active Message found
12
-	// x	== -1000	: Internal Server Error, see server log for details (should not happen)
13
-	// x	< -1000		: ERROR values
14
-	
15
-	/**
16
-	 * Extract the error code contained in an ERROR string and return the code
17
-	 * @param message ERROR String received from AXS web service
18
-	 * @return error code found in ERROR message or -10000 if no error code could be found
19
-	 */
20
-	function getErrorcode($message) {
21
-		$errorcode = -10000;
22
-		if (($begin = strpos($message, "ERROR (")) === FALSE)
23
-			$begin = -1;
24
-		if (($end = strpos($message, ")")) === FALSE)
25
-			$end = -1;
5
+    // Global Integer Return Values used in all methods that return Integers
6
+    // and are called from the outside world (webservices, etc.)
7
+    // List of returnvalue ranges:
8
+    // x	> 0			: Positive Result (true with more infos (depending on application)
9
+    // x	== 0		: Default FALSE
10
+    // x	< 0			: Negative Result (normally false, but with more infos)
11
+    // x	== -100		: No Active Message found
12
+    // x	== -1000	: Internal Server Error, see server log for details (should not happen)
13
+    // x	< -1000		: ERROR values
14
+	
15
+    /**
16
+     * Extract the error code contained in an ERROR string and return the code
17
+     * @param message ERROR String received from AXS web service
18
+     * @return error code found in ERROR message or -10000 if no error code could be found
19
+     */
20
+    function getErrorcode($message) {
21
+        $errorcode = -10000;
22
+        if (($begin = strpos($message, "ERROR (")) === FALSE)
23
+            $begin = -1;
24
+        if (($end = strpos($message, ")")) === FALSE)
25
+            $end = -1;
26 26
 		
27
-		if ($begin >= 0 && $end >= 0) {
28
-			$realBegin = $begin + 7;
29
-			$errorcode = substr($message, $realBegin, $end - $realBegin);
30
-		}
31
-		return $errorcode;
32
-	}
27
+        if ($begin >= 0 && $end >= 0) {
28
+            $realBegin = $begin + 7;
29
+            $errorcode = substr($message, $realBegin, $end - $realBegin);
30
+        }
31
+        return $errorcode;
32
+    }
33 33
 
34
-	/*
34
+    /*
35 35
 	 * Reserved errors
36 36
 	 */
37
-	const RETURN_VALUE_DEFAULT_FALSE = 0;
37
+    const RETURN_VALUE_DEFAULT_FALSE = 0;
38 38
 
39
-	const ERROR_HEDGEID_WRONG = -1;
40
-	const ERROR_RESPONSE_NOT_VALID_ANYMORE = -2;
41
-	const ERROR_RESPONSE_VERFICATION_FAILED_MORE_TRY_LEFT = -3;
42
-	const ERROR_RESPONSE_MAX_TRIES_REACHED = -4;
43
-	
44
-	const ERROR_RESPONSE_WITHOUT_MESSAGE = -100;
45
-	const ERROR_RESPONSE_NULL = -101;
46
-	const ERROR_HEDGEID_NULL = -102;
47
-	const ERROR_RESPONSE_EMPTY = -103;
48
-	const ERROR_HEDGEID_EMPTY = -104;
49
-	
50
-	/*
39
+    const ERROR_HEDGEID_WRONG = -1;
40
+    const ERROR_RESPONSE_NOT_VALID_ANYMORE = -2;
41
+    const ERROR_RESPONSE_VERFICATION_FAILED_MORE_TRY_LEFT = -3;
42
+    const ERROR_RESPONSE_MAX_TRIES_REACHED = -4;
43
+	
44
+    const ERROR_RESPONSE_WITHOUT_MESSAGE = -100;
45
+    const ERROR_RESPONSE_NULL = -101;
46
+    const ERROR_HEDGEID_NULL = -102;
47
+    const ERROR_RESPONSE_EMPTY = -103;
48
+    const ERROR_HEDGEID_EMPTY = -104;
49
+	
50
+    /*
51 51
 	 * Token errors (-1001 to -1099)
52 52
 	 */
53
-	const ERROR_TOKEN_NOT_FOUND = -1001;
54
-	const ERROR_TOKEN_LOCKED = -1002;
55
-	const ERROR_TOKEN_DOES_NOT_SUPPORT_APPLICATION = -1003;
56
-	const ERROR_TOKEN_EXPORT = -1004;
57
-	const ERROR_TOKEN_REMOVE = -1005;
58
-	const ERROR_TOKEN_READY_FOR_PRODUCTIONLOT_NOT_FOUND = -1006;
59
-	const ERROR_TOKEN_NOT_IN_PRODUCTION_STATE = -1007;
60
-	const ERROR_TOKEN_TYPE_NOT_FOUND = -1008;
61
-	const ERROR_TOKEN_WRONG_STATE = -1009;
62
-	const ERROR_TOKEN_BRLC_NOT_FOUND = -1010;
63
-	const ERROR_TOKEN_ASSIGN_SAME_SERIAL_NUMBER_TO_OTHER_TOKEN = -1011;
64
-	const ERROR_TOKEN_SERIAL_NUMBER_ALREADY_ASSIGNED = -1012;
65
-	const ERROR_TOKEN_UNLOCK_COUNTER_MAXIMUM_REACHED = -1013;
66
-	const ERROR_TOKEN_REVOKED = -1014;
67
-	const ERROR_TOKEN_DOES_NOT_SUPPORT_BRANDING = -1015;
68
-	const ERROR_TOKEN_TO_DELETE_IN_WRONG_STATE = -1016;
69
-	
70
-	const ERROR_DR_TOKENENTITY_NOT_FOUND = -1025;
71
-	
72
-	// ERROR if the token could not be found on the local server
73
-	// (automatic key fetching not enabled)
74
-	const ERROR_TOKEN_NOT_FOUND_NO_KEYFETCHING = -1051;
75
-	const ERROR_TOKEN_NOT_FOUND_KEYFETCHING_TEMPORARY_NOT_AVAILABLE = -1052;
76
-	
77
-	/*
53
+    const ERROR_TOKEN_NOT_FOUND = -1001;
54
+    const ERROR_TOKEN_LOCKED = -1002;
55
+    const ERROR_TOKEN_DOES_NOT_SUPPORT_APPLICATION = -1003;
56
+    const ERROR_TOKEN_EXPORT = -1004;
57
+    const ERROR_TOKEN_REMOVE = -1005;
58
+    const ERROR_TOKEN_READY_FOR_PRODUCTIONLOT_NOT_FOUND = -1006;
59
+    const ERROR_TOKEN_NOT_IN_PRODUCTION_STATE = -1007;
60
+    const ERROR_TOKEN_TYPE_NOT_FOUND = -1008;
61
+    const ERROR_TOKEN_WRONG_STATE = -1009;
62
+    const ERROR_TOKEN_BRLC_NOT_FOUND = -1010;
63
+    const ERROR_TOKEN_ASSIGN_SAME_SERIAL_NUMBER_TO_OTHER_TOKEN = -1011;
64
+    const ERROR_TOKEN_SERIAL_NUMBER_ALREADY_ASSIGNED = -1012;
65
+    const ERROR_TOKEN_UNLOCK_COUNTER_MAXIMUM_REACHED = -1013;
66
+    const ERROR_TOKEN_REVOKED = -1014;
67
+    const ERROR_TOKEN_DOES_NOT_SUPPORT_BRANDING = -1015;
68
+    const ERROR_TOKEN_TO_DELETE_IN_WRONG_STATE = -1016;
69
+	
70
+    const ERROR_DR_TOKENENTITY_NOT_FOUND = -1025;
71
+	
72
+    // ERROR if the token could not be found on the local server
73
+    // (automatic key fetching not enabled)
74
+    const ERROR_TOKEN_NOT_FOUND_NO_KEYFETCHING = -1051;
75
+    const ERROR_TOKEN_NOT_FOUND_KEYFETCHING_TEMPORARY_NOT_AVAILABLE = -1052;
76
+	
77
+    /*
78 78
 	 * Key errors (-1100 to -1199)
79 79
 	 */
80
-	const ERROR_KEY_NOT_FOUND = -1100;
81
-	const ERROR_NO_UNASSIGNED_KEY_FOUND = -1101;
82
-	const ERROR_ISSUER_KEY_NOT_FOUND = -1102;
83
-	const ERROR_KEY_NOT_UPDATED = -1103;
84
-	/* removed 2008-11-13 - smm	
80
+    const ERROR_KEY_NOT_FOUND = -1100;
81
+    const ERROR_NO_UNASSIGNED_KEY_FOUND = -1101;
82
+    const ERROR_ISSUER_KEY_NOT_FOUND = -1102;
83
+    const ERROR_KEY_NOT_UPDATED = -1103;
84
+    /* removed 2008-11-13 - smm	
85 85
 	 * The error does not occur anymore
86 86
 	 * const ERROR_KEY_FOR_KEYLOADING_NOT_CREATED = -1104;
87 87
 	 */
88
-	const ERROR_REEXPORT_KEYS_ON_NORMAL_AXS_AS = -1105;
89
-	const ERROR_NUMBER_OF_KEYS_OUT_OF_BOUNDS = -1106;
90
-	const ERROR_COULD_NOT_FIND_NUMBER_OF_KEYS = -1107;
91
-	const ERROR_CANNOT_ASSIGN_AXS_EXCLUSIVE_KEY_TO_AA = -1108;
92
-	const ERROR_TEMPORARY_KEY_NOT_CALCULATED = -1109;
93
-	const ERROR_SM_NOT_AUTHORIZED_TO_RECEIVE_FMS_KEY = -1110;
94
-	const ERROR_NOT_AUTHORIZED_TO_DELETE_KEY = -1111;
95
-	const ERROR_CANNOT_FORCE_KEY_DELETION = -1112;
96
-	// the key is locked, introduced in V2.20.00
97
-	const ERROR_KEY_LOCKED = -1113;
98
-	// non-expiring key errors, introduced in V2.20.00
99
-	const ERROR_NON_EXPIRING_KEY_NOT_FOUND = -1114;
100
-	const ERROR_NON_EXPIRING_KEY_NOT_READY_TWO_ADDITIONAL_AUTHENTICATIONS_NEEDED = -1115;
101
-	const ERROR_NON_EXPIRING_KEY_NOT_READY_ONE_ADDITIONAL_AUTHENTICATION_NEEDED = -1116;
102
-	
103
-	// ERROR if no free key is available on the local server and
104
-	// the automatic key fetching is not enabled
105
-	const ERROR_NO_UNASSIGNED_KEY_FOUND_NO_KEYFETCHING = -1151;
106
-	const ERROR_KEY_NOT_FOUND_KEYFETCHING_TEMPORARY_NOT_AVAILABLE = -1152;
107
-	
108
-	
109
-	/*
88
+    const ERROR_REEXPORT_KEYS_ON_NORMAL_AXS_AS = -1105;
89
+    const ERROR_NUMBER_OF_KEYS_OUT_OF_BOUNDS = -1106;
90
+    const ERROR_COULD_NOT_FIND_NUMBER_OF_KEYS = -1107;
91
+    const ERROR_CANNOT_ASSIGN_AXS_EXCLUSIVE_KEY_TO_AA = -1108;
92
+    const ERROR_TEMPORARY_KEY_NOT_CALCULATED = -1109;
93
+    const ERROR_SM_NOT_AUTHORIZED_TO_RECEIVE_FMS_KEY = -1110;
94
+    const ERROR_NOT_AUTHORIZED_TO_DELETE_KEY = -1111;
95
+    const ERROR_CANNOT_FORCE_KEY_DELETION = -1112;
96
+    // the key is locked, introduced in V2.20.00
97
+    const ERROR_KEY_LOCKED = -1113;
98
+    // non-expiring key errors, introduced in V2.20.00
99
+    const ERROR_NON_EXPIRING_KEY_NOT_FOUND = -1114;
100
+    const ERROR_NON_EXPIRING_KEY_NOT_READY_TWO_ADDITIONAL_AUTHENTICATIONS_NEEDED = -1115;
101
+    const ERROR_NON_EXPIRING_KEY_NOT_READY_ONE_ADDITIONAL_AUTHENTICATION_NEEDED = -1116;
102
+	
103
+    // ERROR if no free key is available on the local server and
104
+    // the automatic key fetching is not enabled
105
+    const ERROR_NO_UNASSIGNED_KEY_FOUND_NO_KEYFETCHING = -1151;
106
+    const ERROR_KEY_NOT_FOUND_KEYFETCHING_TEMPORARY_NOT_AVAILABLE = -1152;
107
+	
108
+	
109
+    /*
110 110
 	 * Firmware errors (-1200 to -1299)
111 111
 	 */
112
-	const ERROR_FW_NOT_FOUND = -1200;
113
-	const ERROR_FW_SUCCESSOR_NOT_FOUND = -1201;
114
-	const ERROR_FW_INITIAL_KEY_NOT_FOUND = -1202;
115
-	const ERROR_FW_INITIAL_KEY_NOT_HEX = -1203;
116
-	const ERROR_FW_INITIAL_KEY_INCORRECT_LENGTH = -1204;
117
-	const ERROR_FW_ACTUAL_VERSION_NULL = -1205;
118
-	const ERROR_FW_ACTUAL_VERSION_EMPTY = -1206;
119
-	const ERROR_FW_VERSION_NOT_VALID = -1207;
120
-	const ERROR_FW_ENCRYPTED_FIRMWARE_URL_NOT_SET = -1208;
121
-	const ERROR_FW_ANCESTOR_ALREADY_HAS_SUCCESSOR = -1209;
122
-	const ERROR_FW_UPDATE_SEED_NOT_SET = -1210;
112
+    const ERROR_FW_NOT_FOUND = -1200;
113
+    const ERROR_FW_SUCCESSOR_NOT_FOUND = -1201;
114
+    const ERROR_FW_INITIAL_KEY_NOT_FOUND = -1202;
115
+    const ERROR_FW_INITIAL_KEY_NOT_HEX = -1203;
116
+    const ERROR_FW_INITIAL_KEY_INCORRECT_LENGTH = -1204;
117
+    const ERROR_FW_ACTUAL_VERSION_NULL = -1205;
118
+    const ERROR_FW_ACTUAL_VERSION_EMPTY = -1206;
119
+    const ERROR_FW_VERSION_NOT_VALID = -1207;
120
+    const ERROR_FW_ENCRYPTED_FIRMWARE_URL_NOT_SET = -1208;
121
+    const ERROR_FW_ANCESTOR_ALREADY_HAS_SUCCESSOR = -1209;
122
+    const ERROR_FW_UPDATE_SEED_NOT_SET = -1210;
123 123
 
124
-	/*
124
+    /*
125 125
 	 * AA errors (-1300 to -1399)
126 126
 	 */
127
-	const ERROR_AA_NOT_FOUND = -1300;
128
-	const ERROR_AA_NOT_TOKEN_ISSUER = -1301;
129
-	const ERROR_AA_DOES_NOT_OWN_BRANDING = -1302;
130
-	const ERROR_AA_NO_ENROLMENT_RIGHT = -1303;
131
-	const ERROR_AA_DOES_NOT_MEET_MIN_ENROLMENT_TYPE = -1304;
132
-	const ERROR_AA_SIGNATURE_NOT_VERIFIED = -1305;
133
-	const ERROR_AA_SIGNATURE_NULL_OR_EMPTY = -1306;
134
-	const ERROR_AA_SIGNATURE_DATA_NOT_SET_OR_EMPTY = -1307;
135
-	const ERROR_AA_BRANDINGID_NULL = -1308;
136
-	const ERROR_AA_BRANDINGID_EMPTY = -1309;
137
-	const ERROR_AA_BRANDINGID_TOO_SHORT = -1310;
138
-	const ERROR_AA_BRANDINGID_TOO_LONG = -1311;
139
-	const ERROR_AA_BRANDINGID_NOT_NUMBER = -1312;
140
-	const ERROR_AA_NAME_NULL = -1313;
141
-	const ERROR_AA_NAME_EMPTY = -1314;
142
-	const ERROR_AA_NAME_TOO_SHORT = -1315;
143
-	const ERROR_AA_NAME_TOO_LONG = -1316;
144
-	const ERROR_AA_BRANDINGID_NOT_HEX = -1317;
145
-	const ERROR_IL_NOT_AUTHORIZED_TO_IMPORT_BLC = -1318;
127
+    const ERROR_AA_NOT_FOUND = -1300;
128
+    const ERROR_AA_NOT_TOKEN_ISSUER = -1301;
129
+    const ERROR_AA_DOES_NOT_OWN_BRANDING = -1302;
130
+    const ERROR_AA_NO_ENROLMENT_RIGHT = -1303;
131
+    const ERROR_AA_DOES_NOT_MEET_MIN_ENROLMENT_TYPE = -1304;
132
+    const ERROR_AA_SIGNATURE_NOT_VERIFIED = -1305;
133
+    const ERROR_AA_SIGNATURE_NULL_OR_EMPTY = -1306;
134
+    const ERROR_AA_SIGNATURE_DATA_NOT_SET_OR_EMPTY = -1307;
135
+    const ERROR_AA_BRANDINGID_NULL = -1308;
136
+    const ERROR_AA_BRANDINGID_EMPTY = -1309;
137
+    const ERROR_AA_BRANDINGID_TOO_SHORT = -1310;
138
+    const ERROR_AA_BRANDINGID_TOO_LONG = -1311;
139
+    const ERROR_AA_BRANDINGID_NOT_NUMBER = -1312;
140
+    const ERROR_AA_NAME_NULL = -1313;
141
+    const ERROR_AA_NAME_EMPTY = -1314;
142
+    const ERROR_AA_NAME_TOO_SHORT = -1315;
143
+    const ERROR_AA_NAME_TOO_LONG = -1316;
144
+    const ERROR_AA_BRANDINGID_NOT_HEX = -1317;
145
+    const ERROR_IL_NOT_AUTHORIZED_TO_IMPORT_BLC = -1318;
146 146
 		
147
-	/*
147
+    /*
148 148
 	 * Branding errors (-1400 to -1499)
149 149
 	 */
150
-	const ERROR_BRANDING_NOT_FOUND = -1400;
151
-	const ERROR_BRANDING_EMPTY = -1401;
152
-	const ERROR_BRANDING_INCOMPLETE = -1402;
153
-	const ERROR_BRANDING_ALREADY_EXIST = -1403;
154
-	const ERROR_BRANDING_LOADING_NOT_CONFIRMED = -1404;
155
-	const ERROR_BRANDING_SIGNATURE_NOT_VERIFIED = -1405;
156
-	const ERROR_BRANDING_SIGNATURE_NOT_HEX = -1406;
157
-	const ERROR_BRANDING_SIGNATURE_NOT_CALCULATED = -1407;
158
-	const ERROR_BRANDINGID_NULL = -1408;
159
-	const ERROR_BRANDINGID_EMPTY = -1409;
160
-	const ERROR_BRANDINGID_TOO_SHORT = -1410;
161
-	const ERROR_BRANDINGID_TOO_LONG = -1411;
162
-	const ERROR_BRANDINGID_NOT_NUMBER = -1412;
163
-	const ERROR_BRANDING_NAME_NULL = -1413;
164
-	const ERROR_BRANDING_NAME_EMPTY = -1414;
165
-	const ERROR_BRANDING_NAME_TOO_SHORT = -1415;
166
-	const ERROR_BRANDING_NAME_TOO_LONG = -1416;
167
-	const ERROR_BRANDING_TYPE_UNKNOWN = -1417;
168
-	const ERROR_POWER_BRANDING_NOT_FOUND = -1418;
169
-	// error for new branding (version 2) - 10.03.09 crohr
170
-	const ERROR_KBIN_NOT_SET = -1430;
171
-	const ERROR_KBIN_LENGTH_NOT_CORRECT = -1431;
172
-	const ERROR_BRDIG_NOT_VERIFIED = -1432;
173
-	const ERROR_BISC_NOT_VERIFIED = -1433;
174
-	const ERROR_CSS_NOT_VERIFIED = -1434;
175
-	const ERROR_ILN_NOT_VERIFIED = -1435;
176
-	const ERROR_CSS_INCOMPLETE = -1436;
177
-	const ERROR_CSS_EMPTY = -1437;
178
-	const ERROR_CSS_SIGNATURE_NOT_VERIFIED = -1438;
179
-	const ERROR_BRDIG_SIGNATURE_NOT_VERIFIED = -1439;
180
-	const ERROR_BRDIG_SIGNATURE_NOT_HEX = -1440;
181
-	const ERROR_BRANDINGID_NOT_HEX = -1441;
182
-	const ERROR_OID_LENGTH_NOT_CORRECT = -1442;
183
-	// the CSS was created for another system (production, enterprise, evaluation, ...)
184
-	const ERROR_CSS_BELONGS_TO_OTHER_SYSTEM = -1443;
185
-	// the systemtype in the kbin is not the same as the one in the CSS
186
-	const ERROR_KBIN_FOR_OTHER_SYSTEM_THAN_CSS = -1444;
187
-	
188
-	/*
150
+    const ERROR_BRANDING_NOT_FOUND = -1400;
151
+    const ERROR_BRANDING_EMPTY = -1401;
152
+    const ERROR_BRANDING_INCOMPLETE = -1402;
153
+    const ERROR_BRANDING_ALREADY_EXIST = -1403;
154
+    const ERROR_BRANDING_LOADING_NOT_CONFIRMED = -1404;
155
+    const ERROR_BRANDING_SIGNATURE_NOT_VERIFIED = -1405;
156
+    const ERROR_BRANDING_SIGNATURE_NOT_HEX = -1406;
157
+    const ERROR_BRANDING_SIGNATURE_NOT_CALCULATED = -1407;
158
+    const ERROR_BRANDINGID_NULL = -1408;
159
+    const ERROR_BRANDINGID_EMPTY = -1409;
160
+    const ERROR_BRANDINGID_TOO_SHORT = -1410;
161
+    const ERROR_BRANDINGID_TOO_LONG = -1411;
162
+    const ERROR_BRANDINGID_NOT_NUMBER = -1412;
163
+    const ERROR_BRANDING_NAME_NULL = -1413;
164
+    const ERROR_BRANDING_NAME_EMPTY = -1414;
165
+    const ERROR_BRANDING_NAME_TOO_SHORT = -1415;
166
+    const ERROR_BRANDING_NAME_TOO_LONG = -1416;
167
+    const ERROR_BRANDING_TYPE_UNKNOWN = -1417;
168
+    const ERROR_POWER_BRANDING_NOT_FOUND = -1418;
169
+    // error for new branding (version 2) - 10.03.09 crohr
170
+    const ERROR_KBIN_NOT_SET = -1430;
171
+    const ERROR_KBIN_LENGTH_NOT_CORRECT = -1431;
172
+    const ERROR_BRDIG_NOT_VERIFIED = -1432;
173
+    const ERROR_BISC_NOT_VERIFIED = -1433;
174
+    const ERROR_CSS_NOT_VERIFIED = -1434;
175
+    const ERROR_ILN_NOT_VERIFIED = -1435;
176
+    const ERROR_CSS_INCOMPLETE = -1436;
177
+    const ERROR_CSS_EMPTY = -1437;
178
+    const ERROR_CSS_SIGNATURE_NOT_VERIFIED = -1438;
179
+    const ERROR_BRDIG_SIGNATURE_NOT_VERIFIED = -1439;
180
+    const ERROR_BRDIG_SIGNATURE_NOT_HEX = -1440;
181
+    const ERROR_BRANDINGID_NOT_HEX = -1441;
182
+    const ERROR_OID_LENGTH_NOT_CORRECT = -1442;
183
+    // the CSS was created for another system (production, enterprise, evaluation, ...)
184
+    const ERROR_CSS_BELONGS_TO_OTHER_SYSTEM = -1443;
185
+    // the systemtype in the kbin is not the same as the one in the CSS
186
+    const ERROR_KBIN_FOR_OTHER_SYSTEM_THAN_CSS = -1444;
187
+	
188
+    /*
189 189
 	 * Property errors (-1600 to -1699)
190 190
 	 */
191
-	const ERROR_PROPERTY_NOT_NUMBER = -1600;
192
-	const ERROR_PROPERTY_NOT_SET = -1601;
193
-	const ERROR_PROPERTY_VALUE_NOT_VALID = -1602;
191
+    const ERROR_PROPERTY_NOT_NUMBER = -1600;
192
+    const ERROR_PROPERTY_NOT_SET = -1601;
193
+    const ERROR_PROPERTY_VALUE_NOT_VALID = -1602;
194 194
 	
195
-	/*
195
+    /*
196 196
 	 * platform errors (-1700 to -1799)
197 197
 	 */
198
-	const ERROR_PLATFORM_OPERATOR_NOT_SET = -1700;
199
-	const ERROR_PLATFORMID_NULL = -1701;
200
-	const ERROR_PLATFORMID_EMPTY = -1702;
201
-	const ERROR_PLATFORMID_NOT_NUMBER = -1703;
202
-	const ERROR_PLATFORMID_TOO_SHORT = -1704;
203
-	const ERROR_PLATFORMID_TOO_LONG = -1705;
204
-	const ERROR_PLATFORM_NAME_NULL = -1706;
205
-	const ERROR_PLATFORM_NAME_EMPTY = -1707;
206
-	const ERROR_PLATFORM_NAME_TOO_SHORT = -1708;
207
-	const ERROR_PLATFORM_NAME_TOO_LONG = -1709;
208
-	const ERROR_PLATFORMID_LENGTH_NOT_CORRECT = -1710;
209
-	const ERROR_PLATFORMID_NOT_HEX = -1711;
210
-	
211
-	/*
198
+    const ERROR_PLATFORM_OPERATOR_NOT_SET = -1700;
199
+    const ERROR_PLATFORMID_NULL = -1701;
200
+    const ERROR_PLATFORMID_EMPTY = -1702;
201
+    const ERROR_PLATFORMID_NOT_NUMBER = -1703;
202
+    const ERROR_PLATFORMID_TOO_SHORT = -1704;
203
+    const ERROR_PLATFORMID_TOO_LONG = -1705;
204
+    const ERROR_PLATFORM_NAME_NULL = -1706;
205
+    const ERROR_PLATFORM_NAME_EMPTY = -1707;
206
+    const ERROR_PLATFORM_NAME_TOO_SHORT = -1708;
207
+    const ERROR_PLATFORM_NAME_TOO_LONG = -1709;
208
+    const ERROR_PLATFORMID_LENGTH_NOT_CORRECT = -1710;
209
+    const ERROR_PLATFORMID_NOT_HEX = -1711;
210
+	
211
+    /*
212 212
 	 * XML errors (-1800 to -1899)
213 213
 	 */
214
-	const ERROR_XML_DATA_NOT_EXPORTED = -1800;
215
-	const ERROR_XML_DATA_NOT_PARSED = -1801;
216
-	const ERROR_XML_DATA_NOT_IMPORTED = -1802;
217
-	const ERROR_XML_DATA_NULL = -1803;
218
-	const ERROR_XML_DATA_EMPTY = -1804;
214
+    const ERROR_XML_DATA_NOT_EXPORTED = -1800;
215
+    const ERROR_XML_DATA_NOT_PARSED = -1801;
216
+    const ERROR_XML_DATA_NOT_IMPORTED = -1802;
217
+    const ERROR_XML_DATA_NULL = -1803;
218
+    const ERROR_XML_DATA_EMPTY = -1804;
219 219
 
220
-	/*
220
+    /*
221 221
 	 * TCS errors (-1900 to -1999)
222 222
 	 */
223
-	const ERROR_TCS_FILE_NOT_ENCRYPTED = -1900;
224
-	const ERROR_TCS_FILE_SIGNATURE_NOT_CREATED = -1901;
225
-	const ERROR_TCS_FILE_NOT_READABLE = -1902;
226
-	const ERROR_TCS_FILE_STRUCTURE_NOT_VALID = -1903;
227
-	const ERROR_TCS_SIGNATURE_NOT_VERIFIED = -1904;
228
-	const ERROR_TCS_SIGNATURE_NOT_VERIFIED_DATA_NOT_VALID = -1905;
229
-	const ERROR_TCS_SIGNATURE_NOT_VERIFIED_CERTIFICATE_NOT_USABLE = -1906;
230
-	const ERROR_TCS_SIGNATURE_NOT_VERIFIED_SIGNATURE_ALGORITHM_NOT_AVAILABLE = -1907;
231
-	const ERROR_TCS_DATA_ENCRYPTION_ALGORITHM_NOT_AVAILABLE = -1908;
232
-	const ERROR_TCS_DATA_NOT_IMPORTED = -1909;
233
-	const ERROR_TCS_DATA_PRIVATE_KEY_INVALID = -1910;
234
-	
235
-	/*
223
+    const ERROR_TCS_FILE_NOT_ENCRYPTED = -1900;
224
+    const ERROR_TCS_FILE_SIGNATURE_NOT_CREATED = -1901;
225
+    const ERROR_TCS_FILE_NOT_READABLE = -1902;
226
+    const ERROR_TCS_FILE_STRUCTURE_NOT_VALID = -1903;
227
+    const ERROR_TCS_SIGNATURE_NOT_VERIFIED = -1904;
228
+    const ERROR_TCS_SIGNATURE_NOT_VERIFIED_DATA_NOT_VALID = -1905;
229
+    const ERROR_TCS_SIGNATURE_NOT_VERIFIED_CERTIFICATE_NOT_USABLE = -1906;
230
+    const ERROR_TCS_SIGNATURE_NOT_VERIFIED_SIGNATURE_ALGORITHM_NOT_AVAILABLE = -1907;
231
+    const ERROR_TCS_DATA_ENCRYPTION_ALGORITHM_NOT_AVAILABLE = -1908;
232
+    const ERROR_TCS_DATA_NOT_IMPORTED = -1909;
233
+    const ERROR_TCS_DATA_PRIVATE_KEY_INVALID = -1910;
234
+	
235
+    /*
236 236
 	 * Production lot errors (-2000 to -2099)
237 237
 	 */
238
-	const ERROR_PRODUCTION_LOT_NOT_FOUND = -2000;
239
-	const ERROR_LOT_NUMBER_NEGATIVE = -2001;
240
-	const ERROR_LOT_NUMBER_ALREADY_EXISTS = -2002;
238
+    const ERROR_PRODUCTION_LOT_NOT_FOUND = -2000;
239
+    const ERROR_LOT_NUMBER_NEGATIVE = -2001;
240
+    const ERROR_LOT_NUMBER_ALREADY_EXISTS = -2002;
241 241
 			
242
-	/*
242
+    /*
243 243
 	 *  Keystore and TPS errors (-2100 to -2199)
244 244
 	 */
245
-	const ERROR_KEYSTORE_NOT_FOUND = -2100;
246
-	const ERROR_KEYSTORE_LOCATION_NOT_SET_OR_EMPTY = -2101;
247
-	const ERROR_KEYSTORE_PASSWORD_NOT_SET_OR_EMPTY = -2102;
248
-	const ERROR_KEYSTORE_NOT_LOADED = -2103;
249
-	const ERROR_KEYSTORE_KEY_NOT_LOADED = -2104;
250
-	const ERROR_AXS_CERTIFICATE_NOT_FOUND = -2105;
251
-	const ERROR_COULD_NOT_GET_CERTIFICATE = -2106;
252
-	const ERROR_COULD_NOT_GET_PUBLIC_KEY = -2107;
253
-	const ERROR_TPS_KEY_NOT_LOADED_FROM_KEYSTORE = -2108;
254
-	const ERROR_TPS_CERTIFICATE_NOT_LOADED_FROM_KEYSTORE = -2109;
255
-	const ERROR_TPS_SERVER_CONNECTION = -2110;
256
-	const ERROR_TPS_KEY_NOT_EXPORTED = -2111;
257
-	const ERROR_TPS_OTBLC_NOT_CREATED = -2112;
245
+    const ERROR_KEYSTORE_NOT_FOUND = -2100;
246
+    const ERROR_KEYSTORE_LOCATION_NOT_SET_OR_EMPTY = -2101;
247
+    const ERROR_KEYSTORE_PASSWORD_NOT_SET_OR_EMPTY = -2102;
248
+    const ERROR_KEYSTORE_NOT_LOADED = -2103;
249
+    const ERROR_KEYSTORE_KEY_NOT_LOADED = -2104;
250
+    const ERROR_AXS_CERTIFICATE_NOT_FOUND = -2105;
251
+    const ERROR_COULD_NOT_GET_CERTIFICATE = -2106;
252
+    const ERROR_COULD_NOT_GET_PUBLIC_KEY = -2107;
253
+    const ERROR_TPS_KEY_NOT_LOADED_FROM_KEYSTORE = -2108;
254
+    const ERROR_TPS_CERTIFICATE_NOT_LOADED_FROM_KEYSTORE = -2109;
255
+    const ERROR_TPS_SERVER_CONNECTION = -2110;
256
+    const ERROR_TPS_KEY_NOT_EXPORTED = -2111;
257
+    const ERROR_TPS_OTBLC_NOT_CREATED = -2112;
258 258
 
259
-	/*
259
+    /*
260 260
 	 * Data errors (-2200 to -2399)
261 261
 	 */
262 262
 	
263
-	// Codebook errors
264
-	const ERROR_CODEBOOK_ENTRY_NOT_FOUND = -2200;
265
-	const ERROR_CODEBOOK_NUMBER_OF_ENTRIES_DO_NOT_MATCH = -2201;
266
-	const ERROR_CODEBOOK_ENTRY_LENGTH_NOT_VALID = -2202;
263
+    // Codebook errors
264
+    const ERROR_CODEBOOK_ENTRY_NOT_FOUND = -2200;
265
+    const ERROR_CODEBOOK_NUMBER_OF_ENTRIES_DO_NOT_MATCH = -2201;
266
+    const ERROR_CODEBOOK_ENTRY_LENGTH_NOT_VALID = -2202;
267 267
 		
268
-	// FingerCode errors
269
-	const ERROR_FINGERCODE_NULL = -2210;
270
-	const ERROR_FINGERCODE_TOO_SHORT = -2211;
271
-	const ERROR_FINGERCODE_TOO_LONG = -2212;
272
-	const ERROR_FINGERCODE_INVALID_SYMBOLS = -2213;
273
-	const ERROR_FINGERCODE_CHAR_REPETITION = -2214;
274
-	const ERROR_FINGERCODE_VIOLATES_DOMAIN = -2215;
275
-	
276
-	// PIN errors
277
-	const ERROR_PIN_LENGTH_OUT_OF_BOUNDS = -2220;
278
-	const ERROR_PIN_LENGTH_FINGERCODE_NOT_SET = -2221;
279
-	
280
-	// Text payload errors
281
-	const ERROR_TEXT_PAYLOAD_NULL = -2230;
282
-	const ERROR_TEXT_PAYLOAD_EMPTY = -2231;
283
-	const ERROR_TEXT_PAYLOAD_TOO_LONG = -2232;
284
-	const ERROR_TEXT_CONTAINS_NON_DISPLAYABLE_CHARACTER = -2233;
285
-	const ERROR_TEXT_TOO_MANY_LINES = -2234;
286
-	
287
-	// AclRequested errors
288
-	const ERROR_ACL_REQUESTED_NULL = -2250;
289
-	const ERROR_ACL_REQUESTED_EMPTY = -2251;
290
-	const ERROR_ACL_REQUESTED_TOO_SHORT = -2252;
291
-	const ERROR_ACL_REQUESTED_TOO_LONG = -2253;
292
-	const ERROR_ACL_REQUESTED_NOT_HEX = -2254;
293
-	
294
-	// Description errors
295
-	const ERROR_DESCRIPTION_TOO_LONG = -2270;
296
-	
297
-	// Data errors
298
-	const ERROR_DATA_NULL = -2280;
299
-	const ERROR_DATA_EMPTY = -2281;
300
-	const ERROR_DATA_TOO_LONG = -2282;
301
-	const ERROR_DATA_NOT_HEX = -2283;
302
-	
303
-	// AuthenticationLevel error
304
-	const ERROR_AUTHENTICATION_LEVEL_OUT_OF_BOUNDS = -2290;
305
-	
306
-	// ReturnPath error
307
-	const ERROR_RETURN_PATH_OUT_OF_BOUNDS = -2300;
308
-	
309
-	// min_aut_lev error
310
-	const ERROR_MIN_AUT_LEV_OUT_OF_BOUNDS = -2310;
311
-	
312
-	// HexData errors
313
-	const ERROR_HEX_DATA_NULL = -2320;
314
-	const ERROR_HEX_DATA_NOT_HEX = -2321;
268
+    // FingerCode errors
269
+    const ERROR_FINGERCODE_NULL = -2210;
270
+    const ERROR_FINGERCODE_TOO_SHORT = -2211;
271
+    const ERROR_FINGERCODE_TOO_LONG = -2212;
272
+    const ERROR_FINGERCODE_INVALID_SYMBOLS = -2213;
273
+    const ERROR_FINGERCODE_CHAR_REPETITION = -2214;
274
+    const ERROR_FINGERCODE_VIOLATES_DOMAIN = -2215;
275
+	
276
+    // PIN errors
277
+    const ERROR_PIN_LENGTH_OUT_OF_BOUNDS = -2220;
278
+    const ERROR_PIN_LENGTH_FINGERCODE_NOT_SET = -2221;
279
+	
280
+    // Text payload errors
281
+    const ERROR_TEXT_PAYLOAD_NULL = -2230;
282
+    const ERROR_TEXT_PAYLOAD_EMPTY = -2231;
283
+    const ERROR_TEXT_PAYLOAD_TOO_LONG = -2232;
284
+    const ERROR_TEXT_CONTAINS_NON_DISPLAYABLE_CHARACTER = -2233;
285
+    const ERROR_TEXT_TOO_MANY_LINES = -2234;
286
+	
287
+    // AclRequested errors
288
+    const ERROR_ACL_REQUESTED_NULL = -2250;
289
+    const ERROR_ACL_REQUESTED_EMPTY = -2251;
290
+    const ERROR_ACL_REQUESTED_TOO_SHORT = -2252;
291
+    const ERROR_ACL_REQUESTED_TOO_LONG = -2253;
292
+    const ERROR_ACL_REQUESTED_NOT_HEX = -2254;
293
+	
294
+    // Description errors
295
+    const ERROR_DESCRIPTION_TOO_LONG = -2270;
296
+	
297
+    // Data errors
298
+    const ERROR_DATA_NULL = -2280;
299
+    const ERROR_DATA_EMPTY = -2281;
300
+    const ERROR_DATA_TOO_LONG = -2282;
301
+    const ERROR_DATA_NOT_HEX = -2283;
302
+	
303
+    // AuthenticationLevel error
304
+    const ERROR_AUTHENTICATION_LEVEL_OUT_OF_BOUNDS = -2290;
305
+	
306
+    // ReturnPath error
307
+    const ERROR_RETURN_PATH_OUT_OF_BOUNDS = -2300;
308
+	
309
+    // min_aut_lev error
310
+    const ERROR_MIN_AUT_LEV_OUT_OF_BOUNDS = -2310;
311
+	
312
+    // HexData errors
313
+    const ERROR_HEX_DATA_NULL = -2320;
314
+    const ERROR_HEX_DATA_NOT_HEX = -2321;
315 315
 		
316
-	// BRAK errors
317
-	const ERROR_BRAK_NOT_SET = -2330;
318
-	const ERROR_BRAK_LENGTH_NOT_CORRECT = -2331;
319
-	const ERROR_BARS_LENGTH_NOT_CORRECT = -2332;
316
+    // BRAK errors
317
+    const ERROR_BRAK_NOT_SET = -2330;
318
+    const ERROR_BRAK_LENGTH_NOT_CORRECT = -2331;
319
+    const ERROR_BARS_LENGTH_NOT_CORRECT = -2332;
320 320
 
321
-	// BRAC errors
322
-	const ERROR_BRAC_NULL = -2340;
323
-	const ERROR_BRAC_EMPTY = -2341;
324
-	const ERROR_BRAC_NOT_HEX = -2342;
325
-	
326
-	// OTBLC errors
327
-	const ERROR_OTBLC_NOT_FOUND = -2350;
328
-	const ERROR_OTBLC_NULL = -2351;
329
-	const ERROR_OTBLC_EMPTY = -2352;
330
-	const ERROR_OTBLC_TOO_SHORT = -2353;
331
-	const ERROR_OTBLC_TOO_LONG = -2354;
332
-	const ERROR_OTBLC_NOT_HEX = -2355;
333
-	const ERROR_OTBLC_DIFFERENT = -2356;
334
-	
335
-	// BLC nonce errors
336
-	const ERROR_BLC_NONCE_FORMAT_NOT_CORRECT = -2360;
337
-	const ERROR_BLC_NONCE_NULL_OR_EMPTY = -2361;
338
-	
339
-	// enrolment type error
340
-	const ERROR_ENROLMENT_TYPE_UNKNOWN = -2370;
341
-	
342
-	// lock errors
343
-	const ERROR_LOCKING_REASON_NULL = -2380;
344
-	const ERROR_LOCKING_REASON_EMPTY = -2381;
345
-	const ERROR_UNLOCKING_REASON_NULL = -2382;
346
-	const ERROR_UNLOCKING_REASON_EMPTY = -2383;	
347
-	
348
-	// idT error
349
-	const ERROR_IDT_INVALID = -2390;
350
-	
351
-	/*
321
+    // BRAC errors
322
+    const ERROR_BRAC_NULL = -2340;
323
+    const ERROR_BRAC_EMPTY = -2341;
324
+    const ERROR_BRAC_NOT_HEX = -2342;
325
+	
326
+    // OTBLC errors
327
+    const ERROR_OTBLC_NOT_FOUND = -2350;
328
+    const ERROR_OTBLC_NULL = -2351;
329
+    const ERROR_OTBLC_EMPTY = -2352;
330
+    const ERROR_OTBLC_TOO_SHORT = -2353;
331
+    const ERROR_OTBLC_TOO_LONG = -2354;
332
+    const ERROR_OTBLC_NOT_HEX = -2355;
333
+    const ERROR_OTBLC_DIFFERENT = -2356;
334
+	
335
+    // BLC nonce errors
336
+    const ERROR_BLC_NONCE_FORMAT_NOT_CORRECT = -2360;
337
+    const ERROR_BLC_NONCE_NULL_OR_EMPTY = -2361;
338
+	
339
+    // enrolment type error
340
+    const ERROR_ENROLMENT_TYPE_UNKNOWN = -2370;
341
+	
342
+    // lock errors
343
+    const ERROR_LOCKING_REASON_NULL = -2380;
344
+    const ERROR_LOCKING_REASON_EMPTY = -2381;
345
+    const ERROR_UNLOCKING_REASON_NULL = -2382;
346
+    const ERROR_UNLOCKING_REASON_EMPTY = -2383;	
347
+	
348
+    // idT error
349
+    const ERROR_IDT_INVALID = -2390;
350
+	
351
+    /*
352 352
 	 * User errors (-2400 to -2479)
353 353
 	 */
354
-	const ERROR_USER_NOT_FOUND = -2400;
355
-	const ERROR_GROUP_NOT_FOUND = -2401;
356
-	const ERROR_USERNAME_AND_AAID_CANNOT_BE_THE_SAME = -2402;
357
-	const ERROR_USER_ALREADY_CREATED = -2403;
358
-	const ERROR_GROUP_ALREADY_EXIST = -2404;
359
-	const ERROR_USER_ALREADY_ASSIGNED_TO_AAID = -2405;
360
-	const ERROR_USER_ALREADY_ASSIGNED_TO_GROUP = -2406;
361
-	const ERROR_USER_ALREADY_REMOVED_FROM_GROUP = -2407;
362
-	const ERROR_USER_CAN_NOT_BE_DELETED = -2408;
363
-	const ERROR_USERNAME_NOT_CORRECT = -2409; 
364
-	const ERROR_USERNAME_AAID_NOT_CORRECT = -2410;
365
-	const ERROR_USERNAME_GROUPNAME_NOT_CORRECT = -2411;
366
-	const ERROR_GROUPNAME_NOT_CORRECT = -2412;
367
-	const ERROR_PASSWORD_NOT_CORRECT = -2413;
368
-	const ERROR_USERNAME_PASSWORD_NOT_SET = -2414;
369
-	const ERROR_GROUPS_EMPTY = -2415;
370
-	const ERROR_DEFAULT_ADMIN_USER_NOT_FOUND = -2416;
371
-	const ERROR_DEFAULT_ADMIN_USER_NOT_VALID = -2417;
372
-	const ERROR_DEFAULT_ADMIN_USER_CAN_NOT_BE_DELETED = -2418;
373
-	const ERROR_DEFAULT_ADMIN_USER_CANNOT_BE_REMOVED_FROM_GROUP = -2419;
374
-	const ERROR_DEFAULT_ADMIN_USER_ALREADY_CREATED = -2420;
375
-	const ERROR_PASSWORD_OF_DEFAULT_ADMIN_USER_NOT_CHANGED = -2421;
376
-	const ERROR_PERMISSION_DENIED = -2422;
354
+    const ERROR_USER_NOT_FOUND = -2400;
355
+    const ERROR_GROUP_NOT_FOUND = -2401;
356
+    const ERROR_USERNAME_AND_AAID_CANNOT_BE_THE_SAME = -2402;
357
+    const ERROR_USER_ALREADY_CREATED = -2403;
358
+    const ERROR_GROUP_ALREADY_EXIST = -2404;
359
+    const ERROR_USER_ALREADY_ASSIGNED_TO_AAID = -2405;
360
+    const ERROR_USER_ALREADY_ASSIGNED_TO_GROUP = -2406;
361
+    const ERROR_USER_ALREADY_REMOVED_FROM_GROUP = -2407;
362
+    const ERROR_USER_CAN_NOT_BE_DELETED = -2408;
363
+    const ERROR_USERNAME_NOT_CORRECT = -2409; 
364
+    const ERROR_USERNAME_AAID_NOT_CORRECT = -2410;
365
+    const ERROR_USERNAME_GROUPNAME_NOT_CORRECT = -2411;
366
+    const ERROR_GROUPNAME_NOT_CORRECT = -2412;
367
+    const ERROR_PASSWORD_NOT_CORRECT = -2413;
368
+    const ERROR_USERNAME_PASSWORD_NOT_SET = -2414;
369
+    const ERROR_GROUPS_EMPTY = -2415;
370
+    const ERROR_DEFAULT_ADMIN_USER_NOT_FOUND = -2416;
371
+    const ERROR_DEFAULT_ADMIN_USER_NOT_VALID = -2417;
372
+    const ERROR_DEFAULT_ADMIN_USER_CAN_NOT_BE_DELETED = -2418;
373
+    const ERROR_DEFAULT_ADMIN_USER_CANNOT_BE_REMOVED_FROM_GROUP = -2419;
374
+    const ERROR_DEFAULT_ADMIN_USER_ALREADY_CREATED = -2420;
375
+    const ERROR_PASSWORD_OF_DEFAULT_ADMIN_USER_NOT_CHANGED = -2421;
376
+    const ERROR_PERMISSION_DENIED = -2422;
377 377
 
378
-	/*
378
+    /*
379 379
 	 * Configuration errors (-2480 to -2499)
380 380
 	 */
381
-	const ERROR_CONFIGURATION_NOT_FOUND = -2480;
382
-	const ERROR_CONFIGURATION_ITEM_NOT_FOUND = -2481;
383
-	const ERROR_CONFIGURATION_NAME_TOO_SHORT = -2482;
384
-	const ERROR_CONFIGURATION_NAME_TOO_LONG = -2483;
385
-	const ERROR_CONFIGURATION_DESCRIPTION_TOO_LONG = -2484;
386
-	const ERROR_CONFIGURATION_TYPE_OUT_OF_BOUNDS = -2485;
387
-	const ERROR_CONFIGURATION_POSITION_OUT_OF_BOUNDS = -2486;
388
-	const ERROR_CONFIGURATION_ALREADY_EXIST = -2487;
389
-	const ERROR_CONFIGURATION_ITEM_NAME_TOO_LONG = -2488;
390
-	const ERROR_CONFIGURATION_ITEM_ALREADY_EXIST = -2489;
391
-	
392
-	/*
381
+    const ERROR_CONFIGURATION_NOT_FOUND = -2480;
382
+    const ERROR_CONFIGURATION_ITEM_NOT_FOUND = -2481;
383
+    const ERROR_CONFIGURATION_NAME_TOO_SHORT = -2482;
384
+    const ERROR_CONFIGURATION_NAME_TOO_LONG = -2483;
385
+    const ERROR_CONFIGURATION_DESCRIPTION_TOO_LONG = -2484;
386
+    const ERROR_CONFIGURATION_TYPE_OUT_OF_BOUNDS = -2485;
387
+    const ERROR_CONFIGURATION_POSITION_OUT_OF_BOUNDS = -2486;
388
+    const ERROR_CONFIGURATION_ALREADY_EXIST = -2487;
389
+    const ERROR_CONFIGURATION_ITEM_NAME_TOO_LONG = -2488;
390
+    const ERROR_CONFIGURATION_ITEM_ALREADY_EXIST = -2489;
391
+	
392
+    /*
393 393
 	 * Generator errors (-2500 to -2599)
394 394
 	 */
395
-	const ERROR_BAC_GENERATOR_NOT_INITIALIZED = -2500;
396
-	const ERROR_FLICKERING_GENERATOR_NOT_FOUND = -2501;
397
-	const ERROR_MESSAGE_GENERATOR_NOT_FOUND = -2502;
398
-	const ERROR_CODEBOOK_GENERATOR_NOT_INITIALIZED = -2503;
399
-	const ERROR_DEBUG_MESSAGE_GENERATOR_NOT_FOUND = -2504;
400
-	const ERROR_TCS_GENERATOR_CLASS_NOT_VALID = -2505;
401
-	const ERROR_TCS_GENERATOR_NOT_CREATED = -2506;
402
-	
403
-	/*
395
+    const ERROR_BAC_GENERATOR_NOT_INITIALIZED = -2500;
396
+    const ERROR_FLICKERING_GENERATOR_NOT_FOUND = -2501;
397
+    const ERROR_MESSAGE_GENERATOR_NOT_FOUND = -2502;
398
+    const ERROR_CODEBOOK_GENERATOR_NOT_INITIALIZED = -2503;
399
+    const ERROR_DEBUG_MESSAGE_GENERATOR_NOT_FOUND = -2504;
400
+    const ERROR_TCS_GENERATOR_CLASS_NOT_VALID = -2505;
401
+    const ERROR_TCS_GENERATOR_NOT_CREATED = -2506;
402
+	
403
+    /*
404 404
 	 * Other errors (-2600 to -xxxx)
405 405
 	 */
406
-	const ERROR_DOS_TIMELIMIT = -2600;
407
-	const ERROR_IO = -2601;
408
-	const ERROR_WSDL_LOCATION_PROPERTY_NOT_SET = -2602;
409
-	const ERROR_AXS_UPDATER_SERVICE_NOT_CALLED = -2603;
410
-	const ERROR_DOMAIN_VIOLATION_BY_UPDATE_SESSION_SEED = -2604;
411
-	const ERROR_CREATE_CORE_WITH_EXISTING_USCN = -2605;
412
-	
413
-	/*
406
+    const ERROR_DOS_TIMELIMIT = -2600;
407
+    const ERROR_IO = -2601;
408
+    const ERROR_WSDL_LOCATION_PROPERTY_NOT_SET = -2602;
409
+    const ERROR_AXS_UPDATER_SERVICE_NOT_CALLED = -2603;
410
+    const ERROR_DOMAIN_VIOLATION_BY_UPDATE_SESSION_SEED = -2604;
411
+    const ERROR_CREATE_CORE_WITH_EXISTING_USCN = -2605;
412
+	
413
+    /*
414 414
 	 * Roaming errors (-2700 to -2799)
415 415
 	 */
416
-	// configuration problems
417
-	const ERROR_KEYFETCHING_NOT_CONFIGURED = -2700;
418
-	// connection problems sm - cm
419
-	const ERROR_KEYFETCHING_SM_CANNOT_CONNECT_TO_CM_WSDL_WRONG = -2710;
420
-	const ERROR_KEYFETCHING_SM_CANNOT_CONNECT_TO_CM_NOT_AUTHORIZED = -2711;
416
+    // configuration problems
417
+    const ERROR_KEYFETCHING_NOT_CONFIGURED = -2700;
418
+    // connection problems sm - cm
419
+    const ERROR_KEYFETCHING_SM_CANNOT_CONNECT_TO_CM_WSDL_WRONG = -2710;
420
+    const ERROR_KEYFETCHING_SM_CANNOT_CONNECT_TO_CM_NOT_AUTHORIZED = -2711;
421 421
 	
422
-	// errors outside of this server
423
-	const ERROR_KEYFETCHING_PERMANENT_ERROR_OUTSIDE_OF_THIS_SERVER = -2720;
424
-	const ERROR_KEYFETCHING_TEMPORARY_ERROR_OUTSIDE_OF_THIS_SERVER = -2721;
422
+    // errors outside of this server
423
+    const ERROR_KEYFETCHING_PERMANENT_ERROR_OUTSIDE_OF_THIS_SERVER = -2720;
424
+    const ERROR_KEYFETCHING_TEMPORARY_ERROR_OUTSIDE_OF_THIS_SERVER = -2721;
425 425
 	
426
-	// timeouts
427
-	const ERROR_KEYFETCHING_TIMEOUT_ON_SERVER = -2730;
426
+    // timeouts
427
+    const ERROR_KEYFETCHING_TIMEOUT_ON_SERVER = -2730;
428 428
 	
429
-	const ERROR_KEYSTORE_LOCATION_NOT_CORRECT = -2740;
429
+    const ERROR_KEYSTORE_LOCATION_NOT_CORRECT = -2740;
430 430
 		
431
-	/* removed 2009-02-18 - crohr	
431
+    /* removed 2009-02-18 - crohr	
432 432
 	 * The error does not occur anymore
433 433
 	 * const ERROR_SERVER_TIMEOUT = -3000;
434 434
 	 */	
435
-	const ERROR_WEBSERVICE = -3001;
436
-	const ERROR_DATABASE_CORRUPTED = -3002;
437
-	const ERROR_WSDL_URL_NOT_ACCESSIBLE = -3003;
438
-	const ERROR_PARAMETER_NULL = -4000;
439
-	const ERROR_PARAMETER_EMPTY = -4001;
440
-	const ERROR_PARAMETER_TOO_LONG = -4002;
435
+    const ERROR_WEBSERVICE = -3001;
436
+    const ERROR_DATABASE_CORRUPTED = -3002;
437
+    const ERROR_WSDL_URL_NOT_ACCESSIBLE = -3003;
438
+    const ERROR_PARAMETER_NULL = -4000;
439
+    const ERROR_PARAMETER_EMPTY = -4001;
440
+    const ERROR_PARAMETER_TOO_LONG = -4002;
441 441
 	
442
-	const ERROR_METHOD_NOT_SUPPORTED_ANYMORE = -5000;
442
+    const ERROR_METHOD_NOT_SUPPORTED_ANYMORE = -5000;
443 443
 	
444
-	const ERROR_FORWARD_SECURITY_NEWS_NOT_FOUND = -5100;
445
-	const ERROR_NEWS_NOT_SUPPORTED = -5101;
444
+    const ERROR_FORWARD_SECURITY_NEWS_NOT_FOUND = -5100;
445
+    const ERROR_NEWS_NOT_SUPPORTED = -5101;
446 446
 		
447
-	const ERROR_UNDEFINED = -9999;
447
+    const ERROR_UNDEFINED = -9999;
448 448
 }
449 449
 ?>
450 450
\ No newline at end of file
Please login to merge, or discard this patch.
includes/libraries/Authentication/agses/axs/AXSILPortal_V1_Auth.php 1 patch
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -1,54 +1,54 @@
 block discarded – undo
1 1
 <?php 
2 2
 class AXSILPortal_V1_Auth { 
3
-	var $server;
3
+    var $server;
4 4
 
5
-	private $url = "";
6
-	private $AAId = "";
7
-	private $apiKey = "";
5
+    private $url = "";
6
+    private $AAId = "";
7
+    private $apiKey = "";
8 8
 	
9
-	private $baseUrl = "";
9
+    private $baseUrl = "";
10 10
 	
11
-	function setUrl($url) {
12
-		$this->url = $url;
13
-	}
11
+    function setUrl($url) {
12
+        $this->url = $url;
13
+    }
14 14
 	
15
-	function setAAId($AAId) {
16
-		$this->AAId = $AAId;
17
-	}
15
+    function setAAId($AAId) {
16
+        $this->AAId = $AAId;
17
+    }
18 18
 	
19
-	function setApiKey($apiKey) {
20
-		$this->apiKey = $apiKey;
21
-	}
19
+    function setApiKey($apiKey) {
20
+        $this->apiKey = $apiKey;
21
+    }
22 22
 	
23 23
 	
24
-	// Verify that you can open the URL from the web server.
25
-	function create() { 
26
-		if ($this->url != "" && $this->AAId != "" && $this->apiKey != "") {
27
-			$this->baseUrl = $this->url."".$this->apiKey."/".$this->AAId;
28
-		} else {
29
-			die("Cannot initialize Agses webservice without credentials, please set them in settings");
30
-		}
31
-	}
24
+    // Verify that you can open the URL from the web server.
25
+    function create() { 
26
+        if ($this->url != "" && $this->AAId != "" && $this->apiKey != "") {
27
+            $this->baseUrl = $this->url."".$this->apiKey."/".$this->AAId;
28
+        } else {
29
+            die("Cannot initialize Agses webservice without credentials, please set them in settings");
30
+        }
31
+    }
32 32
 	
33
-	function createAuthenticationMessage($apn, $createFlickerCode, $returnPath, $authenticationLevel, $hedgeId) {
33
+    function createAuthenticationMessage($apn, $createFlickerCode, $returnPath, $authenticationLevel, $hedgeId) {
34 34
 		
35
-		$serviceCall = $this->baseUrl."/authmessage/".$apn."/create/".$hedgeId;
35
+        $serviceCall = $this->baseUrl."/authmessage/".$apn."/create/".$hedgeId;
36 36
 		
37
-		$json = file_get_contents($serviceCall);
38
-		$response = json_decode($json,true);		
37
+        $json = file_get_contents($serviceCall);
38
+        $response = json_decode($json,true);		
39 39
 		
40
-		return $response['flickerCode'];
41
-	}
40
+        return $response['flickerCode'];
41
+    }
42 42
 	
43
-	function verifyResponse($apn, $response, $hedgeId) {
43
+    function verifyResponse($apn, $response, $hedgeId) {
44 44
 		
45
-		$serviceCall = $this->baseUrl."/authmessage/".$apn."/verify/".$hedgeId."/".$response;
45
+        $serviceCall = $this->baseUrl."/authmessage/".$apn."/verify/".$hedgeId."/".$response;
46 46
 		
47
-		$json = file_get_contents($serviceCall);
48
-		$response = json_decode($json,true);
47
+        $json = file_get_contents($serviceCall);
48
+        $response = json_decode($json,true);
49 49
 		
50
-		return $response['response'];
51
-	}
50
+        return $response['response'];
51
+    }
52 52
 
53 53
 } 
54 54
 ?>
55 55
\ No newline at end of file
Please login to merge, or discard this patch.
includes/libraries/Authentication/agses/axs/axs/code2gif.php 1 patch
Indentation   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -43,73 +43,73 @@
 block discarded – undo
43 43
      *                 created gif files by almost 50%.
44 44
      */
45 45
 
46
-	// path to data files
47
-	$path = './images_gif';
46
+    // path to data files
47
+    $path = './images_gif';
48 48
 	
49
-	// get code from GET request, use dummy pattern if code not defined
50
-	$code = isset($_GET['code']) ? $_GET['code'] : '20100804020102040810';
49
+    // get code from GET request, use dummy pattern if code not defined
50
+    $code = isset($_GET['code']) ? $_GET['code'] : '20100804020102040810';
51 51
 
52
-	// get frame delay from GET request, default to "safe speed" if delay not
53
-	// defined or invalid. delay is specified in ms in the request and needs
54
-	// to be converted to 1/100s for use in GIF files
55
-	$delay = isset($_GET['delay']) ? ($_GET['delay']+0)/10 : 8;
56
-	$delay = ($delay > 0) ? $delay : 8;
52
+    // get frame delay from GET request, default to "safe speed" if delay not
53
+    // defined or invalid. delay is specified in ms in the request and needs
54
+    // to be converted to 1/100s for use in GIF files
55
+    $delay = isset($_GET['delay']) ? ($_GET['delay']+0)/10 : 8;
56
+    $delay = ($delay > 0) ? $delay : 8;
57 57
 
58
-	// code string must only contain hex characters, code length is limited to
59
-	// 1024 characters (512 frames)
60
-	$codelen = strlen($code);
61
-	if ( ctype_xdigit($code) && $codelen < 1024 ) {
58
+    // code string must only contain hex characters, code length is limited to
59
+    // 1024 characters (512 frames)
60
+    $codelen = strlen($code);
61
+    if ( ctype_xdigit($code) && $codelen < 1024 ) {
62 62
 	
63
-		// get prepared gif file header
64
-		$gif  = file_get_contents($path.'/head.bin');
63
+        // get prepared gif file header
64
+        $gif  = file_get_contents($path.'/head.bin');
65 65
 		
66
-		// build graphic control extension block
67
-		// disposal method   = 0
68
-		// transparent color = 255
69
-		$ext = "\x21\xf9\x04\x01".chr($delay&0xff).chr(($delay>>8)&0xff)."\xff\x00";
66
+        // build graphic control extension block
67
+        // disposal method   = 0
68
+        // transparent color = 255
69
+        $ext = "\x21\xf9\x04\x01".chr($delay&0xff).chr(($delay>>8)&0xff)."\xff\x00";
70 70
 		
71
-		// output image header
72
-		header('Content-type:image/gif');
73
-		print($gif);
71
+        // output image header
72
+        header('Content-type:image/gif');
73
+        print($gif);
74 74
 	
75
-		// append image data blocks as necessary
76
-		$size = filesize($path.'/data.bin');
77
-		$data = fopen($path.'/data.bin','r');
78
-		if ($data) {
75
+        // append image data blocks as necessary
76
+        $size = filesize($path.'/data.bin');
77
+        $data = fopen($path.'/data.bin','r');
78
+        if ($data) {
79 79
 
80
-			// load the index from the data file and unpack it into a PHP array.
81
-			// the index array contains the file offsets of the 4096 delta and
82
-			// base images inside the data file.
83
-			$index = unpack("V*", fread($data, 64*64*4));
80
+            // load the index from the data file and unpack it into a PHP array.
81
+            // the index array contains the file offsets of the 4096 delta and
82
+            // base images inside the data file.
83
+            $index = unpack("V*", fread($data, 64*64*4));
84 84
 
85
-			// when a code is repeated (prev and curr have the same value) a
86
-			// base image is inserted instead of a delta image. the first frame
87
-			// in the animation must be a base image, so we peek at the flicker
88
-			// code and set $prev to the first value in the string
89
-			$prev = hexdec(substr($code, 0, 2));
90
-			for ($i = 0; $i < $codelen; $i+=2) {
85
+            // when a code is repeated (prev and curr have the same value) a
86
+            // base image is inserted instead of a delta image. the first frame
87
+            // in the animation must be a base image, so we peek at the flicker
88
+            // code and set $prev to the first value in the string
89
+            $prev = hexdec(substr($code, 0, 2));
90
+            for ($i = 0; $i < $codelen; $i+=2) {
91 91
 
92
-				// get current code
93
-				$curr = hexdec(substr($code, $i, 2));
92
+                // get current code
93
+                $curr = hexdec(substr($code, $i, 2));
94 94
 						
95
-				// locate image block in data file
96
-				$blockIdx = $prev*64+$curr+1;	// array starts at 1
97
-				$blockPos = $index[$blockIdx];
98
-				$blockLen = ($blockIdx < 4096 ? $index[$blockIdx+1] : $size) - $blockPos;
95
+                // locate image block in data file
96
+                $blockIdx = $prev*64+$curr+1;	// array starts at 1
97
+                $blockPos = $index[$blockIdx];
98
+                $blockLen = ($blockIdx < 4096 ? $index[$blockIdx+1] : $size) - $blockPos;
99 99
 				
100
-				// output extension header
101
-				print($ext);
100
+                // output extension header
101
+                print($ext);
102 102
 
103
-				// output image block
104
-				fseek($data, $blockPos);
105
-				print(fread($data, $blockLen));
103
+                // output image block
104
+                fseek($data, $blockPos);
105
+                print(fread($data, $blockLen));
106 106
 			
107
-				$prev = $curr;
108
-			}
107
+                $prev = $curr;
108
+            }
109 109
 
110
-			// file terminator
111
-			print(";");
112
-		}
113
-	}
110
+            // file terminator
111
+            print(";");
112
+        }
113
+    }
114 114
     /******/
115 115
 ?>
116 116
\ No newline at end of file
Please login to merge, or discard this patch.
includes/libraries/Authentication/phpseclib/Crypt/Hash.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -336,16 +336,16 @@
 block discarded – undo
336 336
             // Extend the sixteen 32-bit words into eighty 32-bit words
337 337
             for ($i = 16; $i < 80; $i++) {
338 338
                 $temp = array(
339
-                          $w[$i - 15]->bitwise_rightRotate(1),
340
-                          $w[$i - 15]->bitwise_rightRotate(8),
341
-                          $w[$i - 15]->bitwise_rightShift(7)
339
+                            $w[$i - 15]->bitwise_rightRotate(1),
340
+                            $w[$i - 15]->bitwise_rightRotate(8),
341
+                            $w[$i - 15]->bitwise_rightShift(7)
342 342
                 );
343 343
                 $s0 = $temp[0]->bitwise_xor($temp[1]);
344 344
                 $s0 = $s0->bitwise_xor($temp[2]);
345 345
                 $temp = array(
346
-                          $w[$i - 2]->bitwise_rightRotate(19),
347
-                          $w[$i - 2]->bitwise_rightRotate(61),
348
-                          $w[$i - 2]->bitwise_rightShift(6)
346
+                            $w[$i - 2]->bitwise_rightRotate(19),
347
+                            $w[$i - 2]->bitwise_rightRotate(61),
348
+                            $w[$i - 2]->bitwise_rightShift(6)
349 349
                 );
350 350
                 $s1 = $temp[0]->bitwise_xor($temp[1]);
351 351
                 $s1 = $s1->bitwise_xor($temp[2]);
Please login to merge, or discard this patch.
includes/libraries/Authentication/phpseclib/Crypt/Twofish.php 1 patch
Indentation   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -464,13 +464,13 @@  discard block
 block discarded – undo
464 464
                 list($s3, $s2, $s1, $s0) = $this->_mdsrem($le_longs[3], $le_longs[4]);
465 465
                 for ($i = 0, $j = 1; $i < 40; $i+= 2, $j+= 2) {
466 466
                     $A = $m0[$q0[$q0[$i] ^ $key[ 9]] ^ $key[1]] ^
467
-                         $m1[$q0[$q1[$i] ^ $key[10]] ^ $key[2]] ^
468
-                         $m2[$q1[$q0[$i] ^ $key[11]] ^ $key[3]] ^
469
-                         $m3[$q1[$q1[$i] ^ $key[12]] ^ $key[4]];
467
+                            $m1[$q0[$q1[$i] ^ $key[10]] ^ $key[2]] ^
468
+                            $m2[$q1[$q0[$i] ^ $key[11]] ^ $key[3]] ^
469
+                            $m3[$q1[$q1[$i] ^ $key[12]] ^ $key[4]];
470 470
                     $B = $m0[$q0[$q0[$j] ^ $key[13]] ^ $key[5]] ^
471
-                         $m1[$q0[$q1[$j] ^ $key[14]] ^ $key[6]] ^
472
-                         $m2[$q1[$q0[$j] ^ $key[15]] ^ $key[7]] ^
473
-                         $m3[$q1[$q1[$j] ^ $key[16]] ^ $key[8]];
471
+                            $m1[$q0[$q1[$j] ^ $key[14]] ^ $key[6]] ^
472
+                            $m2[$q1[$q0[$j] ^ $key[15]] ^ $key[7]] ^
473
+                            $m3[$q1[$q1[$j] ^ $key[16]] ^ $key[8]];
474 474
                     $B = ($B << 8) | ($B >> 24 & 0xff);
475 475
                     $K[] = $A+= $B;
476 476
                     $K[] = (($A+= $B) << 9 | $A >> 23 & 0x1ff);
@@ -488,13 +488,13 @@  discard block
 block discarded – undo
488 488
                 list($s3, $s2, $s1, $s0) = $this->_mdsrem($le_longs[5], $le_longs[6]);
489 489
                 for ($i = 0, $j = 1; $i < 40; $i+= 2, $j+= 2) {
490 490
                     $A = $m0[$q0[$q0[$q1[$i] ^ $key[17]] ^ $key[ 9]] ^ $key[1]] ^
491
-                         $m1[$q0[$q1[$q1[$i] ^ $key[18]] ^ $key[10]] ^ $key[2]] ^
492
-                         $m2[$q1[$q0[$q0[$i] ^ $key[19]] ^ $key[11]] ^ $key[3]] ^
493
-                         $m3[$q1[$q1[$q0[$i] ^ $key[20]] ^ $key[12]] ^ $key[4]];
491
+                            $m1[$q0[$q1[$q1[$i] ^ $key[18]] ^ $key[10]] ^ $key[2]] ^
492
+                            $m2[$q1[$q0[$q0[$i] ^ $key[19]] ^ $key[11]] ^ $key[3]] ^
493
+                            $m3[$q1[$q1[$q0[$i] ^ $key[20]] ^ $key[12]] ^ $key[4]];
494 494
                     $B = $m0[$q0[$q0[$q1[$j] ^ $key[21]] ^ $key[13]] ^ $key[5]] ^
495
-                         $m1[$q0[$q1[$q1[$j] ^ $key[22]] ^ $key[14]] ^ $key[6]] ^
496
-                         $m2[$q1[$q0[$q0[$j] ^ $key[23]] ^ $key[15]] ^ $key[7]] ^
497
-                         $m3[$q1[$q1[$q0[$j] ^ $key[24]] ^ $key[16]] ^ $key[8]];
495
+                            $m1[$q0[$q1[$q1[$j] ^ $key[22]] ^ $key[14]] ^ $key[6]] ^
496
+                            $m2[$q1[$q0[$q0[$j] ^ $key[23]] ^ $key[15]] ^ $key[7]] ^
497
+                            $m3[$q1[$q1[$q0[$j] ^ $key[24]] ^ $key[16]] ^ $key[8]];
498 498
                     $B = ($B << 8) | ($B >> 24 & 0xff);
499 499
                     $K[] = $A+= $B;
500 500
                     $K[] = (($A+= $B) << 9 | $A >> 23 & 0x1ff);
@@ -513,13 +513,13 @@  discard block
 block discarded – undo
513 513
                 list($s3, $s2, $s1, $s0) = $this->_mdsrem($le_longs[7], $le_longs[8]);
514 514
                 for ($i = 0, $j = 1; $i < 40; $i+= 2, $j+= 2) {
515 515
                     $A = $m0[$q0[$q0[$q1[$q1[$i] ^ $key[25]] ^ $key[17]] ^ $key[ 9]] ^ $key[1]] ^
516
-                         $m1[$q0[$q1[$q1[$q0[$i] ^ $key[26]] ^ $key[18]] ^ $key[10]] ^ $key[2]] ^
517
-                         $m2[$q1[$q0[$q0[$q0[$i] ^ $key[27]] ^ $key[19]] ^ $key[11]] ^ $key[3]] ^
518
-                         $m3[$q1[$q1[$q0[$q1[$i] ^ $key[28]] ^ $key[20]] ^ $key[12]] ^ $key[4]];
516
+                            $m1[$q0[$q1[$q1[$q0[$i] ^ $key[26]] ^ $key[18]] ^ $key[10]] ^ $key[2]] ^
517
+                            $m2[$q1[$q0[$q0[$q0[$i] ^ $key[27]] ^ $key[19]] ^ $key[11]] ^ $key[3]] ^
518
+                            $m3[$q1[$q1[$q0[$q1[$i] ^ $key[28]] ^ $key[20]] ^ $key[12]] ^ $key[4]];
519 519
                     $B = $m0[$q0[$q0[$q1[$q1[$j] ^ $key[29]] ^ $key[21]] ^ $key[13]] ^ $key[5]] ^
520
-                         $m1[$q0[$q1[$q1[$q0[$j] ^ $key[30]] ^ $key[22]] ^ $key[14]] ^ $key[6]] ^
521
-                         $m2[$q1[$q0[$q0[$q0[$j] ^ $key[31]] ^ $key[23]] ^ $key[15]] ^ $key[7]] ^
522
-                         $m3[$q1[$q1[$q0[$q1[$j] ^ $key[32]] ^ $key[24]] ^ $key[16]] ^ $key[8]];
520
+                            $m1[$q0[$q1[$q1[$q0[$j] ^ $key[30]] ^ $key[22]] ^ $key[14]] ^ $key[6]] ^
521
+                            $m2[$q1[$q0[$q0[$q0[$j] ^ $key[31]] ^ $key[23]] ^ $key[15]] ^ $key[7]] ^
522
+                            $m3[$q1[$q1[$q0[$q1[$j] ^ $key[32]] ^ $key[24]] ^ $key[16]] ^ $key[8]];
523 523
                     $B = ($B << 8) | ($B >> 24 & 0xff);
524 524
                     $K[] = $A+= $B;
525 525
                     $K[] = (($A+= $B) << 9 | $A >> 23 & 0x1ff);
@@ -611,25 +611,25 @@  discard block
 block discarded – undo
611 611
         $ki = 7;
612 612
         while ($ki < 39) {
613 613
             $t0 = $S0[ $R0        & 0xff] ^
614
-                  $S1[($R0 >>  8) & 0xff] ^
615
-                  $S2[($R0 >> 16) & 0xff] ^
616
-                  $S3[($R0 >> 24) & 0xff];
614
+                    $S1[($R0 >>  8) & 0xff] ^
615
+                    $S2[($R0 >> 16) & 0xff] ^
616
+                    $S3[($R0 >> 24) & 0xff];
617 617
             $t1 = $S0[($R1 >> 24) & 0xff] ^
618
-                  $S1[ $R1        & 0xff] ^
619
-                  $S2[($R1 >>  8) & 0xff] ^
620
-                  $S3[($R1 >> 16) & 0xff];
618
+                    $S1[ $R1        & 0xff] ^
619
+                    $S2[($R1 >>  8) & 0xff] ^
620
+                    $S3[($R1 >> 16) & 0xff];
621 621
             $R2^= $t0 + $t1 + $K[++$ki];
622 622
             $R2 = ($R2 >> 1 & 0x7fffffff) | ($R2 << 31);
623 623
             $R3 = ((($R3 >> 31) & 1) | ($R3 << 1)) ^ ($t0 + ($t1 << 1) + $K[++$ki]);
624 624
 
625 625
             $t0 = $S0[ $R2        & 0xff] ^
626
-                  $S1[($R2 >>  8) & 0xff] ^
627
-                  $S2[($R2 >> 16) & 0xff] ^
628
-                  $S3[($R2 >> 24) & 0xff];
626
+                    $S1[($R2 >>  8) & 0xff] ^
627
+                    $S2[($R2 >> 16) & 0xff] ^
628
+                    $S3[($R2 >> 24) & 0xff];
629 629
             $t1 = $S0[($R3 >> 24) & 0xff] ^
630
-                  $S1[ $R3        & 0xff] ^
631
-                  $S2[($R3 >>  8) & 0xff] ^
632
-                  $S3[($R3 >> 16) & 0xff];
630
+                    $S1[ $R3        & 0xff] ^
631
+                    $S2[($R3 >>  8) & 0xff] ^
632
+                    $S3[($R3 >> 16) & 0xff];
633 633
             $R0^= ($t0 + $t1 + $K[++$ki]);
634 634
             $R0 = ($R0 >> 1 & 0x7fffffff) | ($R0 << 31);
635 635
             $R1 = ((($R1 >> 31) & 1) | ($R1 << 1)) ^ ($t0 + ($t1 << 1) + $K[++$ki]);
@@ -637,9 +637,9 @@  discard block
 block discarded – undo
637 637
 
638 638
         // @codingStandardsIgnoreStart
639 639
         return pack("V4", $K[4] ^ $R2,
640
-                          $K[5] ^ $R3,
641
-                          $K[6] ^ $R0,
642
-                          $K[7] ^ $R1);
640
+                            $K[5] ^ $R3,
641
+                            $K[6] ^ $R0,
642
+                            $K[7] ^ $R1);
643 643
         // @codingStandardsIgnoreEnd
644 644
     }
645 645
 
@@ -667,25 +667,25 @@  discard block
 block discarded – undo
667 667
         $ki = 40;
668 668
         while ($ki > 8) {
669 669
             $t0 = $S0[$R0       & 0xff] ^
670
-                  $S1[$R0 >>  8 & 0xff] ^
671
-                  $S2[$R0 >> 16 & 0xff] ^
672
-                  $S3[$R0 >> 24 & 0xff];
670
+                    $S1[$R0 >>  8 & 0xff] ^
671
+                    $S2[$R0 >> 16 & 0xff] ^
672
+                    $S3[$R0 >> 24 & 0xff];
673 673
             $t1 = $S0[$R1 >> 24 & 0xff] ^
674
-                  $S1[$R1       & 0xff] ^
675
-                  $S2[$R1 >>  8 & 0xff] ^
676
-                  $S3[$R1 >> 16 & 0xff];
674
+                    $S1[$R1       & 0xff] ^
675
+                    $S2[$R1 >>  8 & 0xff] ^
676
+                    $S3[$R1 >> 16 & 0xff];
677 677
             $R3^= $t0 + ($t1 << 1) + $K[--$ki];
678 678
             $R3 = $R3 >> 1 & 0x7fffffff | $R3 << 31;
679 679
             $R2 = ($R2 >> 31 & 0x1 | $R2 << 1) ^ ($t0 + $t1 + $K[--$ki]);
680 680
 
681 681
             $t0 = $S0[$R2       & 0xff] ^
682
-                  $S1[$R2 >>  8 & 0xff] ^
683
-                  $S2[$R2 >> 16 & 0xff] ^
684
-                  $S3[$R2 >> 24 & 0xff];
682
+                    $S1[$R2 >>  8 & 0xff] ^
683
+                    $S2[$R2 >> 16 & 0xff] ^
684
+                    $S3[$R2 >> 24 & 0xff];
685 685
             $t1 = $S0[$R3 >> 24 & 0xff] ^
686
-                  $S1[$R3       & 0xff] ^
687
-                  $S2[$R3 >>  8 & 0xff] ^
688
-                  $S3[$R3 >> 16 & 0xff];
686
+                    $S1[$R3       & 0xff] ^
687
+                    $S2[$R3 >>  8 & 0xff] ^
688
+                    $S3[$R3 >> 16 & 0xff];
689 689
             $R1^= $t0 + ($t1 << 1) + $K[--$ki];
690 690
             $R1 = $R1 >> 1 & 0x7fffffff | $R1 << 31;
691 691
             $R0 = ($R0 >> 31 & 0x1 | $R0 << 1) ^ ($t0 + $t1 + $K[--$ki]);
@@ -693,9 +693,9 @@  discard block
 block discarded – undo
693 693
 
694 694
         // @codingStandardsIgnoreStart
695 695
         return pack("V4", $K[0] ^ $R2,
696
-                          $K[1] ^ $R3,
697
-                          $K[2] ^ $R0,
698
-                          $K[3] ^ $R1);
696
+                            $K[1] ^ $R3,
697
+                            $K[2] ^ $R0,
698
+                            $K[3] ^ $R1);
699 699
         // @codingStandardsIgnoreEnd
700 700
     }
701 701
 
@@ -835,11 +835,11 @@  discard block
 block discarded – undo
835 835
 
836 836
             $lambda_functions[$code_hash] = $this->_createInlineCryptFunction(
837 837
                 array(
838
-                   'init_crypt'    => $init_crypt,
839
-                   'init_encrypt'  => '',
840
-                   'init_decrypt'  => '',
841
-                   'encrypt_block' => $encrypt_block,
842
-                   'decrypt_block' => $decrypt_block
838
+                    'init_crypt'    => $init_crypt,
839
+                    'init_encrypt'  => '',
840
+                    'init_decrypt'  => '',
841
+                    'encrypt_block' => $encrypt_block,
842
+                    'decrypt_block' => $decrypt_block
843 843
                 )
844 844
             );
845 845
         }
Please login to merge, or discard this patch.
includes/libraries/Authentication/phpseclib/Crypt/Blowfish.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -423,13 +423,13 @@  discard block
 block discarded – undo
423 423
             $l^= $p[$i];
424 424
             $r^= ($sb_0[$l >> 24 & 0xff]  +
425 425
                   $sb_1[$l >> 16 & 0xff]  ^
426
-                  $sb_2[$l >>  8 & 0xff]) +
426
+                    $sb_2[$l >>  8 & 0xff]) +
427 427
                   $sb_3[$l       & 0xff];
428 428
 
429 429
             $r^= $p[$i + 1];
430 430
             $l^= ($sb_0[$r >> 24 & 0xff]  +
431 431
                   $sb_1[$r >> 16 & 0xff]  ^
432
-                  $sb_2[$r >>  8 & 0xff]) +
432
+                    $sb_2[$r >>  8 & 0xff]) +
433 433
                   $sb_3[$r       & 0xff];
434 434
         }
435 435
         return pack("N*", $r ^ $p[17], $l ^ $p[16]);
@@ -458,13 +458,13 @@  discard block
 block discarded – undo
458 458
             $l^= $p[$i];
459 459
             $r^= ($sb_0[$l >> 24 & 0xff]  +
460 460
                   $sb_1[$l >> 16 & 0xff]  ^
461
-                  $sb_2[$l >>  8 & 0xff]) +
461
+                    $sb_2[$l >>  8 & 0xff]) +
462 462
                   $sb_3[$l       & 0xff];
463 463
 
464 464
             $r^= $p[$i - 1];
465 465
             $l^= ($sb_0[$r >> 24 & 0xff]  +
466 466
                   $sb_1[$r >> 16 & 0xff]  ^
467
-                  $sb_2[$r >>  8 & 0xff]) +
467
+                    $sb_2[$r >>  8 & 0xff]) +
468 468
                   $sb_3[$r       & 0xff];
469 469
         }
470 470
         return pack("N*", $r ^ $p[0], $l ^ $p[1]);
@@ -577,11 +577,11 @@  discard block
 block discarded – undo
577 577
 
578 578
             $lambda_functions[$code_hash] = $this->_createInlineCryptFunction(
579 579
                 array(
580
-                   'init_crypt'    => $init_crypt,
581
-                   'init_encrypt'  => '',
582
-                   'init_decrypt'  => '',
583
-                   'encrypt_block' => $encrypt_block,
584
-                   'decrypt_block' => $decrypt_block
580
+                    'init_crypt'    => $init_crypt,
581
+                    'init_encrypt'  => '',
582
+                    'init_decrypt'  => '',
583
+                    'encrypt_block' => $encrypt_block,
584
+                    'decrypt_block' => $decrypt_block
585 585
                 )
586 586
             );
587 587
         }
Please login to merge, or discard this patch.
includes/libraries/Authentication/phpseclib/Crypt/DES.php 1 patch
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -709,13 +709,13 @@  discard block
 block discarded – undo
709 709
         $t = unpack('Nl/Nr', $block);
710 710
         list($l, $r) = array($t['l'], $t['r']);
711 711
         $block = ($shuffleip[ $r        & 0xFF] & "\x80\x80\x80\x80\x80\x80\x80\x80") |
712
-                 ($shuffleip[($r >>  8) & 0xFF] & "\x40\x40\x40\x40\x40\x40\x40\x40") |
713
-                 ($shuffleip[($r >> 16) & 0xFF] & "\x20\x20\x20\x20\x20\x20\x20\x20") |
714
-                 ($shuffleip[($r >> 24) & 0xFF] & "\x10\x10\x10\x10\x10\x10\x10\x10") |
715
-                 ($shuffleip[ $l        & 0xFF] & "\x08\x08\x08\x08\x08\x08\x08\x08") |
716
-                 ($shuffleip[($l >>  8) & 0xFF] & "\x04\x04\x04\x04\x04\x04\x04\x04") |
717
-                 ($shuffleip[($l >> 16) & 0xFF] & "\x02\x02\x02\x02\x02\x02\x02\x02") |
718
-                 ($shuffleip[($l >> 24) & 0xFF] & "\x01\x01\x01\x01\x01\x01\x01\x01");
712
+                    ($shuffleip[($r >>  8) & 0xFF] & "\x40\x40\x40\x40\x40\x40\x40\x40") |
713
+                    ($shuffleip[($r >> 16) & 0xFF] & "\x20\x20\x20\x20\x20\x20\x20\x20") |
714
+                    ($shuffleip[($r >> 24) & 0xFF] & "\x10\x10\x10\x10\x10\x10\x10\x10") |
715
+                    ($shuffleip[ $l        & 0xFF] & "\x08\x08\x08\x08\x08\x08\x08\x08") |
716
+                    ($shuffleip[($l >>  8) & 0xFF] & "\x04\x04\x04\x04\x04\x04\x04\x04") |
717
+                    ($shuffleip[($l >> 16) & 0xFF] & "\x02\x02\x02\x02\x02\x02\x02\x02") |
718
+                    ($shuffleip[($l >> 24) & 0xFF] & "\x01\x01\x01\x01\x01\x01\x01\x01");
719 719
 
720 720
         // Extract L0 and R0.
721 721
         $t = unpack('Nl/Nr', $block);
@@ -732,9 +732,9 @@  discard block
 block discarded – undo
732 732
 
733 733
                 // S-box indexing.
734 734
                 $t = $sbox1[($b1 >> 24) & 0x3F] ^ $sbox2[($b2 >> 24) & 0x3F] ^
735
-                     $sbox3[($b1 >> 16) & 0x3F] ^ $sbox4[($b2 >> 16) & 0x3F] ^
736
-                     $sbox5[($b1 >>  8) & 0x3F] ^ $sbox6[($b2 >>  8) & 0x3F] ^
737
-                     $sbox7[ $b1        & 0x3F] ^ $sbox8[ $b2        & 0x3F] ^ $l;
735
+                        $sbox3[($b1 >> 16) & 0x3F] ^ $sbox4[($b2 >> 16) & 0x3F] ^
736
+                        $sbox5[($b1 >>  8) & 0x3F] ^ $sbox6[($b2 >>  8) & 0x3F] ^
737
+                        $sbox7[ $b1        & 0x3F] ^ $sbox8[ $b2        & 0x3F] ^ $l;
738 738
                 // end of "the Feistel (F) function"
739 739
 
740 740
                 $l = $r;
@@ -749,13 +749,13 @@  discard block
 block discarded – undo
749 749
 
750 750
         // Perform the inverse IP permutation.
751 751
         return ($shuffleinvip[($r >> 24) & 0xFF] & "\x80\x80\x80\x80\x80\x80\x80\x80") |
752
-               ($shuffleinvip[($l >> 24) & 0xFF] & "\x40\x40\x40\x40\x40\x40\x40\x40") |
753
-               ($shuffleinvip[($r >> 16) & 0xFF] & "\x20\x20\x20\x20\x20\x20\x20\x20") |
754
-               ($shuffleinvip[($l >> 16) & 0xFF] & "\x10\x10\x10\x10\x10\x10\x10\x10") |
755
-               ($shuffleinvip[($r >>  8) & 0xFF] & "\x08\x08\x08\x08\x08\x08\x08\x08") |
756
-               ($shuffleinvip[($l >>  8) & 0xFF] & "\x04\x04\x04\x04\x04\x04\x04\x04") |
757
-               ($shuffleinvip[ $r        & 0xFF] & "\x02\x02\x02\x02\x02\x02\x02\x02") |
758
-               ($shuffleinvip[ $l        & 0xFF] & "\x01\x01\x01\x01\x01\x01\x01\x01");
752
+                ($shuffleinvip[($l >> 24) & 0xFF] & "\x40\x40\x40\x40\x40\x40\x40\x40") |
753
+                ($shuffleinvip[($r >> 16) & 0xFF] & "\x20\x20\x20\x20\x20\x20\x20\x20") |
754
+                ($shuffleinvip[($l >> 16) & 0xFF] & "\x10\x10\x10\x10\x10\x10\x10\x10") |
755
+                ($shuffleinvip[($r >>  8) & 0xFF] & "\x08\x08\x08\x08\x08\x08\x08\x08") |
756
+                ($shuffleinvip[($l >>  8) & 0xFF] & "\x04\x04\x04\x04\x04\x04\x04\x04") |
757
+                ($shuffleinvip[ $r        & 0xFF] & "\x02\x02\x02\x02\x02\x02\x02\x02") |
758
+                ($shuffleinvip[ $l        & 0xFF] & "\x01\x01\x01\x01\x01\x01\x01\x01");
759 759
     }
760 760
 
761 761
     /**
@@ -1230,13 +1230,13 @@  discard block
 block discarded – undo
1230 1230
             $t = unpack('Nl/Nr', $key);
1231 1231
             list($l, $r) = array($t['l'], $t['r']);
1232 1232
             $key = ($this->shuffle[$pc1map[ $r        & 0xFF]] & "\x80\x80\x80\x80\x80\x80\x80\x00") |
1233
-                   ($this->shuffle[$pc1map[($r >>  8) & 0xFF]] & "\x40\x40\x40\x40\x40\x40\x40\x00") |
1234
-                   ($this->shuffle[$pc1map[($r >> 16) & 0xFF]] & "\x20\x20\x20\x20\x20\x20\x20\x00") |
1235
-                   ($this->shuffle[$pc1map[($r >> 24) & 0xFF]] & "\x10\x10\x10\x10\x10\x10\x10\x00") |
1236
-                   ($this->shuffle[$pc1map[ $l        & 0xFF]] & "\x08\x08\x08\x08\x08\x08\x08\x00") |
1237
-                   ($this->shuffle[$pc1map[($l >>  8) & 0xFF]] & "\x04\x04\x04\x04\x04\x04\x04\x00") |
1238
-                   ($this->shuffle[$pc1map[($l >> 16) & 0xFF]] & "\x02\x02\x02\x02\x02\x02\x02\x00") |
1239
-                   ($this->shuffle[$pc1map[($l >> 24) & 0xFF]] & "\x01\x01\x01\x01\x01\x01\x01\x00");
1233
+                    ($this->shuffle[$pc1map[($r >>  8) & 0xFF]] & "\x40\x40\x40\x40\x40\x40\x40\x00") |
1234
+                    ($this->shuffle[$pc1map[($r >> 16) & 0xFF]] & "\x20\x20\x20\x20\x20\x20\x20\x00") |
1235
+                    ($this->shuffle[$pc1map[($r >> 24) & 0xFF]] & "\x10\x10\x10\x10\x10\x10\x10\x00") |
1236
+                    ($this->shuffle[$pc1map[ $l        & 0xFF]] & "\x08\x08\x08\x08\x08\x08\x08\x00") |
1237
+                    ($this->shuffle[$pc1map[($l >>  8) & 0xFF]] & "\x04\x04\x04\x04\x04\x04\x04\x00") |
1238
+                    ($this->shuffle[$pc1map[($l >> 16) & 0xFF]] & "\x02\x02\x02\x02\x02\x02\x02\x00") |
1239
+                    ($this->shuffle[$pc1map[($l >> 24) & 0xFF]] & "\x01\x01\x01\x01\x01\x01\x01\x00");
1240 1240
             $key = unpack('Nc/Nd', $key);
1241 1241
             $c = ( $key['c'] >> 4) & 0x0FFFFFFF;
1242 1242
             $d = (($key['d'] >> 4) & 0x0FFFFFF0) | ($key['c'] & 0x0F);
@@ -1253,9 +1253,9 @@  discard block
 block discarded – undo
1253 1253
 
1254 1254
                 // Perform the PC-2 transformation.
1255 1255
                 $cp = $pc2mapc1[ $c >> 24        ] | $pc2mapc2[($c >> 16) & 0xFF] |
1256
-                      $pc2mapc3[($c >>  8) & 0xFF] | $pc2mapc4[ $c        & 0xFF];
1256
+                        $pc2mapc3[($c >>  8) & 0xFF] | $pc2mapc4[ $c        & 0xFF];
1257 1257
                 $dp = $pc2mapd1[ $d >> 24        ] | $pc2mapd2[($d >> 16) & 0xFF] |
1258
-                      $pc2mapd3[($d >>  8) & 0xFF] | $pc2mapd4[ $d        & 0xFF];
1258
+                        $pc2mapd3[($d >>  8) & 0xFF] | $pc2mapd4[ $d        & 0xFF];
1259 1259
 
1260 1260
                 // Reorder: odd bytes/even bytes. Push the result in key schedule.
1261 1261
                 $val1 = ( $cp        & 0xFF000000) | (($cp <<  8) & 0x00FF0000) |
@@ -1440,11 +1440,11 @@  discard block
 block discarded – undo
1440 1440
             // Creates the inline-crypt function
1441 1441
             $lambda_functions[$code_hash] = $this->_createInlineCryptFunction(
1442 1442
                 array(
1443
-                   'init_crypt'    => $init_crypt,
1444
-                   'init_encrypt'  => $init_encrypt,
1445
-                   'init_decrypt'  => $init_decrypt,
1446
-                   'encrypt_block' => $crypt_block[self::ENCRYPT],
1447
-                   'decrypt_block' => $crypt_block[self::DECRYPT]
1443
+                    'init_crypt'    => $init_crypt,
1444
+                    'init_encrypt'  => $init_encrypt,
1445
+                    'init_decrypt'  => $init_decrypt,
1446
+                    'encrypt_block' => $crypt_block[self::ENCRYPT],
1447
+                    'decrypt_block' => $crypt_block[self::DECRYPT]
1448 1448
                 )
1449 1449
             );
1450 1450
         }
Please login to merge, or discard this patch.