mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-06 01:40:48 +02:00
40d3befa61
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>
82 lines
2.2 KiB
Plaintext
82 lines
2.2 KiB
Plaintext
with "config/wolfssl_config.gpr";
|
|
|
|
library project WolfSSL is
|
|
|
|
for Library_Name use "wolfssl";
|
|
|
|
for Languages use ("C", "Ada");
|
|
|
|
for Source_Dirs use (".",
|
|
"../../",
|
|
"../../src",
|
|
"../../wolfcrypt/src");
|
|
|
|
for Object_Dir use "obj";
|
|
for Library_Dir use "lib";
|
|
for Create_Missing_Dirs use "True";
|
|
|
|
type Library_Type_Type is ("relocatable", "static", "static-pic");
|
|
Library_Type : Library_Type_Type := external("LIBRARY_TYPE", "static");
|
|
for Library_Kind use Library_Type;
|
|
|
|
package Naming is
|
|
for Spec_Suffix ("C") use ".h";
|
|
end Naming;
|
|
|
|
C_Compiler_Config := ();
|
|
|
|
case Wolfssl_Config.STATIC_PSK is
|
|
when "True" =>
|
|
C_Compiler_Config :=
|
|
("-DWOLFSSL_STATIC_PSK" -- Enable the static PSK cipher support
|
|
);
|
|
when others =>
|
|
C_Compiler_Config := ();
|
|
end case;
|
|
|
|
package Compiler is
|
|
for Switches ("C") use C_Compiler_Config &
|
|
("-DWOLFSSL_USER_SETTINGS", -- Use the user_settings.h file.
|
|
"-Wno-pragmas",
|
|
"-Wall",
|
|
"-Wextra",
|
|
"-Wunknown-pragmas",
|
|
"--param=ssp-buffer-size=1",
|
|
"-Waddress",
|
|
"-Warray-bounds",
|
|
"-Wbad-function-cast",
|
|
"-Wchar-subscripts",
|
|
"-Wcomment",
|
|
"-Wfloat-equal",
|
|
"-Wformat-security",
|
|
"-Wformat=2",
|
|
"-Wmaybe-uninitialized",
|
|
"-Wmissing-field-initializers",
|
|
"-Wmissing-noreturn",
|
|
"-Wmissing-prototypes",
|
|
"-Wnested-externs",
|
|
"-Wnormalized=id",
|
|
"-Woverride-init",
|
|
"-Wpointer-arith",
|
|
"-Wpointer-sign",
|
|
"-Wshadow",
|
|
"-Wsign-compare",
|
|
"-Wstrict-overflow=1",
|
|
"-Wstrict-prototypes",
|
|
"-Wswitch-enum",
|
|
"-Wundef",
|
|
"-Wunused",
|
|
"-Wunused-result",
|
|
"-Wunused-variable",
|
|
"-Wwrite-strings",
|
|
"-fwrapv") & External_As_List ("CFLAGS", " ");
|
|
|
|
for Switches ("Ada") use ("-g") & External_As_List ("ADAFLAGS", " ");
|
|
end Compiler;
|
|
|
|
package Binder is
|
|
for Switches ("Ada") use ("-Es"); -- To include stack traces.
|
|
end Binder;
|
|
|
|
end WolfSSl;
|