You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add Ada bindings for SHA-256, RSA sign/verify, and AES-CBC from
wolfCrypt. Use XMALLOC/XFREE for dynamic allocation and add GNATprove
ownership annotations to enable static leak detection.
Refactor the Ada wrapper into a base package (wolfssl.ads) and a child
package (wolfssl-full_runtime) to separate code that depends on
Interfaces.C.Strings and GNAT.Sockets from zero-footprint-compatible
code.
Add standalone examples for SHA-256 hashing, RSA signature verification,
and AES encryption under wrapper/Ada/examples/.
Add AUnit test suites for SHA-256, RSA, and AES bindings under
wrapper/Ada/tests/ with Valgrind suppressions and Alire integration.
Move TLS client/server examples into wrapper/Ada/examples/src/ and
update build files (default.gpr, examples.gpr, include.am) accordingly.
Update CI (ada.yml) to build default.gpr, run AUnit tests, run the
client-server examples, and run GNATprove.
Co-authored-by: Joakim Strandberg <joakim@mequinox.se>
Copy file name to clipboardExpand all lines: wrapper/Ada/README.md
+31-9Lines changed: 31 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,9 +28,9 @@ been developed with maximum portability in mind.
28
28
Not only can the WolfSSL Ada binding be used in Ada applications but
29
29
also SPARK applications (a subset of the Ada language suitable for
30
30
formal verification). To formally verify the Ada code in this repository
31
-
open the examples.gpr with GNAT Studio and then select
31
+
open the examples/examples.gpr with GNAT Studio and then select
32
32
SPARK -> Prove All Sources and use Proof Level 2. Or when using the command
33
-
line, use `gnatprove -Pexamples.gpr --level=4 -j12` (`-j12` is there in
33
+
line, use `gnatprove -Pexamples/examples.gpr --level=4 -j12` (`-j12` is there in
34
34
order to instruct the prover to use 12 CPUs if available).
35
35
36
36
```
@@ -62,6 +62,8 @@ ecosystem. The latest version is available for Windows, OSX, Linux and FreeBSD
62
62
systems. It can install a complete Ada toolchain if needed, see `alr install`
63
63
for more information.
64
64
65
+
**Note:** If you encounter a missing dependency error, it may be caused by the installed dependency being too old. In this case, either install a newer toolchain or decrease the required dependency version in your project.
66
+
65
67
In order to use WolfSSL in a project, just add WolfSSL as a dependency by
66
68
running `alr with wolfssl` within your project's directory.
67
69
@@ -84,28 +86,48 @@ and use gprbuild to build the source code.
84
86
cd wrapper/Ada
85
87
gprclean
86
88
gprbuild default.gpr
89
+
90
+
cd examples
87
91
gprbuild examples.gpr
88
92
89
93
cd obj/
90
94
./tls_server_main &
91
95
./tls_client_main 127.0.0.1
92
96
```
93
97
98
+
If you are using Alire, you can build the library and examples with:
99
+
100
+
```sh
101
+
cd wrapper/Ada
102
+
alr install
103
+
104
+
cd examples
105
+
alr build
106
+
```
107
+
108
+
You can also run the examples directly with Alire:
109
+
110
+
```sh
111
+
cd wrapper/Ada/examples
112
+
alr run tls_server_main &
113
+
alr run tls_client_main --args=127.0.0.1
114
+
```
115
+
94
116
On Windows, build the executables with:
95
117
```sh
96
-
gprbuild -XOS=Windows default.gpr
118
+
cd wrapper/Ada/examples
97
119
gprbuild -XOS=Windows examples.gpr
98
120
```
99
121
100
122
## Files
101
123
The (D)TLS v1.3 client example in the Ada/SPARK programming language
102
124
using the WolfSSL library can be found in the files:
103
-
tls_client_main.adb
104
-
tls_client.ads
105
-
tls_client.adb
125
+
examples/src/tls_client_main.adb
126
+
examples/src/tls_client.ads
127
+
examples/src/tls_client.adb
106
128
107
129
The (D)TLS v1.3 server example in the Ada/SPARK programming language
108
130
using the WolfSSL library can be found in the files:
0 commit comments