Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .ci/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Comment on lines +121 to +122

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why it worked so far, I don't know why it doesn't work anymore, but this fixes the CI git failure

elif os.access(homebrew_dir, os.R_OK):
# only install homebrew botan if not vendored/git
run_command(['brew', 'install', 'botan'])
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 5 additions & 3 deletions botan-sys/build/main.rs
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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> {
Expand Down Expand Up @@ -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,
}
}
Expand Down
6 changes: 6 additions & 0 deletions botan-sys/src/pubkey.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion botan/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 7 additions & 0 deletions botan/src/pubkey.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Pubkey> {
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<Pubkey> {
let obj = botan_init!(botan_pubkey_load_dh, p.handle(), g.handle(), y.handle())?;
Expand Down
Loading