pssht  latest
SSH server library written in PHP
Zlib.php
1 <?php
2 
3 /*
4 * This file is part of pssht.
5 *
6 * (c) François Poirotte <clicky@erebot.net>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11 
13 
17 class Zlib extends \fpoirotte\Pssht\Compression\Zlib implements
19 {
21  protected $authenticated;
22 
23  public function __construct($mode)
24  {
25  parent::__construct($mode);
26  $this->authenticated = false;
27  }
28 
29  public static function getName()
30  {
31  return 'zlib@openssh.com';
32  }
33 
34  public function setAuthenticated()
35  {
36  $this->authenticated = true;
37  return $this;
38  }
39 
40  public function update($data)
41  {
42  if ($this->authenticated === false) {
43  return $data;
44  }
45  return parent::update($data);
46  }
47 }
static getName()
Return the name of the algorithm.
Definition: Zlib.php:29
$authenticated
Flag indicating whether user authentication succeeded or not.
Definition: Zlib.php:21
setAuthenticated()
Sets a flag indicating user authentication success.
Definition: Zlib.php:34
$mode
Compression/decompression mode.
Definition: Zlib.php:31