Compare commits
2 Commits
master
...
7f95731326
Author | SHA1 | Date | |
---|---|---|---|
7f95731326
|
|||
c16205d9a7
|
16
.github/workflows/ci.yaml
vendored
16
.github/workflows/ci.yaml
vendored
@@ -12,30 +12,28 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
zig-version: ["0.14.1"]
|
||||
os: [macos-latest, windows-latest]
|
||||
zig-version: ["0.13.0"]
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
include:
|
||||
- zig-version: "0.14.1"
|
||||
- zig-version: "0.12.1"
|
||||
os: ubuntu-latest
|
||||
- zig-version: "master"
|
||||
check-format: true
|
||||
os: ubuntu-latest
|
||||
build-options: "-Dbuild-apps"
|
||||
|
||||
- zig-version: "master"
|
||||
os: ubuntu-latest
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Zig
|
||||
uses: mlugg/setup-zig@v2
|
||||
uses: mlugg/setup-zig@v1
|
||||
with:
|
||||
version: ${{ matrix.zig-version }}
|
||||
|
||||
- if: ${{ matrix.check-format }}
|
||||
name: Check Formatting
|
||||
run: zig fmt --ast-check --check .
|
||||
run: zig fmt --check .
|
||||
|
||||
- name: Build
|
||||
run: zig build ${{ matrix.build-options }} --summary all
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,2 +0,0 @@
|
||||
.zig-cache
|
||||
zig-out
|
286
build.zig
286
build.zig
@@ -11,30 +11,36 @@ pub fn build(b: *std.Build) !void {
|
||||
|
||||
const upstream = b.dependency("libressl", .{});
|
||||
const libressl_common: LibreSslCommon = .{
|
||||
.libcrypto = b.addLibrary(.{
|
||||
.libcrypto = b.addStaticLibrary(.{
|
||||
.name = "crypto",
|
||||
.root_module = b.createModule(.{ .target = target, .optimize = optimize }),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
}),
|
||||
.libssl = b.addLibrary(.{
|
||||
.libssl = b.addStaticLibrary(.{
|
||||
.name = "ssl",
|
||||
.root_module = b.createModule(.{ .target = target, .optimize = optimize }),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
}),
|
||||
.libtls = b.addLibrary(.{
|
||||
.libtls = b.addStaticLibrary(.{
|
||||
.name = "tls",
|
||||
.root_module = b.createModule(.{ .target = target, .optimize = optimize }),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
}),
|
||||
.apps = .{
|
||||
.nc = b.addExecutable(.{
|
||||
.name = "nc",
|
||||
.root_module = b.createModule(.{ .target = target, .optimize = optimize }),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
}),
|
||||
.ocspcheck = b.addExecutable(.{
|
||||
.name = "ocspcheck",
|
||||
.root_module = b.createModule(.{ .target = target, .optimize = optimize }),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
}),
|
||||
.openssl = b.addExecutable(.{
|
||||
.name = "openssl",
|
||||
.root_module = b.createModule(.{ .target = target, .optimize = optimize }),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
}),
|
||||
},
|
||||
};
|
||||
@@ -108,21 +114,20 @@ pub fn build(b: *std.Build) !void {
|
||||
.flags = cflags,
|
||||
});
|
||||
|
||||
libressl_common.libcrypto.root_module.addCMacro("AES_ASM", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("BSAES_ASM", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("VPAES_ASM", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("OPENSSL_IA32_SSE2", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("OPENSSL_BN_ASM_MONT", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("OPENSSL_BN_ASM_MONT5", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("MD5_ASM", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("GHASH_ASM", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("RSA_ASM", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("SHA1_ASM", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("SHA256_ASM", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("SHA512_ASM", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("WHIRLPOOL_ASM", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("OPENSSL_CPUID_OBJ", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("HAVE_GNU_STACK", "");
|
||||
libressl_common.libcrypto.defineCMacro("AES_ASM", null);
|
||||
libressl_common.libcrypto.defineCMacro("BSAES_ASM", null);
|
||||
libressl_common.libcrypto.defineCMacro("VPAES_ASM", null);
|
||||
libressl_common.libcrypto.defineCMacro("OPENSSL_IA32_SSE2", null);
|
||||
libressl_common.libcrypto.defineCMacro("OPENSSL_BN_ASM_MONT", null);
|
||||
libressl_common.libcrypto.defineCMacro("OPENSSL_BN_ASM_MONT5", null);
|
||||
libressl_common.libcrypto.defineCMacro("MD5_ASM", null);
|
||||
libressl_common.libcrypto.defineCMacro("GHASH_ASM", null);
|
||||
libressl_common.libcrypto.defineCMacro("RSA_ASM", null);
|
||||
libressl_common.libcrypto.defineCMacro("SHA1_ASM", null);
|
||||
libressl_common.libcrypto.defineCMacro("SHA256_ASM", null);
|
||||
libressl_common.libcrypto.defineCMacro("SHA512_ASM", null);
|
||||
libressl_common.libcrypto.defineCMacro("WHIRLPOOL_ASM", null);
|
||||
libressl_common.libcrypto.defineCMacro("OPENSSL_CPUID_OBJ", null);
|
||||
} else if (tinfo.cpu.arch == .arm) {
|
||||
libressl_common.libcrypto.addCSourceFiles(.{
|
||||
.root = crypto_srcroot,
|
||||
@@ -135,55 +140,55 @@ pub fn build(b: *std.Build) !void {
|
||||
.flags = cflags,
|
||||
});
|
||||
|
||||
libressl_common.libcrypto.root_module.addCMacro("AES_ASM", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("OPENSSL_BN_ASM_MONT", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("GHASH_ASM", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("SHA1_ASM", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("SHA256_ASM", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("SHA512_ASM", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("OPENSSL_CPUID_OBJ", "");
|
||||
libressl_common.libcrypto.defineCMacro("AES_ASM", null);
|
||||
libressl_common.libcrypto.defineCMacro("OPENSSL_BN_ASM_MONT", null);
|
||||
libressl_common.libcrypto.defineCMacro("GHASH_ASM", null);
|
||||
libressl_common.libcrypto.defineCMacro("SHA1_ASM", null);
|
||||
libressl_common.libcrypto.defineCMacro("SHA256_ASM", null);
|
||||
libressl_common.libcrypto.defineCMacro("SHA512_ASM", null);
|
||||
libressl_common.libcrypto.defineCMacro("OPENSSL_CPUID_OBJ", null);
|
||||
} else {
|
||||
build_asm = false;
|
||||
}
|
||||
} else if (tinfo.os.tag.isDarwin() and tinfo.cpu.arch == .x86_64) {
|
||||
} else if (tinfo.isDarwin() and tinfo.cpu.arch == .x86_64) {
|
||||
libressl_common.libcrypto.addCSourceFiles(.{
|
||||
.root = crypto_srcroot,
|
||||
.files = libcrypto_macos_x86_64_asm,
|
||||
.flags = cflags,
|
||||
});
|
||||
|
||||
libressl_common.libcrypto.root_module.addCMacro("AES_ASM", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("BSAES_ASM", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("VPAES_ASM", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("OPENSSL_IA32_SSE2", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("OPENSSL_BN_ASM_MONT", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("OPENSSL_BN_ASM_MONT5", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("MD5_ASM", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("GHASH_ASM", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("RSA_ASM", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("SHA1_ASM", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("SHA256_ASM", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("SHA512_ASM", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("WHIRLPOOL_ASM", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("OPENSSL_CPUID_OBJ", "");
|
||||
libressl_common.libcrypto.defineCMacro("AES_ASM", null);
|
||||
libressl_common.libcrypto.defineCMacro("BSAES_ASM", null);
|
||||
libressl_common.libcrypto.defineCMacro("VPAES_ASM", null);
|
||||
libressl_common.libcrypto.defineCMacro("OPENSSL_IA32_SSE2", null);
|
||||
libressl_common.libcrypto.defineCMacro("OPENSSL_BN_ASM_MONT", null);
|
||||
libressl_common.libcrypto.defineCMacro("OPENSSL_BN_ASM_MONT5", null);
|
||||
libressl_common.libcrypto.defineCMacro("MD5_ASM", null);
|
||||
libressl_common.libcrypto.defineCMacro("GHASH_ASM", null);
|
||||
libressl_common.libcrypto.defineCMacro("RSA_ASM", null);
|
||||
libressl_common.libcrypto.defineCMacro("SHA1_ASM", null);
|
||||
libressl_common.libcrypto.defineCMacro("SHA256_ASM", null);
|
||||
libressl_common.libcrypto.defineCMacro("SHA512_ASM", null);
|
||||
libressl_common.libcrypto.defineCMacro("WHIRLPOOL_ASM", null);
|
||||
libressl_common.libcrypto.defineCMacro("OPENSSL_CPUID_OBJ", null);
|
||||
} else if (tinfo.os.tag == .windows and tinfo.abi == .gnu) {
|
||||
libressl_common.libcrypto.addCSourceFiles(.{
|
||||
.root = crypto_srcroot,
|
||||
.files = libcrypto_mingw64_x86_64_asm,
|
||||
.flags = cflags,
|
||||
});
|
||||
libressl_common.libcrypto.root_module.addCMacro("AES_ASM", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("BSAES_ASM", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("VPAES_ASM", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("OPENSSL_IA32_SSE2", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("MD5_ASM", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("GHASH_ASM", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("RSA_ASM", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("SHA1_ASM", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("SHA256_ASM", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("SHA512_ASM", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("WHIRLPOOL_ASM", "");
|
||||
libressl_common.libcrypto.root_module.addCMacro("OPENSSL_CPUID_OBJ", "");
|
||||
libressl_common.libcrypto.defineCMacro("AES_ASM", null);
|
||||
libressl_common.libcrypto.defineCMacro("BSAES_ASM", null);
|
||||
libressl_common.libcrypto.defineCMacro("VPAES_ASM", null);
|
||||
libressl_common.libcrypto.defineCMacro("OPENSSL_IA32_SSE2", null);
|
||||
libressl_common.libcrypto.defineCMacro("MD5_ASM", null);
|
||||
libressl_common.libcrypto.defineCMacro("GHASH_ASM", null);
|
||||
libressl_common.libcrypto.defineCMacro("RSA_ASM", null);
|
||||
libressl_common.libcrypto.defineCMacro("SHA1_ASM", null);
|
||||
libressl_common.libcrypto.defineCMacro("SHA256_ASM", null);
|
||||
libressl_common.libcrypto.defineCMacro("SHA512_ASM", null);
|
||||
libressl_common.libcrypto.defineCMacro("WHIRLPOOL_ASM", null);
|
||||
libressl_common.libcrypto.defineCMacro("OPENSSL_CPUID_OBJ", null);
|
||||
} else {
|
||||
build_asm = false;
|
||||
}
|
||||
@@ -199,15 +204,15 @@ pub fn build(b: *std.Build) !void {
|
||||
.files = libcrypto_nonasm,
|
||||
.flags = cflags,
|
||||
});
|
||||
libressl_common.addCMacro("OPENSSL_NO_ASM", "");
|
||||
libressl_common.defineCMacro("OPENSSL_NO_ASM", null);
|
||||
}
|
||||
|
||||
libressl_common.addCMacro("OPENSSLDIR", std.fmt.allocPrint(b.allocator, "\"{s}\"", .{resolved_openssl_dir}) catch @panic("OOM"));
|
||||
libressl_common.addCMacro("LIBRESSL_INTERNAL", "");
|
||||
libressl_common.addCMacro("OPENSSL_NO_HW_PADLOCK", "");
|
||||
libressl_common.addCMacro("__BEGIN_HIDDEN_DECLS", "");
|
||||
libressl_common.addCMacro("__END_HIDDEN_DECLS", "");
|
||||
libressl_common.addCMacro("LIBRESSL_CRYPTO_INTERNAL", "");
|
||||
libressl_common.defineCMacro("OPENSSLDIR", std.fmt.allocPrint(b.allocator, "\"{s}\"", .{resolved_openssl_dir}) catch @panic("OOM"));
|
||||
libressl_common.defineCMacro("LIBRESSL_INTERNAL", null);
|
||||
libressl_common.defineCMacro("OPENSSL_NO_HW_PADLOCK", null);
|
||||
libressl_common.defineCMacro("__BEGIN_HIDDEN_DECLS", "");
|
||||
libressl_common.defineCMacro("__END_HIDDEN_DECLS", "");
|
||||
libressl_common.defineCMacro("LIBRESSL_CRYPTO_INTERNAL", null);
|
||||
|
||||
switch (tinfo.os.tag) {
|
||||
.linux => {
|
||||
@@ -228,28 +233,28 @@ pub fn build(b: *std.Build) !void {
|
||||
.flags = cflags,
|
||||
});
|
||||
|
||||
libressl_common.addCMacro("_DEFAULT_SOURCE", "");
|
||||
libressl_common.addCMacro("_BSD_SOURCE", "");
|
||||
libressl_common.addCMacro("_POSIX_SOURCE", "");
|
||||
libressl_common.addCMacro("_GNU_SOURCE", "");
|
||||
libressl_common.defineCMacro("_DEFAULT_SOURCE", null);
|
||||
libressl_common.defineCMacro("_BSD_SOURCE", null);
|
||||
libressl_common.defineCMacro("_POSIX_SOURCE", null);
|
||||
libressl_common.defineCMacro("_GNU_SOURCE", null);
|
||||
|
||||
libressl_common.addCMacro("HAVE_ASPRINTF", "");
|
||||
libressl_common.defineCMacro("HAVE_ASPRINTF", null);
|
||||
|
||||
libressl_common.addCMacro("HAVE_STRCASECMP", "");
|
||||
libressl_common.defineCMacro("HAVE_STRCASECMP", null);
|
||||
|
||||
libressl_common.addCMacro("HAVE_STRNDUP", "");
|
||||
libressl_common.addCMacro("HAVE_STRNLEN", "");
|
||||
libressl_common.addCMacro("HAVE_STRSEP", "");
|
||||
libressl_common.defineCMacro("HAVE_STRNDUP", null);
|
||||
libressl_common.defineCMacro("HAVE_STRNLEN", null);
|
||||
libressl_common.defineCMacro("HAVE_STRSEP", null);
|
||||
|
||||
libressl_common.addCMacro("HAVE_EXPLICIT_BZERO", "");
|
||||
libressl_common.addCMacro("HAVE_GETAUXVAL", "");
|
||||
libressl_common.addCMacro("HAVE_GETPAGESIZE", "");
|
||||
libressl_common.defineCMacro("HAVE_EXPLICIT_BZERO", null);
|
||||
libressl_common.defineCMacro("HAVE_GETAUXVAL", null);
|
||||
libressl_common.defineCMacro("HAVE_GETPAGESIZE", null);
|
||||
|
||||
libressl_common.addCMacro("HAVE_SYSLOG", "");
|
||||
libressl_common.addCMacro("HAVE_MEMMEM", "");
|
||||
libressl_common.addCMacro("HAVE_ENDIAN_H", "");
|
||||
libressl_common.addCMacro("HAVE_ERR_H", "");
|
||||
libressl_common.addCMacro("HAVE_NETINET_IP_H", "");
|
||||
libressl_common.defineCMacro("HAVE_SYSLOG", null);
|
||||
libressl_common.defineCMacro("HAVE_MEMMEM", null);
|
||||
libressl_common.defineCMacro("HAVE_ENDIAN_H", null);
|
||||
libressl_common.defineCMacro("HAVE_ERR_H", null);
|
||||
libressl_common.defineCMacro("HAVE_NETINET_IP_H", null);
|
||||
|
||||
if (tinfo.abi.isGnu()) {
|
||||
libressl_common.libcrypto.addCSourceFiles(.{
|
||||
@@ -264,9 +269,9 @@ pub fn build(b: *std.Build) !void {
|
||||
.flags = cflags,
|
||||
});
|
||||
|
||||
libressl_common.addCMacro("HAVE_STRLCAT", "");
|
||||
libressl_common.addCMacro("HAVE_STRLCPY", "");
|
||||
libressl_common.addCMacro("HAVE_GETENTROPY", "");
|
||||
libressl_common.defineCMacro("HAVE_STRLCAT", null);
|
||||
libressl_common.defineCMacro("HAVE_STRLCPY", null);
|
||||
libressl_common.defineCMacro("HAVE_GETENTROPY", null);
|
||||
} else @panic("weird ABI, dude");
|
||||
|
||||
libressl_common.linkSystemLibrary("pthread");
|
||||
@@ -300,39 +305,39 @@ pub fn build(b: *std.Build) !void {
|
||||
});
|
||||
|
||||
if (tinfo.abi != .msvc) {
|
||||
libressl_common.addCMacro("_GNU_SOURCE", "");
|
||||
libressl_common.addCMacro("_POSIX", "");
|
||||
libressl_common.addCMacro("_POSIX_SOURCE", "");
|
||||
libressl_common.addCMacro("__USE_MINGW_ANSI_STDIO", "");
|
||||
libressl_common.defineCMacro("_GNU_SOURCE", null);
|
||||
libressl_common.defineCMacro("_POSIX", null);
|
||||
libressl_common.defineCMacro("_POSIX_SOURCE", null);
|
||||
libressl_common.defineCMacro("__USE_MINGW_ANSI_STDIO", null);
|
||||
}
|
||||
|
||||
libressl_common.addCMacro("_CRT_SECURE_NO_WARNINGS", "");
|
||||
libressl_common.addCMacro("_CRT_DEPRECATED_NO_WARNINGS", "");
|
||||
libressl_common.addCMacro("_REENTRANT", "");
|
||||
libressl_common.addCMacro("_POSIX_THREAD_SAFE_FUNCTIONS", "");
|
||||
libressl_common.addCMacro("CPPFLAGS", "");
|
||||
libressl_common.addCMacro("NO_SYSLOG", "");
|
||||
libressl_common.addCMacro("NO_CRYPT", "");
|
||||
libressl_common.addCMacro("WIN32_LEAN_AND_MEAN", "");
|
||||
libressl_common.addCMacroForLibs("_WIN32_WINNT", "0x0600");
|
||||
libressl_common.defineCMacro("_CRT_SECURE_NO_WARNINGS", null);
|
||||
libressl_common.defineCMacro("_CRT_DEPRECATED_NO_WARNINGS", null);
|
||||
libressl_common.defineCMacro("_REENTRANT", null);
|
||||
libressl_common.defineCMacro("_POSIX_THREAD_SAFE_FUNCTIONS", null);
|
||||
libressl_common.defineCMacro("CPPFLAGS", null);
|
||||
libressl_common.defineCMacro("NO_SYSLOG", null);
|
||||
libressl_common.defineCMacro("NO_CRYPT", null);
|
||||
libressl_common.defineCMacro("WIN32_LEAN_AND_MEAN", null);
|
||||
libressl_common.defineCMacroForLibs("_WIN32_WINNT", "0x0600");
|
||||
|
||||
libressl_common.addCMacro("HAVE_ASPRINTF", "");
|
||||
libressl_common.addCMacro("HAVE_STRCASECMP", "");
|
||||
libressl_common.addCMacro("HAVE_STRNLEN", "");
|
||||
libressl_common.addCMacro("HAVE_GETAUXVAL", "");
|
||||
libressl_common.defineCMacro("HAVE_ASPRINTF", null);
|
||||
libressl_common.defineCMacro("HAVE_STRCASECMP", null);
|
||||
libressl_common.defineCMacro("HAVE_STRNLEN", null);
|
||||
libressl_common.defineCMacro("HAVE_GETAUXVAL", null);
|
||||
|
||||
libressl_common.addCMacro("HAVE_TIMESPECSUB", "");
|
||||
libressl_common.addCMacro("HAVE_MEMMEM", "");
|
||||
libressl_common.addCMacro("HAVE_MACHINE_ENDIAN_H", "");
|
||||
libressl_common.addCMacro("HAVE_READPASSPHRASE", "");
|
||||
libressl_common.addCMacro("HAVE_ACCEPT4", "");
|
||||
libressl_common.addCMacro("HAVE_NETINET_IP_H", "");
|
||||
libressl_common.defineCMacro("HAVE_TIMESPECSUB", null);
|
||||
libressl_common.defineCMacro("HAVE_MEMMEM", null);
|
||||
libressl_common.defineCMacro("HAVE_MACHINE_ENDIAN_H", null);
|
||||
libressl_common.defineCMacro("HAVE_READPASSPHRASE", null);
|
||||
libressl_common.defineCMacro("HAVE_ACCEPT4", null);
|
||||
libressl_common.defineCMacro("HAVE_NETINET_IP_H", null);
|
||||
|
||||
libressl_common.linkSystemLibrary("ws2_32");
|
||||
libressl_common.linkSystemLibrary("bcrypt");
|
||||
},
|
||||
|
||||
else => if (tinfo.os.tag.isDarwin()) {
|
||||
else => if (tinfo.isDarwin()) {
|
||||
libressl_common.libcrypto.addCSourceFiles(.{
|
||||
.root = crypto_srcroot,
|
||||
.files = libcrypto_unix_sources,
|
||||
@@ -349,24 +354,24 @@ pub fn build(b: *std.Build) !void {
|
||||
.flags = cflags,
|
||||
});
|
||||
|
||||
libressl_common.addCMacro("HAVE_CLOCK_GETTIME", "");
|
||||
libressl_common.addCMacro("HAVE_ASPRINTF", "");
|
||||
libressl_common.addCMacro("HAVE_STRCASECMP", "");
|
||||
libressl_common.addCMacro("HAVE_STRLCAT", "");
|
||||
libressl_common.addCMacro("HAVE_STRLCPY", "");
|
||||
libressl_common.addCMacro("HAVE_STRNDUP", "");
|
||||
libressl_common.addCMacro("HAVE_STRNLEN", "");
|
||||
libressl_common.addCMacro("HAVE_STRSEP", "");
|
||||
libressl_common.addCMacro("HAVE_STRTONUM", "");
|
||||
libressl_common.addCMacro("HAVE_ARC4RANDOM_BUF", "");
|
||||
libressl_common.addCMacro("HAVE_ARC4RANDOM_UNIFORM", "");
|
||||
libressl_common.addCMacro("HAVE_GETENTROPY", "");
|
||||
libressl_common.addCMacro("HAVE_GETPAGESIZE", "");
|
||||
libressl_common.addCMacro("HAVE_GETPROGNAME", "");
|
||||
libressl_common.addCMacro("HAVE_MEMMEM", "");
|
||||
libressl_common.addCMacro("HAVE_MACHINE_ENDIAN_H", "");
|
||||
libressl_common.addCMacro("HAVE_ERR_H", "");
|
||||
libressl_common.addCMacro("HAVE_NETINET_IP_H", "");
|
||||
libressl_common.defineCMacro("HAVE_CLOCK_GETTIME", null);
|
||||
libressl_common.defineCMacro("HAVE_ASPRINTF", null);
|
||||
libressl_common.defineCMacro("HAVE_STRCASECMP", null);
|
||||
libressl_common.defineCMacro("HAVE_STRLCAT", null);
|
||||
libressl_common.defineCMacro("HAVE_STRLCPY", null);
|
||||
libressl_common.defineCMacro("HAVE_STRNDUP", null);
|
||||
libressl_common.defineCMacro("HAVE_STRNLEN", null);
|
||||
libressl_common.defineCMacro("HAVE_STRSEP", null);
|
||||
libressl_common.defineCMacro("HAVE_STRTONUM", null);
|
||||
libressl_common.defineCMacro("HAVE_ARC4RANDOM_BUF", null);
|
||||
libressl_common.defineCMacro("HAVE_ARC4RANDOM_UNIFORM", null);
|
||||
libressl_common.defineCMacro("HAVE_GETENTROPY", null);
|
||||
libressl_common.defineCMacro("HAVE_GETPAGESIZE", null);
|
||||
libressl_common.defineCMacro("HAVE_GETPROGNAME", null);
|
||||
libressl_common.defineCMacro("HAVE_MEMMEM", null);
|
||||
libressl_common.defineCMacro("HAVE_MACHINE_ENDIAN_H", null);
|
||||
libressl_common.defineCMacro("HAVE_ERR_H", null);
|
||||
libressl_common.defineCMacro("HAVE_NETINET_IP_H", null);
|
||||
|
||||
if (tinfo.cpu.arch == .x86_64 and build_asm) {} else {}
|
||||
} else {
|
||||
@@ -493,8 +498,8 @@ pub fn build(b: *std.Build) !void {
|
||||
libressl_common.installLibraries(b);
|
||||
|
||||
// weird hack here
|
||||
libressl_common.apps.nc.root_module.addCMacro("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.defineCMacro("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.nc.linkLibrary(libressl_common.libtls);
|
||||
libressl_common.apps.ocspcheck.linkLibrary(libressl_common.libtls);
|
||||
libressl_common.apps.openssl.linkLibrary(libressl_common.libssl);
|
||||
@@ -526,17 +531,17 @@ const LibreSslCommon = struct {
|
||||
self.libtls.linkSystemLibrary(library);
|
||||
}
|
||||
|
||||
pub fn addCMacroForLibs(self: LibreSslCommon, name: []const u8, value: []const u8) void {
|
||||
self.libcrypto.root_module.addCMacro(name, value);
|
||||
self.libssl.root_module.addCMacro(name, value);
|
||||
self.libtls.root_module.addCMacro(name, value);
|
||||
pub fn defineCMacroForLibs(self: LibreSslCommon, name: []const u8, value: ?[]const u8) void {
|
||||
self.libcrypto.defineCMacro(name, value);
|
||||
self.libssl.defineCMacro(name, value);
|
||||
self.libtls.defineCMacro(name, value);
|
||||
}
|
||||
|
||||
pub fn addCMacro(self: LibreSslCommon, name: []const u8, value: []const u8) void {
|
||||
self.addCMacroForLibs(name, value);
|
||||
self.apps.nc.root_module.addCMacro(name, value);
|
||||
self.apps.ocspcheck.root_module.addCMacro(name, value);
|
||||
self.apps.openssl.root_module.addCMacro(name, value);
|
||||
pub fn defineCMacro(self: LibreSslCommon, name: []const u8, value: ?[]const u8) void {
|
||||
self.defineCMacroForLibs(name, value);
|
||||
self.apps.nc.defineCMacro(name, value);
|
||||
self.apps.ocspcheck.defineCMacro(name, value);
|
||||
self.apps.openssl.defineCMacro(name, value);
|
||||
}
|
||||
|
||||
pub fn installLibraries(self: LibreSslCommon, b: *std.Build) void {
|
||||
@@ -599,7 +604,9 @@ const libssl_src_prefix = base_src_prefix ++ "ssl/";
|
||||
const libtls_src_prefix = base_src_prefix ++ "tls/";
|
||||
|
||||
// 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 = &.{
|
||||
libcrypto_src_prefix,
|
||||
@@ -802,7 +809,6 @@ const libcrypto_sources: []const []const u8 = &.{
|
||||
"mem_dbg.c",
|
||||
"o_fips.c",
|
||||
"aes/aes.c",
|
||||
"aes/aes_core.c",
|
||||
"aes/aes_ige.c",
|
||||
"asn1/a_bitstr.c",
|
||||
"asn1/a_enum.c",
|
||||
|
@@ -1,12 +1,11 @@
|
||||
.{
|
||||
.name = .libressl,
|
||||
.fingerprint = 0x203FA82BE0954AFA,
|
||||
.name = "libressl",
|
||||
.version = "4.0.0",
|
||||
.minimum_zig_version = "0.14.0",
|
||||
.minimum_zig_version = "0.12.0",
|
||||
.dependencies = .{
|
||||
.libressl = .{
|
||||
.url = "https://github.com/libressl/portable/releases/download/v4.0.0/libressl-4.0.0.tar.gz",
|
||||
.hash = "N-V-__8AAGvDTQHGV38aqRN9PCALgEg4_XExU4juxdTJMTVQ",
|
||||
.hash = "1220c6577f1aa9137d3c200b804838fd71315388eec5d4c9313550143d02fe69308b",
|
||||
},
|
||||
},
|
||||
.paths = .{
|
||||
|
10
readme.md
10
readme.md
@@ -38,9 +38,7 @@ your_exe.linkLibrary(libressl_dependency.artifact("tls")); // or "ssl", or "cryp
|
||||
|
||||
## Zig Version Support Matrix
|
||||
|
||||
| Refname | LibreSSL Version | Zig `0.15.0-dev` | Zig `0.14.x` | Zig `0.13.x` | Zig `0.12.x` |
|
||||
|-----------|------------------|------------------|--------------|--------------|--------------|
|
||||
| `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` | ❌ | ❌ | ✅ | ✅ |
|
||||
| Refname | LibreSSL Version | Zig `0.12.x` | Zig `0.13.x` | Zig `0.14.0-dev` |
|
||||
|----------|------------------|--------------|--------------|------------------|
|
||||
| `3.9.2+1`| `3.9.2+1` | ✅ | ✅ | ✅ |
|
||||
| `4.0.0` | `4.0.0` | ✅ | ✅ | ✅ |
|
||||
|
Reference in New Issue
Block a user