Skip to content

Commit 98eda78

Browse files
committed
Ada: fix issues in tls_server.adb detected by gnatprove
Checked with: ``` gnatprove -Pdefault.gpr --level=4 -j12 ```
1 parent bf5009b commit 98eda78

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

wrapper/Ada/tls_server.adb

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,6 @@ package body Tls_Server with SPARK_Mode is
139139
return 0;
140140
end if;
141141

142-
put_line (Interfaces.C.Strings.Value
143-
(Item => Identity,
144-
Length => Identity_String'Length) );
145-
146142
Interfaces.C.Strings.Update
147143
(Item => Key,
148144
Offset => 0,
@@ -261,13 +257,15 @@ package body Tls_Server with SPARK_Mode is
261257
if not PSK then
262258
-- Require mutual authentication.
263259
WolfSSL.Set_Verify
264-
(Context => Ctx,
260+
(Context => Ctx,
265261
Mode => WolfSSL.Verify_Peer or WolfSSL.Verify_Fail_If_No_Peer_Cert);
266262

267263
-- Check verify is set correctly (GitHub #7461)
268264
if WolfSSL.Get_Verify(Context => Ctx) /= (WolfSSL.Verify_Peer or WolfSSL.Verify_Fail_If_No_Peer_Cert) then
269-
Put ("Error: Verify does not match requested");
270-
New_Line;
265+
Put_Line ("Error: Verify does not match requested");
266+
SPARK_Sockets.Close_Socket (L);
267+
WolfSSL.Free (Context => Ctx);
268+
Set (Exit_Status_Failure);
271269
return;
272270
end if;
273271

0 commit comments

Comments
 (0)