From 3aa447a6bf1f4676e3cb1fbf73b0b54a6c024bd5 Mon Sep 17 00:00:00 2001 From: arckoor <33837362+arckoor@users.noreply.github.com> Date: Thu, 15 Jan 2026 17:27:07 +0100 Subject: [PATCH 1/3] Fix git CI target --- .ci/build.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.ci/build.py b/.ci/build.py index 05f8b98..867548b 100755 --- a/.ci/build.py +++ b/.ci/build.py @@ -118,6 +118,8 @@ def main(args = None): '--disable-modules=%s' % (disabled_modules)], botan_src) run_command(['make', '-j', str(nproc)], botan_src) run_command(['sudo', 'make', 'install'], botan_src) + os.environ["RUSTFLAGS"] = "-D warnings -L/usr/local/lib" + os.environ["RUSTDOCFLAGS"] = "-D warnings -L/usr/local/lib" elif os.access(homebrew_dir, os.R_OK): # only install homebrew botan if not vendored/git run_command(['brew', 'install', 'botan']) From 2bd3379b2b7fab8f22509a18d2c58f859f655478 Mon Sep 17 00:00:00 2001 From: arckoor <33837362+arckoor@users.noreply.github.com> Date: Thu, 15 Jan 2026 17:27:38 +0100 Subject: [PATCH 2/3] Bump FFI version --- README.md | 2 ++ botan-sys/build/main.rs | 8 +++++--- botan/build.rs | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index cbaddbf..0313e9a 100644 --- a/README.md +++ b/README.md @@ -51,3 +51,5 @@ and adjusts itself accordingly. These feature sets can be checked using * 20230403: Botan 3.0 * 20240408: Botan 3.4 * 20250506: Botan 3.8 +* 20250829: Botan 3.10 +* 20260303: Botan 3.11 diff --git a/botan-sys/build/main.rs b/botan-sys/build/main.rs index e61558b..7f8f0f2 100644 --- a/botan-sys/build/main.rs +++ b/botan-sys/build/main.rs @@ -1,7 +1,9 @@ use std::collections::HashMap; use std::path::PathBuf; -const KNOWN_FFI_VERSIONS: [(u32, u32); 7] = [ +const KNOWN_FFI_VERSIONS: [(u32, u32); 9] = [ + (3, 20260303), // 3.11 + (3, 20250829), // 3.10 (3, 20250506), // 3.8 (3, 20240408), // 3.4 (3, 20231009), // 3.2 @@ -11,7 +13,7 @@ const KNOWN_FFI_VERSIONS: [(u32, u32); 7] = [ (2, 20191214), // 2.13 ]; -const LATEST_KNOWN_FFI: u32 = 20250506; +const LATEST_KNOWN_FFI: u32 = 20260303; #[cfg(feature = "vendored")] fn emit_dylibs() -> Vec<&'static str> { @@ -92,7 +94,7 @@ impl DetectedVersionInfo { fn latest_for_docs_rs() -> Self { Self { major_version: 3, - minor_version: 8, + minor_version: 11, ffi_version: LATEST_KNOWN_FFI, } } diff --git a/botan/build.rs b/botan/build.rs index e196eeb..dd8a2d3 100644 --- a/botan/build.rs +++ b/botan/build.rs @@ -3,7 +3,7 @@ use std::str::FromStr; fn main() { let known_ffi_versions = [ - 20250506, 20240408, 20231009, 20230711, 20230403, 20210220, 20191214, + 20260303, 20250829, 20250506, 20240408, 20231009, 20230711, 20230403, 20210220, 20191214, ]; for ffi in &known_ffi_versions { From 56a032fd9fb09656c3f1f671a70fd2095bc8c42f Mon Sep 17 00:00:00 2001 From: arckoor <33837362+arckoor@users.noreply.github.com> Date: Thu, 15 Jan 2026 17:28:36 +0100 Subject: [PATCH 3/3] Add rsa pkcs1 pubkey loader --- botan-sys/src/pubkey.rs | 6 ++++++ botan/src/pubkey.rs | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/botan-sys/src/pubkey.rs b/botan-sys/src/pubkey.rs index fe14c29..cd63e6d 100644 --- a/botan-sys/src/pubkey.rs +++ b/botan-sys/src/pubkey.rs @@ -153,6 +153,12 @@ extern "C" { pub fn botan_privkey_rsa_get_n(n: botan_mp_t, rsa_key: botan_privkey_t) -> c_int; pub fn botan_privkey_rsa_get_e(e: botan_mp_t, rsa_key: botan_privkey_t) -> c_int; pub fn botan_pubkey_load_rsa(key: *mut botan_pubkey_t, n: botan_mp_t, e: botan_mp_t) -> c_int; + #[cfg(botan_ffi_20260303)] + pub fn botan_pubkey_load_rsa_pkcs1( + key: *mut botan_pubkey_t, + bits: *const u8, + len: usize, + ) -> c_int; pub fn botan_pubkey_rsa_get_e(e: botan_mp_t, rsa_key: botan_pubkey_t) -> c_int; pub fn botan_pubkey_rsa_get_n(n: botan_mp_t, rsa_key: botan_pubkey_t) -> c_int; pub fn botan_privkey_load_dsa( diff --git a/botan/src/pubkey.rs b/botan/src/pubkey.rs index 61cb2b2..1764193 100644 --- a/botan/src/pubkey.rs +++ b/botan/src/pubkey.rs @@ -577,6 +577,13 @@ impl Pubkey { Ok(Pubkey { obj }) } + /// Load a PKCS#1 encoded RSA public key + #[cfg(botan_ffi_20260303)] + pub fn load_rsa_pkcs1(pkcs1: &[u8]) -> Result { + let obj = botan_init!(botan_pubkey_load_rsa_pkcs1, pkcs1.as_ptr(), pkcs1.len())?; + Ok(Pubkey { obj }) + } + /// Load an DH public key (p,g,y) pub fn load_dh(p: &MPI, g: &MPI, y: &MPI) -> Result { let obj = botan_init!(botan_pubkey_load_dh, p.handle(), g.handle(), y.handle())?;