Validates the MD5 signature and, if enabled, the SHA2 signature.

@return bool
774517
protected function validateSignatures()
    {
        if (!$this->testMdSignatures()) {
            return false;
        }

        if ($this->getSha2Signature() !== null) {
            return $this->getSha2Signature() === $this->calculateSha2Signature();
        }

        return true;
    }
377381
protected function checkPasswords()
    {
        if($this->getOriginal('password') != $this->password){

            if($this->password === $this->password_confirmation){

                // Hashes password and unset password_confirmation field
                $this->password = bcrypt($this->password);

                unset($this->password_confirmation);

            } else {

                return false;
            }

        }

        return true;
    }
1022125
public function isValid(SignatureComposer $composer)
    {
        // Constant Time String Comparison @see http://php.net/hash_equals
        if (!function_exists('hash_equals')) {
            // Polyfill for PHP < 5.6
            return Security::hashEquals($composer->compose($this->parameters), $this->signature);
        } else {
            return hash_equals($composer->compose($this->parameters), $this->signature);
        }
    }
335355
private function validateDifferentPreviousAll(): bool
    {
        if ($this->options['require-different-than-previous-all'] === true) {
            $passwordHash = (string)$this->value;
            foreach ($this->options['stored-passwords'] as $storedPassword) {
                if (PasswordEnctyption::compare($passwordHash, $storedPassword)) {
                    $this->setError(self::VALIDATOR_ERROR_PASSWORD_MUST_BE_DIFFERENT_THAN_PREVIOUS_ALL);
                    return false;
                }
            }
        }
        return true;
    }
798541
private function isCheckMD5($options)
    {
        return $this->getValue($options, self::OSS_CHECK_MD5, false, true, true);
    }
435976
public function valid()
    {
        if ($this->fileSize == 0) {
            return false;
        }

        if (feof($this->handle)) {
            return false;
        }

        $current = fgets($this->handle);

        if (trim($current) === '' && feof($this->handle)) {
            return false;
        } else {
            fseek($this->handle, $this->offset);
        }

        return true;
    }
827669
public function verify()
    {
        if (!$this->_config['enable']) {
            return true;
        }

        $controller = $this->_registry->getController();
        if ($controller->request->getData('g-recaptcha-response')) {
            $response = json_decode($this->apiCall());

            if (isset($response->success)) {
                return $response->success;
            }
        }

        return false;
    }
816430
public function verify()
    {
        $files     = $this->filesystem->allFiles(base_path('src'));
        $memory    = app('antares.memory')->make('checksum');
        $checksums = $memory->all();
        $updates   = [];
        $allFiles  = [];
        foreach ($files as $file) {
            $key            = $file->getRelativePath() . DIRECTORY_SEPARATOR . $file->getFilename();
            $checksum       = md5_file($file->getRealPath());
            $allFiles[$key] = $checksum;
            if (isset($checksums[$key]) && $checksums[$key] !== $checksum) {
                $updates[$key] = $checksum;
            }
        }
        $inserts = array_diff(array_keys($allFiles), array_keys($checksums));
        $deletes = array_diff(array_keys($checksums), array_keys($allFiles));

        $return = ['inserts' => $inserts, 'updates' => $updates, 'deletes' => $deletes];
        $this->validate($return);
        return $return;
    }
403380
public function verify()
    {
        $phpversion = phpversion();
        $extensions = get_loaded_extensions();
        $ini        = array_only(ini_get_all(), ['max_execution_time', 'max_file_uploads', 'max_input_time', 'post_max_size', 'upload_max_filesize']);

        $return              = [
            'version'    => $phpversion,
            'transports' => implode(', ', stream_get_transports()),
            'filters'    => implode(', ', stream_get_filters()),
            'doc_root'   => getcwd(),
            'extensions' => $extensions,
            'ini'        => $ini,
        ];
        $this->configuration = $return;
        $this->validate($return);
        return $return;
    }
295453
protected function validSecret()
    {
        // this method is intentionally broken in two pieces
        // so the logic will be loud and clear.

        // is the secret empty?
        if (empty($this->secret)) {
            return false;
        }

        // created a hex representation of the secret.
        $hexRepresentation = bin2hex($this->secret);

        // check for the secret's hex representation length...
        // hex size is deterministic, it's a way of counting bytes from binary
        // ( SORT OF)
        // in any case, the length will double of the binary random generated secret.
        // 16 bytes secret will have a hex of length 32
        // 32 bytes secret will have a hex of length 64
        // 64 bytes secret will have a hex of length 128
        // you get it right?
        if ((Str::length($hexRepresentation) / 2) < 16) {
            // the minimum secret size should be 16
            // so return false in case the secret
            // is shorter than that.
            return false;
        }

        // after all this checks, declare the secret valid (finally).
        return true;
    }
630456
public function isAuthenticated()
    {
        $authenticated = false;

        if (is_null($this->parameters)) {
            return $authenticated;
        }

        $calculatedHash = md5(
            $this->parameters['item'] . '|' .
            $this->parameters['page'] . '|' .
            $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey']
        );

        if ($this->parameters['hash'] === $calculatedHash) {
            $authenticated = true;
        }

        return $authenticated;
    }
996661
public function valid()
        {
            // Return true if and only if all parts of the URI have passed validation
            return $this->validateUsername()
               && $this->validatePassword()
               && $this->validateHost()
               && $this->validatePort()
               && $this->validatePath()
               && $this->validateQuery()
               && $this->validateFragment();
        }
497304
private function _checkSignature(): bool
    {
        $secret           = $this->getSecret();
        $httpHubSignature = $this->serverBag->get('HTTP_X_HUB_SIGNATURE');

        if (null !== $secret) {
            if ($httpHubSignature) {
                /**
                 * Split signature into algorithm and hash
                 *
                 * @link http://isometriks.com/verify-github-webhooks-with-php
                 */
                list(, $hash) = explode('=', $httpHubSignature, 2);

                return $secret == $hash;
            }

            throw new BadSignatureException('HTTP header "X-Hub-Signature" is missing.');
        }

        return true;
    }
213652
public function validateRequest()
    {
        $request = $this->framework->getRequest();
        
        // Parse the authorization information
        $authorization = $this->parseAuthorizationString($request->getHeader('Authorization'));
        $publicKey = $authorization['publicKey'];
        $hmac = $authorization['hmac'];
        
        // Verify the public key
        if (!$this->tokenManager->hasTokenForPublicKey($publicKey)) {
            return false;
        }
        
        // Load the token
        $token = $this->tokenManager->getTokenForPublicKey($publicKey);
        
        // Get the needed data
        $route = $request->getRoute();
        $data = $request->getParams();
        
        $result = $this->restHelper->validateRequest($token->getApiKey(), $hmac, $route, $data);
        
        if ($result) {
            return $token;
        }
        
        return false;
    }
1181224
protected function validatePasswordLengthUser()
    {
        $field = 'password';

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

        $value = $this->getSubmitted($field);

        if ($this->isUpdating() && (!isset($value) || $value === '')) {
            return null;
        }

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

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

        return true;
    }
1092795
protected function validateKey()
    {
        if (\is_string($key = $this->key)) {
            if (\substr($key, 0, 7) !== 'file://') {
                $key = 'file://' . $key;
            }

            $this->key = \openssl_get_privatekey($key, $this->passphrase ?: '');
        }

        if (!\is_resource($this->key)) {
            throw new JWTException('Invalid key: Should be resource of private key', static::ERROR_KEY_INVALID);
        }
    }
260448
public function verify(): bool
    {
        $factory = new PublicKeyFactory;

        return $factory->fromHex($this->publicKey)->verify(
            new Buffer(hash('sha256', $this->message, true)),
            SignatureFactory::fromHex($this->signature)
        );
    }