checks given password

In case the password does not satisfy the return value is a list of
error ids.

@param   \stubbles\values\Secret  $proposedPassword
@return  array
779594
public function check(Secret $proposedPassword): array
    {
        $errors = [];
        if ($proposedPassword->length() < $this->minLength) {
            $errors['PASSWORD_TOO_SHORT'] = ['minLength' => $this->minLength];
        }

        if (in_array($proposedPassword->unveil(), $this->disallowedValues)) {
            $errors['PASSWORD_DISALLOWED'] = [];
        }

        if (null !== $this->minDiffChars && count(count_chars($proposedPassword->unveil(), 1)) < $this->minDiffChars) {
            $errors['PASSWORD_TOO_LESS_DIFF_CHARS'] = ['minDiff' => $this->minDiffChars];
        }

        return $errors;
    }
512178
protected function normalizePassword($password)
    {
        $obj = [];

        if (is_array($password)) {
            $obj['id'] = $password['id'];
            $obj['encryption'] = (isset($password['secret']) && $password['secret'] !== null)
                ? $password['secret']
                : $password['encryption'];
            $obj['integrity'] = (isset($password['secret']) && $password['secret'] !== null)
                ? $password['secret']
                : $password['integrity'];
        } else { // password is a string
            $obj['encryption'] = $password;
            $obj['integrity'] = $password;
        }

        return $obj;
    }
75690
public function validatePassword( $password ) {

		if( isset( $password ) && isset( $this->passwordHash ) ) {

			return Yii::$app->getSecurity()->validatePassword( $password, $this->passwordHash );
		}

		return false;
	}
375257
public function getUserAuthenticationConfiguration($email, $password) 
    {
        return [
        'grant_type'    => 'password',
        'client_id'     => $this->getClientId(),
        'client_secret' => $this->getClientSecret(),
        'username'      => $email,
        'password'      => $password,
        'scope'         => $this->getScopes(),
        ];
    }
586011
public function checkPass($password = null)
  {
    if($password === null) {
      $password = $this->pass;
    }

    if(strlen($password) == 0)
    {
      return TRUE;
    }

    $pattern = "/^(" . $this->regex["alphanum"]  . "|" . $this->regex["mark"] . "|" . $this->regex["escaped"] . "|[;:&=+$,])+$/";
    $status = @preg_match($pattern, $password);

    if($status === FALSE)
    {
      throw new TeamSpeak3_Helper_Exception("URI password validation failed");
    }

    return ($status == 1);
  }
582954
public static function compareAccept(string $accept, array $available)
    {
        $result = [];
        foreach (static::parseAccept($accept) as $type => $priority) {
            if (strpos($type, '*') === false) {
                if (in_array($type, $available)) {
                    $result[$type] = max($result[$type] ?? 0, $priority);
                }
            } else {
                foreach ($available as $available_type) {
                    if (fnmatch($type, $available_type)) {
                        $result[$available_type] = max(
                            $result[$available_type] ?? 0,
                            $priority
                        );
                    }
                }
            }
        }
        return $result;
    }
1058511
public function check($value, $hashedValue, array $options = [])
    {
        $userId = isset($options['user_id']) ? $options['user_id'] : '';

        return wp_check_password($value, $hashedValue, $userId);
    }
967183
public function checkClientCredentials($client_id, $client_secret = null)
    {
        $result = $this->collection('client_table')->findOne(array('client_id' => $client_id));

        return $result['client_secret'] == $client_secret;
    }
401442
private function getPassword()
    {
        $password = $this->secret("Enter your password");
        $passwordAgain = $this->secret("Enter your password again");

        $validator = Validator::make([
            'password'              => $password,
            'password_confirmation' => $passwordAgain,
        ], [
            'password' => 'required|min:5|confirmed',
        ]);

        if( $validator->fails() ) {
            $this->info('');
            $this->error("The password must be at least 5 characters and must match!");
            $this->info('');

            return $this->getPassword();
        }

        $this->password = bcrypt($password);
    }
1056230
private function removeValuesWithPasswordKeys($array, &$passwordRemoved = false)
    {
        foreach ($array as $key => $value) {
            if (is_array($value)) {
                $value = $this->removeValuesWithPasswordKeys($value, $removedChild);
                if ($removedChild) {
                    $array[$key] = $value;
                    $passwordRemoved = true;
                }
            } else {
                foreach ($this->auditRequestIgnoreKeys as $ignoreKey) {
                    if (stripos($key, $ignoreKey) !== false) {
                        $array[$key] = '*password removed*';
                        $passwordRemoved = true;
                        continue;
                    }
                }
            }
        }
        return $array;
    }
1320067
public function validatePassword($plaintext, $hashed)
	{
		// Use the password extension if able
		if (version_compare(PHP_VERSION, '7.2', '>=') && \defined('PASSWORD_ARGON2I'))
		{
			return password_verify($plaintext, $hashed);
		}

		// Use the sodium extension (PHP 7.2 native or PECL 2.x) if able
		if (\function_exists('sodium_crypto_pwhash_str_verify'))
		{
			$valid = sodium_crypto_pwhash_str_verify($hashed, $plaintext);
			sodium_memzero($plaintext);

			return $valid;
		}

		// Use the libsodium extension (PECL 1.x) if able
		if (\extension_loaded('libsodium'))
		{
			$valid = \Sodium\crypto_pwhash_str_verify($hashed, $plaintext);
			\Sodium\memzero($plaintext);

			return $valid;
		}

		throw new \LogicException('Argon2i algorithm is not supported.');
	}
348968
protected function validateUserPasswordInstall()
    {
        $field = 'user.password';

        if ($this->isExcluded($field)) {
            return null;
        }

        $value = $this->getSubmitted($field);
        $label = $this->translation->text('Password');

        if (empty($value)) {
            $this->setErrorRequired($field, $label);
            return false;
        }

        list($min, $max) = $this->user->getPasswordLength();

        $length = mb_strlen($value);

        if ($length < $min || $length > $max) {
            $this->setErrorLengthRange($field, $label, $min, $max);
            return false;
        }

        return true;
    }
759441
public static function match($password, array $userInputs = [])
    {
        // Translate l33t password and dictionary match the translated password.
        $map = static::getSubstitutions($password);
        $indexSubs = array_filter($map);
        if (empty($indexSubs)) {
            return [];
        }
        $translatedWord = static::translate($password, $map);

        $matches = [];
        $dicts = static::getRankedDictionaries();
        foreach ($dicts as $name => $dict) {
            $results = static::dictionaryMatch($translatedWord, $dict);
            foreach ($results as $result) {
                // Set substituted elements.
                $result['sub'] = [];
                $result['sub_display'] = [];
                foreach ($indexSubs as $i => $t) {
                    $result['sub'][$password[$i]] = $t;
                    $result['sub_display'][] = "{$password[$i]} -> ${t}";
                }
                $result['sub_display'] = implode(', ', $result['sub_display']);
                $result['dictionary_name'] = $name;
                // Replace translated token with orignal password token.
                $token = substr($password, $result['begin'], $result['end'] - $result['begin'] + 1);
                $matches[] = new static($password, $result['begin'], $result['end'], $token, $result);
            }
        }

        return $matches;
    }
19325
public function passwords($pass1, $pass2, $id) {
        if ($pass1 !== $pass2) {
            $this->add($id, 'The passwords you entered do not match.');
            return false;
        }

        return true;
    }
116083
public static function attempt(array $data, ?array $hidden = null, ?string $provider = null)
  {
    if ($provider != null) Auth::provider($provider);

    $model = '\\' . config('auth.provider.' . Auth::$provider . '.model');

    $model = new $model;

    try {
      $protected = config('auth.provider.' . Auth::$provider . '.protects');
    }
    catch (Exception $e) {
      throw new Exception("The \"" . Auth::$provider . "\" provider doesn't protect any field.");
    }

    $protects = $data[$protected];

    unset($data[$protected]);

    $first = null;

    foreach ($data as $key => $value) {
      if (!in_array($key, $hidden)) {
        if ($first == null) $first = $key;
        $model = $model->where($key, $value);
      }
    }

    $model = $model->first();

    if ($model == null) return [$first => $protected . " or " . $first . " is incorrect."];

    $secretInformation = password_get_info($model->{$protected});

    if ($secretInformation['algoName'] == 'unknown' && $secretInformation['options'] == []) {
      if ($model->{$protected} !== $protects) return [$first => $protected . " or " . $first . " is incorrect."];
    }
    else {
      if (!password_verify($protects, $model->{$protected})) return [$first => $protected . " or " . $first . " is incorrect."];
    }

    return $model;
  }
564828
public function form_password($params) {
        if (!isset($params['field'])) {
            throw new \UnexpectedValueException("The field parameter is required.");
        }
        $value = isset($params['value']) ? $params['value'] : null;
        $attributes = isset($params['attrs']) ? $params['attrs'] : array();
        return Form::password($params['field'], $value, $attributes);
    }
1302332
protected function suggestSshRemedies()
    {
        $sshKeys = [];
        try {
            $sshKeys = $this->api()->getClient(false)->getSshKeys();
        } catch (\Exception $e) {
            // Ignore exceptions.
        }

        if (!empty($sshKeys)) {
            $this->stdErr->writeln('');
            $this->stdErr->writeln('Please check your SSH credentials');
            $this->stdErr->writeln(sprintf(
                'You can list your keys with: <comment>%s ssh-keys</comment>',
                $this->config()->get('application.executable')
            ));
        } else {
            $this->stdErr->writeln(sprintf(
                'You probably need to add an SSH key, with: <comment>%s ssh-key:add</comment>',
                $this->config()->get('application.executable')
            ));
        }
    }