Merge pull request #298670 from thillux/mtheil/crypto-lib-modernization

This commit is contained in:
Sandro 2024-07-12 10:43:13 +02:00 committed by GitHub
commit 1a7b2519f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 62 additions and 9 deletions

View file

@ -5,7 +5,7 @@
, which
, zip
, libicns
, botan2
, botan3
, capstone
, jansson
, libunistring
@ -32,14 +32,17 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkg-config which zip ]
++ lib.optionals stdenv.isDarwin [ libicns ];
buildInputs = [ botan2 capstone jansson libunistring wxGTK32 ]
buildInputs = [ botan3 capstone jansson libunistring wxGTK32 ]
++ (with lua53Packages; [ lua busted ])
++ (with perlPackages; [ perl TemplateToolkit ])
++ lib.optionals stdenv.isLinux [ gtk3 ]
++ lib.optionals stdenv.isDarwin [ Carbon Cocoa IOKit ];
makeFlags = [ "prefix=${placeholder "out"}" ]
++ lib.optionals stdenv.isDarwin [ "-f Makefile.osx" ];
makeFlags = [
"prefix=${placeholder "out"}"
"BOTAN_PKG=botan-3"
"CXXSTD=-std=c++20"
] ++ lib.optionals stdenv.isDarwin [ "-f Makefile.osx" ];
enableParallelBuilding = true;

View file

@ -1,7 +1,7 @@
{ lib, stdenv
, fetchFromGitLab
, extra-cmake-modules
, botan2
, botan3
, karchive
, kauth
, libdrm
@ -42,7 +42,7 @@ stdenv.mkDerivation rec{
wrapQtAppsHook
];
buildInputs = [
botan2
botan3
karchive
kauth
libdrm

View file

@ -5,7 +5,7 @@
, qttools
, asciidoctor
, botan2
, botan3
, curl
, libXi
, libXtst
@ -114,7 +114,7 @@ stdenv.mkDerivation rec {
buildInputs = [
curl
botan2
botan3
libXi
libXtst
libargon2

View file

@ -1,7 +1,9 @@
{ callPackage, ... } @ args:
{ callPackage, stdenv, lib, ... } @ args:
callPackage ./generic.nix (args // {
baseVersion = "3.4";
revision = "0";
hash = "sha256-cYQ6/MCixYX48z+jBPC1iuS5xdgwb4lGZ7N0YEQndVc=";
# this patch fixes build errors on MacOS with SDK 10.12, recheck to remove this again
extraPatches = lib.optionals stdenv.hostPlatform.isDarwin [ ./botan3-macos.patch ];
})

View file

@ -0,0 +1,48 @@
diff --git a/src/lib/prov/commoncrypto/commoncrypto_block.cpp b/src/lib/prov/commoncrypto/commoncrypto_block.cpp
index a07fe118d..f059ee497 100644
--- a/src/lib/prov/commoncrypto/commoncrypto_block.cpp
+++ b/src/lib/prov/commoncrypto/commoncrypto_block.cpp
@@ -11,6 +11,7 @@
#include <botan/hex.h>
#include <botan/internal/commoncrypto_utils.h>
+#include <CommonCrypto/CommonCryptoError.h>
#include <CommonCrypto/CommonCrypto.h>
namespace Botan {
diff --git a/src/lib/prov/commoncrypto/commoncrypto_hash.cpp b/src/lib/prov/commoncrypto/commoncrypto_hash.cpp
index 1fb79c419..faf9575c2 100644
--- a/src/lib/prov/commoncrypto/commoncrypto_hash.cpp
+++ b/src/lib/prov/commoncrypto/commoncrypto_hash.cpp
@@ -11,6 +11,7 @@
#include <botan/internal/stl_util.h>
#include <unordered_map>
+#include <CommonCrypto/CommonCryptoError.h>
#include <CommonCrypto/CommonCrypto.h>
namespace Botan {
diff --git a/src/lib/prov/commoncrypto/commoncrypto_utils.h b/src/lib/prov/commoncrypto/commoncrypto_utils.h
index b1c7411fd..9becab2d1 100644
--- a/src/lib/prov/commoncrypto/commoncrypto_utils.h
+++ b/src/lib/prov/commoncrypto/commoncrypto_utils.h
@@ -10,6 +10,7 @@
#include <botan/sym_algo.h>
+#include <CommonCrypto/CommonCryptoError.h>
#include <CommonCrypto/CommonCrypto.h>
namespace Botan {
diff --git a/src/lib/rng/system_rng/system_rng.cpp b/src/lib/rng/system_rng/system_rng.cpp
index b2f7b4c45..f4933b1e3 100644
--- a/src/lib/rng/system_rng/system_rng.cpp
+++ b/src/lib/rng/system_rng/system_rng.cpp
@@ -20,6 +20,7 @@
#include <bcrypt.h>
#include <windows.h>
#elif defined(BOTAN_TARGET_OS_HAS_CCRANDOM)
+ #include <CommonCrypto/CommonCryptoError.h>
#include <CommonCrypto/CommonRandom.h>
#elif defined(BOTAN_TARGET_OS_HAS_ARC4RANDOM)
#include <stdlib.h>