fcl-web: fpjwarsa: catch exceptions during verification

This commit is contained in:
mattias 2022-05-03 01:51:56 +02:00
parent 37d107a953
commit 120303576b

View File

@ -164,6 +164,7 @@ begin
Result:=false;
if aJWT='' then exit;
try
if not GetParts(aJWT,aHeader,theClaims,aSignature) then exit;
if aSignature='' then exit;
@ -182,6 +183,8 @@ begin
finally
RSAFree(RSA);
end;
except
end;
end;
{ TJWTSignerRS512 }
@ -268,6 +271,7 @@ begin
Result:=false;
if aJWT='' then exit;
try
if not GetParts(aJWT,aHeader,theClaims,aSignature) then exit;
if aSignature='' then exit;
@ -294,6 +298,8 @@ begin
// check decrypted hash and actual hash fit
Result:=(length(DecryptedHash)=length(ActualHash))
and CompareMem(@DecryptedHash[0],@ActualHash[0],length(DecryptedHash));
except
end;
end;
initialization