Compare commits

..

11 Commits

Author SHA1 Message Date
Antoine
43595de12d build: support 0.15.0-dev
Some checks failed
CI / build (-Dbuild-apps, true, ubuntu-latest, 0.14.1) (push) Has been cancelled
CI / build (macos-latest, 0.14.1) (push) Has been cancelled
CI / build (ubuntu-latest, master) (push) Has been cancelled
CI / build (windows-latest, 0.14.1) (push) Has been cancelled
addStaticLibrary -> addLibrary
target and optimize are now in a module
2025-07-24 23:11:50 +02:00
45ba485901
ci: re-enable zig fmt ast-check 2025-03-05 21:41:01 -07:00
34751eeb87
readme: reorganize version support table 2025-03-05 21:01:20 -07:00
18d16b2663
build: support 0.14.0
Unfortunately, this has irreconcilable incompatibilities with previous
versions of zig, due to the build.zig.zon schema changes. Support for
older versions has been dropped.
2025-03-05 19:17:31 -07:00
Antoine
fd0fe77715 defineCMacro -> addCMacro 2024-12-31 19:06:00 +01:00
7aa9871c8c
readme: update references to 4.0.0
Some checks failed
CI / build (-Dbuild-apps, true, ubuntu-latest, master) (push) Has been cancelled
CI / build (macos-latest, 0.13.0) (push) Has been cancelled
CI / build (ubuntu-latest, 0.12.1) (push) Has been cancelled
CI / build (ubuntu-latest, 0.13.0) (push) Has been cancelled
CI / build (windows-latest, 0.13.0) (push) Has been cancelled
2024-12-05 22:42:42 -07:00
991d09a09e
build: update to libressl-portable v4.0.0 2024-12-05 22:42:42 -07:00
9530f3d561
ci: remove --ast-check from zig format
This works around ziglang/zig#22078 (the ast-check behavior changed
since the last successful CI run). Since we build as part of the job,
this check isn't really necessary anyway, though it certainly is
lighter-weight than trying to compile.
2024-11-26 22:39:23 -07:00
d9d586555e
ci: run against all branches 2024-11-24 18:51:26 -07:00
02abfefee4
package: bump version
Some checks failed
CI / build (-Dbuild-apps, true, ubuntu-latest, master) (push) Has been cancelled
CI / build (macos-latest, 0.13.0) (push) Has been cancelled
CI / build (ubuntu-latest, 0.12.1) (push) Has been cancelled
CI / build (ubuntu-latest, 0.13.0) (push) Has been cancelled
CI / build (windows-latest, 0.13.0) (push) Has been cancelled
2024-10-03 16:24:22 -07:00
Antoine
5ba009c755 Fix unfortunate typo 2024-10-03 16:31:34 +02:00
5 changed files with 227 additions and 256 deletions

View File

@ -2,8 +2,6 @@ name: CI
on: on:
push: push:
branches:
- master
pull_request: pull_request:
branches: branches:
- master - master
@ -14,22 +12,24 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
zig-version: ["0.13.0"] zig-version: ["0.14.1"]
os: [ubuntu-latest, macos-latest, windows-latest] os: [macos-latest, windows-latest]
include: include:
- zig-version: "0.12.1" - zig-version: "0.14.1"
os: ubuntu-latest
- zig-version: "master"
check-format: true check-format: true
os: ubuntu-latest os: ubuntu-latest
build-options: "-Dbuild-apps" build-options: "-Dbuild-apps"
- zig-version: "master"
os: ubuntu-latest
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Setup Zig - name: Setup Zig
uses: mlugg/setup-zig@v1 uses: mlugg/setup-zig@v2
with: with:
version: ${{ matrix.zig-version }} version: ${{ matrix.zig-version }}

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.zig-cache
zig-out

431
build.zig
View File

@ -11,36 +11,30 @@ pub fn build(b: *std.Build) !void {
const upstream = b.dependency("libressl", .{}); const upstream = b.dependency("libressl", .{});
const libressl_common: LibreSslCommon = .{ const libressl_common: LibreSslCommon = .{
.libcrypto = b.addStaticLibrary(.{ .libcrypto = b.addLibrary(.{
.name = "cypto", .name = "crypto",
.target = target, .root_module = b.createModule(.{ .target = target, .optimize = optimize }),
.optimize = optimize,
}), }),
.libssl = b.addStaticLibrary(.{ .libssl = b.addLibrary(.{
.name = "ssl", .name = "ssl",
.target = target, .root_module = b.createModule(.{ .target = target, .optimize = optimize }),
.optimize = optimize,
}), }),
.libtls = b.addStaticLibrary(.{ .libtls = b.addLibrary(.{
.name = "tls", .name = "tls",
.target = target, .root_module = b.createModule(.{ .target = target, .optimize = optimize }),
.optimize = optimize,
}), }),
.apps = .{ .apps = .{
.nc = b.addExecutable(.{ .nc = b.addExecutable(.{
.name = "nc", .name = "nc",
.target = target, .root_module = b.createModule(.{ .target = target, .optimize = optimize }),
.optimize = optimize,
}), }),
.ocspcheck = b.addExecutable(.{ .ocspcheck = b.addExecutable(.{
.name = "ocspcheck", .name = "ocspcheck",
.target = target, .root_module = b.createModule(.{ .target = target, .optimize = optimize }),
.optimize = optimize,
}), }),
.openssl = b.addExecutable(.{ .openssl = b.addExecutable(.{
.name = "openssl", .name = "openssl",
.target = target, .root_module = b.createModule(.{ .target = target, .optimize = optimize }),
.optimize = optimize,
}), }),
}, },
}; };
@ -114,20 +108,21 @@ pub fn build(b: *std.Build) !void {
.flags = cflags, .flags = cflags,
}); });
libressl_common.libcrypto.defineCMacro("AES_ASM", null); libressl_common.libcrypto.root_module.addCMacro("AES_ASM", "");
libressl_common.libcrypto.defineCMacro("BSAES_ASM", null); libressl_common.libcrypto.root_module.addCMacro("BSAES_ASM", "");
libressl_common.libcrypto.defineCMacro("VPAES_ASM", null); libressl_common.libcrypto.root_module.addCMacro("VPAES_ASM", "");
libressl_common.libcrypto.defineCMacro("OPENSSL_IA32_SSE2", null); libressl_common.libcrypto.root_module.addCMacro("OPENSSL_IA32_SSE2", "");
libressl_common.libcrypto.defineCMacro("OPENSSL_BN_ASM_MONT", null); libressl_common.libcrypto.root_module.addCMacro("OPENSSL_BN_ASM_MONT", "");
libressl_common.libcrypto.defineCMacro("OPENSSL_BN_ASM_MONT5", null); libressl_common.libcrypto.root_module.addCMacro("OPENSSL_BN_ASM_MONT5", "");
libressl_common.libcrypto.defineCMacro("MD5_ASM", null); libressl_common.libcrypto.root_module.addCMacro("MD5_ASM", "");
libressl_common.libcrypto.defineCMacro("GHASH_ASM", null); libressl_common.libcrypto.root_module.addCMacro("GHASH_ASM", "");
libressl_common.libcrypto.defineCMacro("RSA_ASM", null); libressl_common.libcrypto.root_module.addCMacro("RSA_ASM", "");
libressl_common.libcrypto.defineCMacro("SHA1_ASM", null); libressl_common.libcrypto.root_module.addCMacro("SHA1_ASM", "");
libressl_common.libcrypto.defineCMacro("SHA256_ASM", null); libressl_common.libcrypto.root_module.addCMacro("SHA256_ASM", "");
libressl_common.libcrypto.defineCMacro("SHA512_ASM", null); libressl_common.libcrypto.root_module.addCMacro("SHA512_ASM", "");
libressl_common.libcrypto.defineCMacro("WHIRLPOOL_ASM", null); libressl_common.libcrypto.root_module.addCMacro("WHIRLPOOL_ASM", "");
libressl_common.libcrypto.defineCMacro("OPENSSL_CPUID_OBJ", null); libressl_common.libcrypto.root_module.addCMacro("OPENSSL_CPUID_OBJ", "");
libressl_common.libcrypto.root_module.addCMacro("HAVE_GNU_STACK", "");
} else if (tinfo.cpu.arch == .arm) { } else if (tinfo.cpu.arch == .arm) {
libressl_common.libcrypto.addCSourceFiles(.{ libressl_common.libcrypto.addCSourceFiles(.{
.root = crypto_srcroot, .root = crypto_srcroot,
@ -140,55 +135,55 @@ pub fn build(b: *std.Build) !void {
.flags = cflags, .flags = cflags,
}); });
libressl_common.libcrypto.defineCMacro("AES_ASM", null); libressl_common.libcrypto.root_module.addCMacro("AES_ASM", "");
libressl_common.libcrypto.defineCMacro("OPENSSL_BN_ASM_MONT", null); libressl_common.libcrypto.root_module.addCMacro("OPENSSL_BN_ASM_MONT", "");
libressl_common.libcrypto.defineCMacro("GHASH_ASM", null); libressl_common.libcrypto.root_module.addCMacro("GHASH_ASM", "");
libressl_common.libcrypto.defineCMacro("SHA1_ASM", null); libressl_common.libcrypto.root_module.addCMacro("SHA1_ASM", "");
libressl_common.libcrypto.defineCMacro("SHA256_ASM", null); libressl_common.libcrypto.root_module.addCMacro("SHA256_ASM", "");
libressl_common.libcrypto.defineCMacro("SHA512_ASM", null); libressl_common.libcrypto.root_module.addCMacro("SHA512_ASM", "");
libressl_common.libcrypto.defineCMacro("OPENSSL_CPUID_OBJ", null); libressl_common.libcrypto.root_module.addCMacro("OPENSSL_CPUID_OBJ", "");
} else { } else {
build_asm = false; build_asm = false;
} }
} else if (tinfo.isDarwin() and tinfo.cpu.arch == .x86_64) { } else if (tinfo.os.tag.isDarwin() and tinfo.cpu.arch == .x86_64) {
libressl_common.libcrypto.addCSourceFiles(.{ libressl_common.libcrypto.addCSourceFiles(.{
.root = crypto_srcroot, .root = crypto_srcroot,
.files = libcrypto_macos_x86_64_asm, .files = libcrypto_macos_x86_64_asm,
.flags = cflags, .flags = cflags,
}); });
libressl_common.libcrypto.defineCMacro("AES_ASM", null); libressl_common.libcrypto.root_module.addCMacro("AES_ASM", "");
libressl_common.libcrypto.defineCMacro("BSAES_ASM", null); libressl_common.libcrypto.root_module.addCMacro("BSAES_ASM", "");
libressl_common.libcrypto.defineCMacro("VPAES_ASM", null); libressl_common.libcrypto.root_module.addCMacro("VPAES_ASM", "");
libressl_common.libcrypto.defineCMacro("OPENSSL_IA32_SSE2", null); libressl_common.libcrypto.root_module.addCMacro("OPENSSL_IA32_SSE2", "");
libressl_common.libcrypto.defineCMacro("OPENSSL_BN_ASM_MONT", null); libressl_common.libcrypto.root_module.addCMacro("OPENSSL_BN_ASM_MONT", "");
libressl_common.libcrypto.defineCMacro("OPENSSL_BN_ASM_MONT5", null); libressl_common.libcrypto.root_module.addCMacro("OPENSSL_BN_ASM_MONT5", "");
libressl_common.libcrypto.defineCMacro("MD5_ASM", null); libressl_common.libcrypto.root_module.addCMacro("MD5_ASM", "");
libressl_common.libcrypto.defineCMacro("GHASH_ASM", null); libressl_common.libcrypto.root_module.addCMacro("GHASH_ASM", "");
libressl_common.libcrypto.defineCMacro("RSA_ASM", null); libressl_common.libcrypto.root_module.addCMacro("RSA_ASM", "");
libressl_common.libcrypto.defineCMacro("SHA1_ASM", null); libressl_common.libcrypto.root_module.addCMacro("SHA1_ASM", "");
libressl_common.libcrypto.defineCMacro("SHA256_ASM", null); libressl_common.libcrypto.root_module.addCMacro("SHA256_ASM", "");
libressl_common.libcrypto.defineCMacro("SHA512_ASM", null); libressl_common.libcrypto.root_module.addCMacro("SHA512_ASM", "");
libressl_common.libcrypto.defineCMacro("WHIRLPOOL_ASM", null); libressl_common.libcrypto.root_module.addCMacro("WHIRLPOOL_ASM", "");
libressl_common.libcrypto.defineCMacro("OPENSSL_CPUID_OBJ", null); libressl_common.libcrypto.root_module.addCMacro("OPENSSL_CPUID_OBJ", "");
} else if (tinfo.os.tag == .windows and tinfo.abi == .gnu) { } else if (tinfo.os.tag == .windows and tinfo.abi == .gnu) {
libressl_common.libcrypto.addCSourceFiles(.{ libressl_common.libcrypto.addCSourceFiles(.{
.root = crypto_srcroot, .root = crypto_srcroot,
.files = libcrypto_mingw64_x86_64_asm, .files = libcrypto_mingw64_x86_64_asm,
.flags = cflags, .flags = cflags,
}); });
libressl_common.libcrypto.defineCMacro("AES_ASM", null); libressl_common.libcrypto.root_module.addCMacro("AES_ASM", "");
libressl_common.libcrypto.defineCMacro("BSAES_ASM", null); libressl_common.libcrypto.root_module.addCMacro("BSAES_ASM", "");
libressl_common.libcrypto.defineCMacro("VPAES_ASM", null); libressl_common.libcrypto.root_module.addCMacro("VPAES_ASM", "");
libressl_common.libcrypto.defineCMacro("OPENSSL_IA32_SSE2", null); libressl_common.libcrypto.root_module.addCMacro("OPENSSL_IA32_SSE2", "");
libressl_common.libcrypto.defineCMacro("MD5_ASM", null); libressl_common.libcrypto.root_module.addCMacro("MD5_ASM", "");
libressl_common.libcrypto.defineCMacro("GHASH_ASM", null); libressl_common.libcrypto.root_module.addCMacro("GHASH_ASM", "");
libressl_common.libcrypto.defineCMacro("RSA_ASM", null); libressl_common.libcrypto.root_module.addCMacro("RSA_ASM", "");
libressl_common.libcrypto.defineCMacro("SHA1_ASM", null); libressl_common.libcrypto.root_module.addCMacro("SHA1_ASM", "");
libressl_common.libcrypto.defineCMacro("SHA256_ASM", null); libressl_common.libcrypto.root_module.addCMacro("SHA256_ASM", "");
libressl_common.libcrypto.defineCMacro("SHA512_ASM", null); libressl_common.libcrypto.root_module.addCMacro("SHA512_ASM", "");
libressl_common.libcrypto.defineCMacro("WHIRLPOOL_ASM", null); libressl_common.libcrypto.root_module.addCMacro("WHIRLPOOL_ASM", "");
libressl_common.libcrypto.defineCMacro("OPENSSL_CPUID_OBJ", null); libressl_common.libcrypto.root_module.addCMacro("OPENSSL_CPUID_OBJ", "");
} else { } else {
build_asm = false; build_asm = false;
} }
@ -204,15 +199,15 @@ pub fn build(b: *std.Build) !void {
.files = libcrypto_nonasm, .files = libcrypto_nonasm,
.flags = cflags, .flags = cflags,
}); });
libressl_common.defineCMacro("OPENSSL_NO_ASM", null); libressl_common.addCMacro("OPENSSL_NO_ASM", "");
} }
libressl_common.defineCMacro("OPENSSLDIR", std.fmt.allocPrint(b.allocator, "\"{s}\"", .{resolved_openssl_dir}) catch @panic("OOM")); libressl_common.addCMacro("OPENSSLDIR", std.fmt.allocPrint(b.allocator, "\"{s}\"", .{resolved_openssl_dir}) catch @panic("OOM"));
libressl_common.defineCMacro("LIBRESSL_INTERNAL", null); libressl_common.addCMacro("LIBRESSL_INTERNAL", "");
libressl_common.defineCMacro("OPENSSL_NO_HW_PADLOCK", null); libressl_common.addCMacro("OPENSSL_NO_HW_PADLOCK", "");
libressl_common.defineCMacro("__BEGIN_HIDDEN_DECLS", ""); libressl_common.addCMacro("__BEGIN_HIDDEN_DECLS", "");
libressl_common.defineCMacro("__END_HIDDEN_DECLS", ""); libressl_common.addCMacro("__END_HIDDEN_DECLS", "");
libressl_common.defineCMacro("LIBRESSL_CRYPTO_INTERNAL", null); libressl_common.addCMacro("LIBRESSL_CRYPTO_INTERNAL", "");
switch (tinfo.os.tag) { switch (tinfo.os.tag) {
.linux => { .linux => {
@ -233,29 +228,28 @@ pub fn build(b: *std.Build) !void {
.flags = cflags, .flags = cflags,
}); });
libressl_common.defineCMacro("_DEFAULT_SOURCE", null); libressl_common.addCMacro("_DEFAULT_SOURCE", "");
libressl_common.defineCMacro("_BSD_SOURCE", null); libressl_common.addCMacro("_BSD_SOURCE", "");
libressl_common.defineCMacro("_POSIX_SOURCE", null); libressl_common.addCMacro("_POSIX_SOURCE", "");
libressl_common.defineCMacro("_GNU_SOURCE", null); libressl_common.addCMacro("_GNU_SOURCE", "");
libressl_common.defineCMacro("HAVE_ASPRINTF", null); libressl_common.addCMacro("HAVE_ASPRINTF", "");
libressl_common.defineCMacro("HAVE_STRCASECMP", null); libressl_common.addCMacro("HAVE_STRCASECMP", "");
libressl_common.defineCMacro("HAVE_STRNDUP", null); libressl_common.addCMacro("HAVE_STRNDUP", "");
libressl_common.defineCMacro("HAVE_STRNLEN", null); libressl_common.addCMacro("HAVE_STRNLEN", "");
libressl_common.defineCMacro("HAVE_STRSEP", null); libressl_common.addCMacro("HAVE_STRSEP", "");
libressl_common.defineCMacro("HAVE_TIMEGM", null);
libressl_common.defineCMacro("HAVE_EXPLICIT_BZERO", null); libressl_common.addCMacro("HAVE_EXPLICIT_BZERO", "");
libressl_common.defineCMacro("HAVE_GETAUXVAL", null); libressl_common.addCMacro("HAVE_GETAUXVAL", "");
libressl_common.defineCMacro("HAVE_GETPAGESIZE", null); libressl_common.addCMacro("HAVE_GETPAGESIZE", "");
libressl_common.defineCMacro("HAVE_SYSLOG", null); libressl_common.addCMacro("HAVE_SYSLOG", "");
libressl_common.defineCMacro("HAVE_MEMMEM", null); libressl_common.addCMacro("HAVE_MEMMEM", "");
libressl_common.defineCMacro("HAVE_ENDIAN_H", null); libressl_common.addCMacro("HAVE_ENDIAN_H", "");
libressl_common.defineCMacro("HAVE_ERR_H", null); libressl_common.addCMacro("HAVE_ERR_H", "");
libressl_common.defineCMacro("HAVE_NETINET_IP_H", null); libressl_common.addCMacro("HAVE_NETINET_IP_H", "");
if (tinfo.abi.isGnu()) { if (tinfo.abi.isGnu()) {
libressl_common.libcrypto.addCSourceFiles(.{ libressl_common.libcrypto.addCSourceFiles(.{
@ -270,9 +264,9 @@ pub fn build(b: *std.Build) !void {
.flags = cflags, .flags = cflags,
}); });
libressl_common.defineCMacro("HAVE_STRLCAT", null); libressl_common.addCMacro("HAVE_STRLCAT", "");
libressl_common.defineCMacro("HAVE_STRLCPY", null); libressl_common.addCMacro("HAVE_STRLCPY", "");
libressl_common.defineCMacro("HAVE_GETENTROPY", null); libressl_common.addCMacro("HAVE_GETENTROPY", "");
} else @panic("weird ABI, dude"); } else @panic("weird ABI, dude");
libressl_common.linkSystemLibrary("pthread"); libressl_common.linkSystemLibrary("pthread");
@ -306,39 +300,39 @@ pub fn build(b: *std.Build) !void {
}); });
if (tinfo.abi != .msvc) { if (tinfo.abi != .msvc) {
libressl_common.defineCMacro("_GNU_SOURCE", null); libressl_common.addCMacro("_GNU_SOURCE", "");
libressl_common.defineCMacro("_POSIX", null); libressl_common.addCMacro("_POSIX", "");
libressl_common.defineCMacro("_POSIX_SOURCE", null); libressl_common.addCMacro("_POSIX_SOURCE", "");
libressl_common.defineCMacro("__USE_MINGW_ANSI_STDIO", null); libressl_common.addCMacro("__USE_MINGW_ANSI_STDIO", "");
} }
libressl_common.defineCMacro("_CRT_SECURE_NO_WARNINGS", null); libressl_common.addCMacro("_CRT_SECURE_NO_WARNINGS", "");
libressl_common.defineCMacro("_CRT_DEPRECATED_NO_WARNINGS", null); libressl_common.addCMacro("_CRT_DEPRECATED_NO_WARNINGS", "");
libressl_common.defineCMacro("_REENTRANT", null); libressl_common.addCMacro("_REENTRANT", "");
libressl_common.defineCMacro("_POSIX_THREAD_SAFE_FUNCTIONS", null); libressl_common.addCMacro("_POSIX_THREAD_SAFE_FUNCTIONS", "");
libressl_common.defineCMacro("CPPFLAGS", null); libressl_common.addCMacro("CPPFLAGS", "");
libressl_common.defineCMacro("NO_SYSLOG", null); libressl_common.addCMacro("NO_SYSLOG", "");
libressl_common.defineCMacro("NO_CRYPT", null); libressl_common.addCMacro("NO_CRYPT", "");
libressl_common.defineCMacro("WIN32_LEAN_AND_MEAN", null); libressl_common.addCMacro("WIN32_LEAN_AND_MEAN", "");
libressl_common.defineCMacroForLibs("_WIN32_WINNT", "0x0600"); libressl_common.addCMacroForLibs("_WIN32_WINNT", "0x0600");
libressl_common.defineCMacro("HAVE_ASPRINTF", null); libressl_common.addCMacro("HAVE_ASPRINTF", "");
libressl_common.defineCMacro("HAVE_STRCASECMP", null); libressl_common.addCMacro("HAVE_STRCASECMP", "");
libressl_common.defineCMacro("HAVE_STRNLEN", null); libressl_common.addCMacro("HAVE_STRNLEN", "");
libressl_common.defineCMacro("HAVE_GETAUXVAL", null); libressl_common.addCMacro("HAVE_GETAUXVAL", "");
libressl_common.defineCMacro("HAVE_TIMESPECSUB", null); libressl_common.addCMacro("HAVE_TIMESPECSUB", "");
libressl_common.defineCMacro("HAVE_MEMMEM", null); libressl_common.addCMacro("HAVE_MEMMEM", "");
libressl_common.defineCMacro("HAVE_MACHINE_ENDIAN_H", null); libressl_common.addCMacro("HAVE_MACHINE_ENDIAN_H", "");
libressl_common.defineCMacro("HAVE_READPASSPHRASE", null); libressl_common.addCMacro("HAVE_READPASSPHRASE", "");
libressl_common.defineCMacro("HAVE_ACCEPT4", null); libressl_common.addCMacro("HAVE_ACCEPT4", "");
libressl_common.defineCMacro("HAVE_NETINET_IP_H", null); libressl_common.addCMacro("HAVE_NETINET_IP_H", "");
libressl_common.linkSystemLibrary("ws2_32"); libressl_common.linkSystemLibrary("ws2_32");
libressl_common.linkSystemLibrary("bcrypt"); libressl_common.linkSystemLibrary("bcrypt");
}, },
else => if (tinfo.isDarwin()) { else => if (tinfo.os.tag.isDarwin()) {
libressl_common.libcrypto.addCSourceFiles(.{ libressl_common.libcrypto.addCSourceFiles(.{
.root = crypto_srcroot, .root = crypto_srcroot,
.files = libcrypto_unix_sources, .files = libcrypto_unix_sources,
@ -355,25 +349,24 @@ pub fn build(b: *std.Build) !void {
.flags = cflags, .flags = cflags,
}); });
libressl_common.defineCMacro("HAVE_CLOCK_GETTIME", null); libressl_common.addCMacro("HAVE_CLOCK_GETTIME", "");
libressl_common.defineCMacro("HAVE_ASPRINTF", null); libressl_common.addCMacro("HAVE_ASPRINTF", "");
libressl_common.defineCMacro("HAVE_STRCASECMP", null); libressl_common.addCMacro("HAVE_STRCASECMP", "");
libressl_common.defineCMacro("HAVE_STRLCAT", null); libressl_common.addCMacro("HAVE_STRLCAT", "");
libressl_common.defineCMacro("HAVE_STRLCPY", null); libressl_common.addCMacro("HAVE_STRLCPY", "");
libressl_common.defineCMacro("HAVE_STRNDUP", null); libressl_common.addCMacro("HAVE_STRNDUP", "");
libressl_common.defineCMacro("HAVE_STRNLEN", null); libressl_common.addCMacro("HAVE_STRNLEN", "");
libressl_common.defineCMacro("HAVE_STRSEP", null); libressl_common.addCMacro("HAVE_STRSEP", "");
libressl_common.defineCMacro("HAVE_STRTONUM", null); libressl_common.addCMacro("HAVE_STRTONUM", "");
libressl_common.defineCMacro("HAVE_TIMEGM", null); libressl_common.addCMacro("HAVE_ARC4RANDOM_BUF", "");
libressl_common.defineCMacro("HAVE_ARC4RANDOM_BUF", null); libressl_common.addCMacro("HAVE_ARC4RANDOM_UNIFORM", "");
libressl_common.defineCMacro("HAVE_ARC4RANDOM_UNIFORM", null); libressl_common.addCMacro("HAVE_GETENTROPY", "");
libressl_common.defineCMacro("HAVE_GETENTROPY", null); libressl_common.addCMacro("HAVE_GETPAGESIZE", "");
libressl_common.defineCMacro("HAVE_GETPAGESIZE", null); libressl_common.addCMacro("HAVE_GETPROGNAME", "");
libressl_common.defineCMacro("HAVE_GETPROGNAME", null); libressl_common.addCMacro("HAVE_MEMMEM", "");
libressl_common.defineCMacro("HAVE_MEMMEM", null); libressl_common.addCMacro("HAVE_MACHINE_ENDIAN_H", "");
libressl_common.defineCMacro("HAVE_MACHINE_ENDIAN_H", null); libressl_common.addCMacro("HAVE_ERR_H", "");
libressl_common.defineCMacro("HAVE_ERR_H", null); libressl_common.addCMacro("HAVE_NETINET_IP_H", "");
libressl_common.defineCMacro("HAVE_NETINET_IP_H", null);
if (tinfo.cpu.arch == .x86_64 and build_asm) {} else {} if (tinfo.cpu.arch == .x86_64 and build_asm) {} else {}
} else { } else {
@ -429,18 +422,50 @@ pub fn build(b: *std.Build) !void {
switch (tinfo.cpu.arch) { switch (tinfo.cpu.arch) {
.aarch64, .aarch64,
.aarch64_be, .aarch64_be,
=> libressl_common.libcrypto.addIncludePath( => {
libressl_common.libcrypto.addIncludePath(
upstream.path(libcrypto_src_prefix ++ "bn/arch/aarch64"), upstream.path(libcrypto_src_prefix ++ "bn/arch/aarch64"),
), );
.x86 => libressl_common.libcrypto.addIncludePath( libressl_common.libcrypto.addIncludePath(
upstream.path(libcrypto_src_prefix ++ "arch/aarch64"),
);
libressl_common.libssl.addIncludePath(
upstream.path(libcrypto_src_prefix ++ "arch/aarch64"),
);
},
.x86 => {
libressl_common.libcrypto.addIncludePath(
upstream.path(libcrypto_src_prefix ++ "bn/arch/i386"), upstream.path(libcrypto_src_prefix ++ "bn/arch/i386"),
), );
.riscv64 => libressl_common.libcrypto.addIncludePath( libressl_common.libcrypto.addIncludePath(
upstream.path(libcrypto_src_prefix ++ "arch/i386"),
);
libressl_common.libssl.addIncludePath(
upstream.path(libcrypto_src_prefix ++ "arch/i386"),
);
},
.riscv64 => {
libressl_common.libcrypto.addIncludePath(
upstream.path(libcrypto_src_prefix ++ "bn/arch/riscv64"), upstream.path(libcrypto_src_prefix ++ "bn/arch/riscv64"),
), );
.x86_64 => libressl_common.libcrypto.addIncludePath( libressl_common.libcrypto.addIncludePath(
upstream.path(libcrypto_src_prefix ++ "arch/riscv64"),
);
libressl_common.libssl.addIncludePath(
upstream.path(libcrypto_src_prefix ++ "arch/riscv64"),
);
},
.x86_64 => {
libressl_common.libcrypto.addIncludePath(
upstream.path(libcrypto_src_prefix ++ "bn/arch/amd64"), upstream.path(libcrypto_src_prefix ++ "bn/arch/amd64"),
), );
libressl_common.libcrypto.addIncludePath(
upstream.path(libcrypto_src_prefix ++ "arch/amd64"),
);
libressl_common.libssl.addIncludePath(
upstream.path(libcrypto_src_prefix ++ "arch/amd64"),
);
},
else => @panic("unsupported target CPU architecture"), else => @panic("unsupported target CPU architecture"),
} }
@ -468,8 +493,8 @@ pub fn build(b: *std.Build) !void {
libressl_common.installLibraries(b); libressl_common.installLibraries(b);
// weird hack here // weird hack here
libressl_common.apps.nc.defineCMacro("DEFAULT_CA_FILE", b.pathJoin(&.{ b.install_prefix, "etc", "ssl", "cert.pem" })); libressl_common.apps.nc.root_module.addCMacro("DEFAULT_CA_FILE", b.pathJoin(&.{ b.install_prefix, "etc", "ssl", "cert.pem" }));
libressl_common.apps.ocspcheck.defineCMacro("DEFAULT_CA_FILE", b.pathJoin(&.{ b.install_prefix, "etc", "ssl", "cert.pem" })); libressl_common.apps.ocspcheck.root_module.addCMacro("DEFAULT_CA_FILE", b.pathJoin(&.{ b.install_prefix, "etc", "ssl", "cert.pem" }));
libressl_common.apps.nc.linkLibrary(libressl_common.libtls); libressl_common.apps.nc.linkLibrary(libressl_common.libtls);
libressl_common.apps.ocspcheck.linkLibrary(libressl_common.libtls); libressl_common.apps.ocspcheck.linkLibrary(libressl_common.libtls);
libressl_common.apps.openssl.linkLibrary(libressl_common.libssl); libressl_common.apps.openssl.linkLibrary(libressl_common.libssl);
@ -501,17 +526,17 @@ const LibreSslCommon = struct {
self.libtls.linkSystemLibrary(library); self.libtls.linkSystemLibrary(library);
} }
pub fn defineCMacroForLibs(self: LibreSslCommon, name: []const u8, value: ?[]const u8) void { pub fn addCMacroForLibs(self: LibreSslCommon, name: []const u8, value: []const u8) void {
self.libcrypto.defineCMacro(name, value); self.libcrypto.root_module.addCMacro(name, value);
self.libssl.defineCMacro(name, value); self.libssl.root_module.addCMacro(name, value);
self.libtls.defineCMacro(name, value); self.libtls.root_module.addCMacro(name, value);
} }
pub fn defineCMacro(self: LibreSslCommon, name: []const u8, value: ?[]const u8) void { pub fn addCMacro(self: LibreSslCommon, name: []const u8, value: []const u8) void {
self.defineCMacroForLibs(name, value); self.addCMacroForLibs(name, value);
self.apps.nc.defineCMacro(name, value); self.apps.nc.root_module.addCMacro(name, value);
self.apps.ocspcheck.defineCMacro(name, value); self.apps.ocspcheck.root_module.addCMacro(name, value);
self.apps.openssl.defineCMacro(name, value); self.apps.openssl.root_module.addCMacro(name, value);
} }
pub fn installLibraries(self: LibreSslCommon, b: *std.Build) void { pub fn installLibraries(self: LibreSslCommon, b: *std.Build) void {
@ -574,9 +599,7 @@ const libssl_src_prefix = base_src_prefix ++ "ssl/";
const libtls_src_prefix = base_src_prefix ++ "tls/"; const libtls_src_prefix = base_src_prefix ++ "tls/";
// only used on nonasm builds // only used on nonasm builds
const libcrypto_nonasm: []const []const u8 = &.{ const libcrypto_nonasm: []const []const u8 = &.{};
"aes/aes_core.c",
};
const libcrypto_include_paths: []const []const u8 = &.{ const libcrypto_include_paths: []const []const u8 = &.{
libcrypto_src_prefix, libcrypto_src_prefix,
@ -584,12 +607,14 @@ const libcrypto_include_paths: []const []const u8 = &.{
libcrypto_src_prefix ++ "bio", libcrypto_src_prefix ++ "bio",
libcrypto_src_prefix ++ "bn", libcrypto_src_prefix ++ "bn",
libcrypto_src_prefix ++ "bytestring", libcrypto_src_prefix ++ "bytestring",
libcrypto_src_prefix ++ "conf",
libcrypto_src_prefix ++ "dh", libcrypto_src_prefix ++ "dh",
libcrypto_src_prefix ++ "dsa", libcrypto_src_prefix ++ "dsa",
libcrypto_src_prefix ++ "curve25519", libcrypto_src_prefix ++ "curve25519",
libcrypto_src_prefix ++ "ec", libcrypto_src_prefix ++ "ec",
libcrypto_src_prefix ++ "ecdh", libcrypto_src_prefix ++ "ecdh",
libcrypto_src_prefix ++ "ecdsa", libcrypto_src_prefix ++ "ecdsa",
libcrypto_src_prefix ++ "err",
libcrypto_src_prefix ++ "evp", libcrypto_src_prefix ++ "evp",
libcrypto_src_prefix ++ "hidden", libcrypto_src_prefix ++ "hidden",
libcrypto_src_prefix ++ "hmac", libcrypto_src_prefix ++ "hmac",
@ -640,19 +665,15 @@ const libcrypto_elf_x86_64_asm: []const []const u8 = &[_][]const u8{
"aes/bsaes-elf-x86_64.S", "aes/bsaes-elf-x86_64.S",
"aes/vpaes-elf-x86_64.S", "aes/vpaes-elf-x86_64.S",
"aes/aesni-elf-x86_64.S", "aes/aesni-elf-x86_64.S",
"aes/aesni-sha1-elf-x86_64.S",
"bn/modexp512-elf-x86_64.S", "bn/modexp512-elf-x86_64.S",
"bn/mont-elf-x86_64.S", "bn/mont-elf-x86_64.S",
"bn/mont5-elf-x86_64.S", "bn/mont5-elf-x86_64.S",
"camellia/cmll-elf-x86_64.S",
"md5/md5-elf-x86_64.S", "md5/md5-elf-x86_64.S",
"modes/ghash-elf-x86_64.S", "modes/ghash-elf-x86_64.S",
"rc4/rc4-elf-x86_64.S", "rc4/rc4-elf-x86_64.S",
"rc4/rc4-md5-elf-x86_64.S",
"sha/sha1-elf-x86_64.S", "sha/sha1-elf-x86_64.S",
"sha/sha256-elf-x86_64.S", "sha/sha256-elf-x86_64.S",
"sha/sha512-elf-x86_64.S", "sha/sha512-elf-x86_64.S",
"whrlpool/wp-elf-x86_64.S",
"cpuid-elf-x86_64.S", "cpuid-elf-x86_64.S",
} ++ libcrypto_common_x86_64_asm; } ++ libcrypto_common_x86_64_asm;
@ -661,19 +682,15 @@ const libcrypto_macos_x86_64_asm: []const []const u8 = &[_][]const u8{
"aes/bsaes-macosx-x86_64.S", "aes/bsaes-macosx-x86_64.S",
"aes/vpaes-macosx-x86_64.S", "aes/vpaes-macosx-x86_64.S",
"aes/aesni-macosx-x86_64.S", "aes/aesni-macosx-x86_64.S",
"aes/aesni-sha1-macosx-x86_64.S",
"bn/modexp512-macosx-x86_64.S", "bn/modexp512-macosx-x86_64.S",
"bn/mont-macosx-x86_64.S", "bn/mont-macosx-x86_64.S",
"bn/mont5-macosx-x86_64.S", "bn/mont5-macosx-x86_64.S",
"camellia/cmll-macosx-x86_64.S",
"md5/md5-macosx-x86_64.S", "md5/md5-macosx-x86_64.S",
"modes/ghash-macosx-x86_64.S", "modes/ghash-macosx-x86_64.S",
"rc4/rc4-macosx-x86_64.S", "rc4/rc4-macosx-x86_64.S",
"rc4/rc4-md5-macosx-x86_64.S",
"sha/sha1-macosx-x86_64.S", "sha/sha1-macosx-x86_64.S",
"sha/sha256-macosx-x86_64.S", "sha/sha256-macosx-x86_64.S",
"sha/sha512-macosx-x86_64.S", "sha/sha512-macosx-x86_64.S",
"whrlpool/wp-macosx-x86_64.S",
"cpuid-macosx-x86_64.S", "cpuid-macosx-x86_64.S",
} ++ libcrypto_common_x86_64_asm; } ++ libcrypto_common_x86_64_asm;
@ -682,31 +699,17 @@ const libcrypto_mingw64_x86_64_asm: []const []const u8 = &.{
"aes/bsaes-mingw64-x86_64.S", "aes/bsaes-mingw64-x86_64.S",
"aes/vpaes-mingw64-x86_64.S", "aes/vpaes-mingw64-x86_64.S",
"aes/aesni-mingw64-x86_64.S", "aes/aesni-mingw64-x86_64.S",
"aes/aesni-sha1-mingw64-x86_64.S",
// "bn/modexp512-mingw64-x86_64.S",
// "bn/mont-mingw64-x86_64.S",
// "bn/mont5-mingw64-x86_64.S",
"camellia/cmll-mingw64-x86_64.S",
"md5/md5-mingw64-x86_64.S", "md5/md5-mingw64-x86_64.S",
"modes/ghash-mingw64-x86_64.S", "modes/ghash-mingw64-x86_64.S",
"rc4/rc4-mingw64-x86_64.S", "rc4/rc4-mingw64-x86_64.S",
"rc4/rc4-md5-mingw64-x86_64.S",
"sha/sha1-mingw64-x86_64.S", "sha/sha1-mingw64-x86_64.S",
"sha/sha256-mingw64-x86_64.S", "sha/sha256-mingw64-x86_64.S",
"sha/sha512-mingw64-x86_64.S", "sha/sha512-mingw64-x86_64.S",
"whrlpool/wp-mingw64-x86_64.S",
"cpuid-mingw64-x86_64.S", "cpuid-mingw64-x86_64.S",
}; };
// these are used on armv4 with asm, or a nonasm build // these are used on armv4 with asm, or a nonasm build
const libcrypto_nonasm_or_armv4: []const []const u8 = &.{ const libcrypto_nonasm_or_armv4: []const []const u8 = &.{};
"aes/aes_cbc.c",
"camellia/camellia.c",
"camellia/cmll_cbc.c",
"rc4/rc4_enc.c",
"rc4/rc4_skey.c",
"whrlpool/wp_block.c",
};
const libcrypto_unix_sources: []const []const u8 = &.{ const libcrypto_unix_sources: []const []const u8 = &.{
"crypto_lock.c", "crypto_lock.c",
@ -777,7 +780,6 @@ const libcrypto_windows_compat: []const []const u8 = &.{
"compat/strtonum.c", "compat/strtonum.c",
"compat/syslog_r.c", "compat/syslog_r.c",
"compat/timegm.c",
"compat/explicit_bzero_win.c", "compat/explicit_bzero_win.c",
"compat/getentropy_win.c", "compat/getentropy_win.c",
@ -792,21 +794,16 @@ const libcrypto_windows_compat: []const []const u8 = &.{
const libcrypto_sources: []const []const u8 = &.{ const libcrypto_sources: []const []const u8 = &.{
"cpt_err.c", "cpt_err.c",
"cryptlib.c", "cryptlib.c",
"crypto_ex_data.c",
"crypto_init.c", "crypto_init.c",
"cversion.c", "cversion.c",
"ex_data.c",
"malloc-wrapper.c", "malloc-wrapper.c",
"mem_clr.c", "mem_clr.c",
"mem_dbg.c", "mem_dbg.c",
"o_fips.c", "o_fips.c",
"o_init.c", "aes/aes.c",
"o_str.c", "aes/aes_core.c",
"aes/aes_cfb.c",
"aes/aes_ctr.c",
"aes/aes_ecb.c",
"aes/aes_ige.c", "aes/aes_ige.c",
"aes/aes_ofb.c",
"aes/aes_wrap.c",
"asn1/a_bitstr.c", "asn1/a_bitstr.c",
"asn1/a_enum.c", "asn1/a_enum.c",
"asn1/a_int.c", "asn1/a_int.c",
@ -867,11 +864,7 @@ const libcrypto_sources: []const []const u8 = &.{
"asn1/x_val.c", "asn1/x_val.c",
"asn1/x_x509.c", "asn1/x_x509.c",
"asn1/x_x509a.c", "asn1/x_x509a.c",
"bf/bf_cfb64.c", "bf/blowfish.c",
"bf/bf_ecb.c",
"bf/bf_enc.c",
"bf/bf_ofb64.c",
"bf/bf_skey.c",
"bio/b_dump.c", "bio/b_dump.c",
"bio/b_print.c", "bio/b_print.c",
"bio/b_sock.c", "bio/b_sock.c",
@ -921,16 +914,8 @@ const libcrypto_sources: []const []const u8 = &.{
"bytestring/bs_ber.c", "bytestring/bs_ber.c",
"bytestring/bs_cbb.c", "bytestring/bs_cbb.c",
"bytestring/bs_cbs.c", "bytestring/bs_cbs.c",
"camellia/cmll_cfb.c", "camellia/camellia.c",
"camellia/cmll_ctr.c", "cast/cast.c",
"camellia/cmll_ecb.c",
"camellia/cmll_misc.c",
"camellia/cmll_ofb.c",
"cast/c_cfb64.c",
"cast/c_ecb.c",
"cast/c_enc.c",
"cast/c_ofb64.c",
"cast/c_skey.c",
"chacha/chacha.c", "chacha/chacha.c",
"cmac/cm_ameth.c", "cmac/cm_ameth.c",
"cmac/cm_pmeth.c", "cmac/cm_pmeth.c",
@ -967,27 +952,11 @@ const libcrypto_sources: []const []const u8 = &.{
"ct/ct_x509v3.c", "ct/ct_x509v3.c",
"curve25519/curve25519-generic.c", "curve25519/curve25519-generic.c",
"curve25519/curve25519.c", "curve25519/curve25519.c",
"des/cbc_cksm.c", "des/des.c",
"des/cbc_enc.c", "des/des_cksum.c",
"des/cfb64ede.c",
"des/cfb64enc.c",
"des/cfb_enc.c",
"des/des_enc.c", "des/des_enc.c",
"des/ecb3_enc.c", "des/des_fcrypt.c",
"des/ecb_enc.c", "des/des_key.c",
"des/ede_cbcm_enc.c",
"des/enc_read.c",
"des/enc_writ.c",
"des/fcrypt.c",
"des/fcrypt_b.c",
"des/ofb64ede.c",
"des/ofb64enc.c",
"des/ofb_enc.c",
"des/pcbc_enc.c",
"des/qud_cksm.c",
"des/set_key.c",
"des/str2key.c",
"des/xcbc_enc.c",
"dh/dh_ameth.c", "dh/dh_ameth.c",
"dh/dh_asn1.c", "dh/dh_asn1.c",
"dh/dh_check.c", "dh/dh_check.c",
@ -1065,7 +1034,6 @@ const libcrypto_sources: []const []const u8 = &.{
"evp/m_sha3.c", "evp/m_sha3.c",
"evp/m_sigver.c", "evp/m_sigver.c",
"evp/m_sm3.c", "evp/m_sm3.c",
"evp/m_wp.c",
"evp/p_legacy.c", "evp/p_legacy.c",
"evp/p_lib.c", "evp/p_lib.c",
"evp/p_sign.c", "evp/p_sign.c",
@ -1077,13 +1045,10 @@ const libcrypto_sources: []const []const u8 = &.{
"hmac/hm_ameth.c", "hmac/hm_ameth.c",
"hmac/hm_pmeth.c", "hmac/hm_pmeth.c",
"hmac/hmac.c", "hmac/hmac.c",
"idea/i_cbc.c", "idea/idea.c",
"idea/i_cfb64.c",
"idea/i_ecb.c",
"idea/i_ofb64.c",
"idea/i_skey.c",
"kdf/hkdf_evp.c", "kdf/hkdf_evp.c",
"kdf/kdf_err.c", "kdf/kdf_err.c",
"kdf/tls1_prf.c",
"lhash/lhash.c", "lhash/lhash.c",
"md4/md4.c", "md4/md4.c",
"md5/md5.c", "md5/md5.c",
@ -1149,6 +1114,7 @@ const libcrypto_sources: []const []const u8 = &.{
"rc2/rc2_skey.c", "rc2/rc2_skey.c",
"rc2/rc2cfb64.c", "rc2/rc2cfb64.c",
"rc2/rc2ofb64.c", "rc2/rc2ofb64.c",
"rc4/rc4.c",
"ripemd/ripemd.c", "ripemd/ripemd.c",
"rsa/rsa_ameth.c", "rsa/rsa_ameth.c",
"rsa/rsa_asn1.c", "rsa/rsa_asn1.c",
@ -1190,8 +1156,6 @@ const libcrypto_sources: []const []const u8 = &.{
"ui/ui_err.c", "ui/ui_err.c",
"ui/ui_lib.c", "ui/ui_lib.c",
"ui/ui_null.c", "ui/ui_null.c",
"ui/ui_util.c",
"whrlpool/wp_dgst.c",
"x509/by_dir.c", "x509/by_dir.c",
"x509/by_file.c", "x509/by_file.c",
"x509/by_mem.c", "x509/by_mem.c",
@ -1232,6 +1196,7 @@ const libcrypto_sources: []const []const u8 = &.{
"x509/x509_r2x.c", "x509/x509_r2x.c",
"x509/x509_req.c", "x509/x509_req.c",
"x509/x509_set.c", "x509/x509_set.c",
"x509/x509_siginfo.c",
"x509/x509_skey.c", "x509/x509_skey.c",
"x509/x509_trs.c", "x509/x509_trs.c",
"x509/x509_txt.c", "x509/x509_txt.c",
@ -1252,6 +1217,7 @@ const libssl_include_paths: []const []const u8 = &.{
libssl_src_prefix, libssl_src_prefix,
libssl_src_prefix ++ "hidden", libssl_src_prefix ++ "hidden",
libcrypto_src_prefix[0 .. libcrypto_src_prefix.len - 1],
libcrypto_src_prefix ++ "bio", libcrypto_src_prefix ++ "bio",
// these are order-dependent and they have to go after the "hidden" directory // these are order-dependent and they have to go after the "hidden" directory
@ -1410,7 +1376,6 @@ const openssl_app_sources: []const []const u8 = &.{
"sess_id.c", "sess_id.c",
"smime.c", "smime.c",
"speed.c", "speed.c",
"spkac.c",
"ts.c", "ts.c",
"verify.c", "verify.c",
"version.c", "version.c",

View File

@ -1,11 +1,12 @@
.{ .{
.name = "libressl", .name = .libressl,
.version = "3.9.2", .fingerprint = 0x203FA82BE0954AFA,
.minimum_zig_version = "0.12.0", .version = "4.0.0",
.minimum_zig_version = "0.14.0",
.dependencies = .{ .dependencies = .{
.libressl = .{ .libressl = .{
.url = "https://github.com/libressl/portable/releases/download/v3.9.2/libressl-3.9.2.tar.gz", .url = "https://github.com/libressl/portable/releases/download/v4.0.0/libressl-4.0.0.tar.gz",
.hash = "1220713b293eab87698edf5d6b9bbacf6c17684e65c42da2ad00da6e7e9cf1df5517", .hash = "N-V-__8AAGvDTQHGV38aqRN9PCALgEg4_XExU4juxdTJMTVQ",
}, },
}, },
.paths = .{ .paths = .{

View File

@ -10,7 +10,7 @@ This project currently builds the three main LibreSSL libraries as static librar
- `libssl`: OpenSSL 1.1 compatibility layer - `libssl`: OpenSSL 1.1 compatibility layer
- `libtls`: LibreSSL's new cryptography API - `libtls`: LibreSSL's new cryptography API
Operating systems and hardware architectures are supported on a best-effort basis. Building for Linux, macOS, and Windows (mingw64) is directly tested by CI. Operating systems and hardware architectures are supported on a best-effort basis, and patches to add additional OS/arch support are welcome. Building for Linux (`x86_64`), macOS (`aarch64`), and Windows (`x86_64` via `mingw64`) is directly tested by CI.
The command-line programs `nc`, `ocspcheck`, and `openssl` are not built by default, and building them when targeting Windows is not supported. Building the command-line programs may be enabled by specifing the `-Dbuild-apps` option to `zig build` The command-line programs `nc`, `ocspcheck`, and `openssl` are not built by default, and building them when targeting Windows is not supported. Building the command-line programs may be enabled by specifing the `-Dbuild-apps` option to `zig build`
@ -21,7 +21,7 @@ First, update your `build.zig.zon`:
```sh ```sh
# Initialize a `zig build` project if you haven't already # Initialize a `zig build` project if you haven't already
zig init zig init
# replace <refname> with the version you want to use, e.g. 3.9.2 # replace <refname> with the version you want to use, e.g. 4.0.0
zig fetch --save git+https://github.com/allyourcodebase/libressl#<refname> zig fetch --save git+https://github.com/allyourcodebase/libressl#<refname>
``` ```
@ -36,8 +36,11 @@ const libressl_dependency = b.dependency("libressl", .{
your_exe.linkLibrary(libressl_dependency.artifact("tls")); // or "ssl", or "crypto" your_exe.linkLibrary(libressl_dependency.artifact("tls")); // or "ssl", or "crypto"
``` ```
## Version Support Matrix ## Zig Version Support Matrix
| Refname | LibreSSL Version | Zig `0.12.x` | Zig `0.13.x` | Zig `0.14.0-dev` | | Refname | LibreSSL Version | Zig `0.15.0-dev` | Zig `0.14.x` | Zig `0.13.x` | Zig `0.12.x` |
|----------|------------------|--------------|--------------|------------------| |-----------|------------------|------------------|--------------|--------------|--------------|
| `3.9.2` | `3.9.2` | ✅ | ✅ | ✅ | | `4.0.0+3` | `4.0.0` | ✅ | ✅ | ❌ | ❌ |
| `4.0.0+2` | `4.0.0` | ❌ | ✅ | ❌ | ❌ |
| `4.0.0+1` | `4.0.0` | ❌ | ❌ | ✅ | ✅ |
| `3.9.2+1` | `3.9.2` | ❌ | ❌ | ✅ | ✅ |