1
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2025-11-23 11:22:22 +03:00

phpcs insists on some brace changes

This commit is contained in:
David Goodwin
2021-04-13 21:19:16 +01:00
parent bbec16aac1
commit 2edabc3e03
60 changed files with 926 additions and 466 deletions

View File

@@ -16,18 +16,21 @@ class Crypt
protected $size;
public function __construct($plaintext) {
public function __construct($plaintext)
{
$this->plain = $plaintext;
}
/**
* @return bool
*/
public function crypt($algorithm) {
public function crypt($algorithm)
{
return true;
}
public function get() {
public function get()
{
return $this->password;
}
}

View File

@@ -48,7 +48,8 @@ class DovecotCrypt extends Crypt
public function crypt($algorithm) {
public function crypt($algorithm)
{
if (!array_key_exists($algorithm, $this->password_schemes)) {
$this->errormsg[] = "This password scheme isn't supported. Check our Wiki!";
return false;
@@ -62,7 +63,8 @@ class DovecotCrypt extends Crypt
return true;
}
public function verify($algorithm, $password) {
public function verify($algorithm, $password)
{
if (!array_key_exists($algorithm, $this->password_schemes)) {
$this->errormsg[] = "This password scheme isn't supported. Check our Wiki!";
return false;
@@ -78,22 +80,28 @@ class DovecotCrypt extends Crypt
return $this->$func($this->plain, $password);
}
private function __crypt_verify($plaintext, $password) {
private function __crypt_verify($plaintext, $password)
{
$crypted = crypt($plaintext, $password);
return strcmp($crypted, $password) == 0;
}
private function __crypt_generate($plaintext) {
private function __crypt_generate($plaintext)
{
$password = crypt($plaintext);
return $password;
}
private function __md5_generate($plaintext) {
private function __md5_generate($plaintext)
{
return $plaintext;
}
private function __sha1_generate() {
private function __sha1_generate()
{
}
private function __plain_generate() {
private function __plain_generate()
{
}
private function __cram_md5_generate($plaintext) {
private function __cram_md5_generate($plaintext)
{
#http://hg.dovecot.org/dovecot-1.2/file/84373d238073/src/lib/hmac-md5.c
#http://hg.dovecot.org/dovecot-1.2/file/84373d238073/src/auth/password-scheme.c cram_md5_generate
@@ -110,7 +118,8 @@ class DovecotCrypt extends Crypt
/**
* @return string
*/
public function custom_hmac($algo, $data, $key, $raw_output = false) {
public function custom_hmac($algo, $data, $key, $raw_output = false)
{
$algo = strtolower($algo);
$pack = 'H'.strlen($algo('test'));
$size = 64;