Skip to content

Commit 0ef295b

Browse files
authored
botan: 3.6.1 -> 3.8.1 (#404895)
2 parents e334388 + 2b4f626 commit 0ef295b

File tree

2 files changed

+40
-10
lines changed

2 files changed

+40
-10
lines changed

pkgs/by-name/es/esdm/package.nix

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
drngChaCha20 ? false, # set the default drng callback
2424
ais2031 ? false, # set the seeding strategy to be compliant with AIS 20/31
2525
sp80090c ? false, # set compliance with NIST SP800-90C
26-
cryptoBackend ? "botan", # set backend for hash and drbg operations
26+
cryptoBackend ? "builtin", # set backend for hash and drbg operations
2727
linuxDevFiles ? true, # enable linux /dev/random and /dev/urandom support
2828
linuxGetRandom ? true, # enable linux getrandom support
2929
hashSha512 ? false, # set the conditioning hash: SHA2-512
3030
hashSha3_512 ? true, # set the conditioning hash: SHA3-512
31-
openSSLRandProvider ? true, # build ESDM provider for OpenSSL 3.x
32-
botanRng ? true, # build ESDM class for Botan 3.x
31+
openSSLRandProvider ? false, # build ESDM provider for OpenSSL 3.x
32+
botanRng ? false, # build ESDM class for Botan 3.x
3333

3434
# client-related options (handle with care, consult source code and meson options)
3535
# leave as is if in doubt
@@ -56,10 +56,7 @@
5656

5757
assert drngHashDrbg != drngChaCha20;
5858
assert hashSha512 != hashSha3_512;
59-
assert
60-
cryptoBackend == "openssl"
61-
|| cryptoBackend == "botan"
62-
|| cryptoBackend == "builtin" "Unsupported ESDM crypto backend";
59+
assert cryptoBackend == "openssl" || cryptoBackend == "botan" || cryptoBackend == "builtin";
6360

6461
stdenv.mkDerivation rec {
6562
pname = "esdm";

pkgs/development/libraries/botan/default.nix

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,23 @@
77
bzip2,
88
zlib,
99
jitterentropy,
10+
darwin,
11+
esdm,
12+
tpm2-tss,
1013
static ? stdenv.hostPlatform.isStatic, # generates static libraries *only*
14+
15+
# build ESDM RNG plugin
16+
with_esdm ? false,
17+
# useful, but have to disable tests for now, as /dev/tpmrm0 is not accessible
18+
with_tpm2 ? false,
19+
# only allow BSI approved algorithms, FFI and SHAKE for XMSS
20+
with_bsi_policy ? false,
21+
# only allow NIST approved algorithms
22+
with_fips140_policy ? false,
1123
}:
1224

25+
assert (!with_bsi_policy && !with_fips140_policy) || (with_bsi_policy != with_fips140_policy);
26+
1327
let
1428
common =
1529
{
@@ -50,9 +64,14 @@ let
5064
bzip2
5165
zlib
5266
]
53-
67+
++ lib.optionals (stdenv.hostPlatform.isLinux && with_tpm2) [
68+
tpm2-tss
69+
]
5470
++ lib.optionals (lib.versionAtLeast version "3.6.0") [
5571
jitterentropy
72+
]
73+
++ lib.optionals (lib.versionAtLeast version "3.7.0" && with_esdm) [
74+
esdm
5675
];
5776

5877
buildTargets =
@@ -77,8 +96,22 @@ let
7796
++ lib.optionals stdenv.cc.isClang [
7897
"--cc=clang"
7998
]
99+
++ lib.optionals (stdenv.hostPlatform.isLinux && with_tpm2) [
100+
"--with-tpm2"
101+
]
80102
++ lib.optionals (lib.versionAtLeast version "3.6.0") [
81103
"--enable-modules=jitter_rng"
104+
]
105+
++ lib.optionals (lib.versionAtLeast version "3.7.0" && with_esdm) [
106+
"--enable-modules=esdm_rng"
107+
]
108+
++ lib.optionals (lib.versionAtLeast version "3.8.0" && with_bsi_policy) [
109+
"--module-policy=bsi"
110+
"--enable-module=ffi"
111+
"--enable-module=shake"
112+
]
113+
++ lib.optionals (lib.versionAtLeast version "3.8.0" && with_fips140_policy) [
114+
"--module-policy=fips140"
82115
];
83116

84117
configurePhase = ''
@@ -115,8 +148,8 @@ let
115148
in
116149
{
117150
botan3 = common {
118-
version = "3.6.1";
119-
hash = "sha256-fLhXXYjSMsdxdHadf54ku0REQWBYWYbuvWbnScuakIk=";
151+
version = "3.8.1";
152+
hash = "sha256-sDloHUuGGi9YU3Rti6gG9VPiOGntctie2/o8Pb+hfmg=";
120153
};
121154

122155
botan2 = common {

0 commit comments

Comments
 (0)