Here this is the smallest workaround the problem for this case like what OP presented.
the modification are only in DECHashAuthentication.pas
Code:
function ValidAuthHash(HashClass: TDECHashClass): TDECHashAuthenticationClass;
procedure SetDefaultAuthHashClass(HashClass: TDECHashClass);
implementation
uses
DECUtil;
resourcestring
sAuthHashNoDefault = 'No default hash has been registered';
var
FDefaultAutheticationHashClass: TDECHashAuthenticationClass = nil;
function ValidAuthHash(HashClass: TDECHashClass): TDECHashAuthenticationClass;
begin
if Assigned(HashClass) then
Result := TDECHashAuthenticationClass(HashClass)
else
Result := FDefaultAutheticationHashClass;
if not Assigned(Result) then
raise EDECHashException.CreateRes(@sAuthHashNoDefault);
end;
procedure SetDefaultAuthHashClass(HashClass: TDECHashClass);
begin
Assert(Assigned(HashClass), 'Do not set a nil default hash class!');
FDefaultAutheticationHashClass := TDECHashAuthenticationClass(HashClass);
end;
For (legacy) code like haentschman the need is to add DECHashAuthentication in uses clause and use ValidAuthHash instead ValidHash.
BUT, they are named/called AuthHash while in fact they are just key deriving methods/algorithms, so.... (i am lousy at naming) ... find a better naming as i took the class name only while the functionality has nothing to do with authentication though.