mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-30 10:41:15 +02:00
fcl-web: fpjwarsa: catch exceptions during verification
This commit is contained in:
parent
37d107a953
commit
120303576b
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user