Commit 39b04f02 authored by Benni Mack's avatar Benni Mack Committed by Stefan Neufeind
Browse files

[TASK] Salted Passwords: Add a ComposedSaltInterface

Add another interface, in order to allow to code
against interface instead of abstractions,
so composed salts that implement their own
password-hashing can implement this interface.

Relates: #79795
Relates: #79889
Resolves: #83294
Releases: master
Change-Id: Ica97f695b5f005e7b835078e89d17f8003141b3f
Reviewed-on: https://review.typo3.org/55060

Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: Oliver Klee's avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Nicole Cordes's avatarNicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes's avatarNicole Cordes <typo3@cordes.co>
Reviewed-by: default avatarStefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: default avatarStefan Neufeind <typo3.neufeind@speedpartner.de>
parent ac733c59
......@@ -19,7 +19,7 @@ namespace TYPO3\CMS\Saltedpasswords\Salt;
* Abstract class with methods needed to be extended
* in a salted hashing class that composes an own salted password hash.
*/
abstract class AbstractComposedSalt implements SaltInterface
abstract class AbstractComposedSalt implements ComposedSaltInterface
{
/**
* Method applies settings (prefix, optional hash count, optional suffix)
......
<?php
declare(strict_types=1);
namespace TYPO3\CMS\Saltedpasswords\Salt;
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
/**
* Interface for implementing salts that compose the password-hash string
* themselves.
*/
interface ComposedSaltInterface extends SaltInterface
{
/**
* Returns length of required salt.
*
* @return int Length of required salt
*/
public function getSaltLength(): int;
/**
* Method determines if a given string is a valid salt
*
* @param string $salt String to check
* @return bool TRUE if it's valid salt, otherwise FALSE
*/
public function isValidSalt(string $salt): bool;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment