forked from wolfSSL/wolfssl
Ada: fix issues in tls_server.adb detected by gnatprove
Checked with: ``` gnatprove -Pdefault.gpr --level=4 -j12 ```
This commit is contained in:
@ -139,10 +139,6 @@ package body Tls_Server with SPARK_Mode is
|
|||||||
return 0;
|
return 0;
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
put_line (Interfaces.C.Strings.Value
|
|
||||||
(Item => Identity,
|
|
||||||
Length => Identity_String'Length) );
|
|
||||||
|
|
||||||
Interfaces.C.Strings.Update
|
Interfaces.C.Strings.Update
|
||||||
(Item => Key,
|
(Item => Key,
|
||||||
Offset => 0,
|
Offset => 0,
|
||||||
@ -261,13 +257,15 @@ package body Tls_Server with SPARK_Mode is
|
|||||||
if not PSK then
|
if not PSK then
|
||||||
-- Require mutual authentication.
|
-- Require mutual authentication.
|
||||||
WolfSSL.Set_Verify
|
WolfSSL.Set_Verify
|
||||||
(Context => Ctx,
|
(Context => Ctx,
|
||||||
Mode => WolfSSL.Verify_Peer or WolfSSL.Verify_Fail_If_No_Peer_Cert);
|
Mode => WolfSSL.Verify_Peer or WolfSSL.Verify_Fail_If_No_Peer_Cert);
|
||||||
|
|
||||||
-- Check verify is set correctly (GitHub #7461)
|
-- Check verify is set correctly (GitHub #7461)
|
||||||
if WolfSSL.Get_Verify(Context => Ctx) /= (WolfSSL.Verify_Peer or WolfSSL.Verify_Fail_If_No_Peer_Cert) then
|
if WolfSSL.Get_Verify(Context => Ctx) /= (WolfSSL.Verify_Peer or WolfSSL.Verify_Fail_If_No_Peer_Cert) then
|
||||||
Put ("Error: Verify does not match requested");
|
Put_Line ("Error: Verify does not match requested");
|
||||||
New_Line;
|
SPARK_Sockets.Close_Socket (L);
|
||||||
|
WolfSSL.Free (Context => Ctx);
|
||||||
|
Set (Exit_Status_Failure);
|
||||||
return;
|
return;
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user