diff --git a/tss-esapi-sys/Cargo.toml b/tss-esapi-sys/Cargo.toml index 7e4f0d5d..325e5cf3 100644 --- a/tss-esapi-sys/Cargo.toml +++ b/tss-esapi-sys/Cargo.toml @@ -13,7 +13,7 @@ documentation = "https://docs.rs/crate/tss-esapi-sys" links = "tss2-esys" [build-dependencies] -bindgen = { version = "0.63.0", optional = true } +bindgen = { version = "0.66.1", optional = true } pkg-config = "0.3.18" target-lexicon = "0.12.0" diff --git a/tss-esapi-sys/build.rs b/tss-esapi-sys/build.rs index 1ab75d82..80bcb2cf 100644 --- a/tss-esapi-sys/build.rs +++ b/tss-esapi-sys/build.rs @@ -4,7 +4,7 @@ #[cfg(feature = "generate-bindings")] use std::path::PathBuf; -const MINIMUM_VERSION: &str = "2.3.3"; +const MINIMUM_VERSION: &str = "2.4.6"; fn main() { if std::env::var("DOCS_RS").is_ok() { @@ -100,7 +100,6 @@ pub fn generate_from_system(esapi_out: PathBuf) { .clang_arg(format!("-I{}/tss2/", tss2_esys_include_path)) .clang_arg(format!("-I{}/tss2/", tss2_tctildr_include_path)) .clang_arg(format!("-I{}/tss2/", tss2_mu_include_path)) - .rustfmt_bindings(true) .header(format!("{}/tss2/tss2_esys.h", tss2_esys_include_path)) .header(format!("{}/tss2/tss2_tctildr.h", tss2_tctildr_include_path)) .header(format!("{}/tss2/tss2_mu.h", tss2_mu_include_path)) diff --git a/tss-esapi-sys/regenerate-bindings.sh b/tss-esapi-sys/regenerate-bindings.sh index e1a65c77..87390c3d 100755 --- a/tss-esapi-sys/regenerate-bindings.sh +++ b/tss-esapi-sys/regenerate-bindings.sh @@ -11,7 +11,7 @@ set -euf -o pipefail OPENSSL_GIT="https://github.com/openssl/openssl.git" OPENSSL_VERSION="OpenSSL_1_1_1j" TPM2_TSS_GIT="https://github.com/tpm2-software/tpm2-tss.git" -TPM2_TSS_VERSION="2.3.3" +TPM2_TSS_VERSION="2.4.6" export SYSROOT="/tmp/sysroot" @@ -103,4 +103,4 @@ cross-compile-tpm2-tss arm-linux-gnueabi rustup target add armv7-unknown-linux-gnueabi cargo clean cargo build --features generate-bindings --target armv7-unknown-linux-gnueabi -find ../target -name tss_esapi_bindings.rs -exec cp {} ./src/bindings/arm-unknown-linux-gnueabi.rs \; \ No newline at end of file +find ../target -name tss_esapi_bindings.rs -exec cp {} ./src/bindings/arm-unknown-linux-gnueabi.rs \; diff --git a/tss-esapi-sys/src/bindings/aarch64-unknown-linux-gnu.rs b/tss-esapi-sys/src/bindings/aarch64-unknown-linux-gnu.rs index 60adedd4..79a93fd6 100644 --- a/tss-esapi-sys/src/bindings/aarch64-unknown-linux-gnu.rs +++ b/tss-esapi-sys/src/bindings/aarch64-unknown-linux-gnu.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.63.0 */ +/* automatically generated by rust-bindgen 0.66.1 */ pub const _STDINT_H: u32 = 1; pub const _FEATURES_H: u32 = 1; @@ -118,6 +118,30 @@ pub const TSS2_BASE_RC_BAD_TR: u32 = 24; pub const TSS2_BASE_RC_MULTIPLE_DECRYPT_SESSIONS: u32 = 25; pub const TSS2_BASE_RC_MULTIPLE_ENCRYPT_SESSIONS: u32 = 26; pub const TSS2_BASE_RC_RSP_AUTH_FAILED: u32 = 27; +pub const TSS2_BASE_RC_NO_CONFIG: u32 = 28; +pub const TSS2_BASE_RC_BAD_PATH: u32 = 29; +pub const TSS2_BASE_RC_NOT_DELETABLE: u32 = 30; +pub const TSS2_BASE_RC_PATH_ALREADY_EXISTS: u32 = 31; +pub const TSS2_BASE_RC_KEY_NOT_FOUND: u32 = 32; +pub const TSS2_BASE_RC_SIGNATURE_VERIFICATION_FAILED: u32 = 33; +pub const TSS2_BASE_RC_HASH_MISMATCH: u32 = 34; +pub const TSS2_BASE_RC_KEY_NOT_DUPLICABLE: u32 = 35; +pub const TSS2_BASE_RC_PATH_NOT_FOUND: u32 = 36; +pub const TSS2_BASE_RC_NO_CERT: u32 = 37; +pub const TSS2_BASE_RC_NO_PCR: u32 = 38; +pub const TSS2_BASE_RC_PCR_NOT_RESETTABLE: u32 = 39; +pub const TSS2_BASE_RC_BAD_TEMPLATE: u32 = 40; +pub const TSS2_BASE_RC_AUTHORIZATION_FAILED: u32 = 41; +pub const TSS2_BASE_RC_AUTHORIZATION_UNKNOWN: u32 = 42; +pub const TSS2_BASE_RC_NV_NOT_READABLE: u32 = 43; +pub const TSS2_BASE_RC_NV_TOO_SMALL: u32 = 44; +pub const TSS2_BASE_RC_NV_NOT_WRITEABLE: u32 = 45; +pub const TSS2_BASE_RC_POLICY_UNKNOWN: u32 = 46; +pub const TSS2_BASE_RC_NV_WRONG_TYPE: u32 = 47; +pub const TSS2_BASE_RC_NAME_ALREADY_EXISTS: u32 = 48; +pub const TSS2_BASE_RC_NO_TPM: u32 = 49; +pub const TSS2_BASE_RC_BAD_KEY: u32 = 50; +pub const TSS2_BASE_RC_NO_HANDLE: u32 = 51; pub const TSS2_LAYER_IMPLEMENTATION_SPECIFIC_OFFSET: u32 = 63488; pub const TSS2_LEVEL_IMPLEMENTATION_SPECIFIC_SHIFT: u32 = 11; pub const TPM2_MAX_COMMAND_SIZE: u32 = 4096; @@ -166,7 +190,7 @@ pub const POLLHUP: u32 = 16; pub const POLLNVAL: u32 = 32; pub const TSS2_TCTI_TIMEOUT_BLOCK: i32 = -1; pub const TSS2_TCTI_TIMEOUT_NONE: u32 = 0; -pub const TSS2_TCTI_INFO_SYMBOL: &[u8; 15usize] = b"Tss2_Tcti_Info\0"; +pub const TSS2_TCTI_INFO_SYMBOL: &[u8; 15] = b"Tss2_Tcti_Info\0"; pub const TSS2_SYS_MAX_SESSIONS: u32 = 3; pub const ESYS_TR_NONE: u32 = 4095; pub const ESYS_TR_PASSWORD: u32 = 255; @@ -212,128 +236,128 @@ pub const ESYS_TR_RH_AUTH_FIRST: u32 = 272; pub const ESYS_TR_MIN_OBJECT: u32 = 4096; pub const _INTTYPES_H: u32 = 1; pub const ____gwchar_t_defined: u32 = 1; -pub const __PRI64_PREFIX: &[u8; 3usize] = b"ll\0"; -pub const PRId8: &[u8; 2usize] = b"d\0"; -pub const PRId16: &[u8; 2usize] = b"d\0"; -pub const PRId32: &[u8; 2usize] = b"d\0"; -pub const PRId64: &[u8; 4usize] = b"lld\0"; -pub const PRIdLEAST8: &[u8; 2usize] = b"d\0"; -pub const PRIdLEAST16: &[u8; 2usize] = b"d\0"; -pub const PRIdLEAST32: &[u8; 2usize] = b"d\0"; -pub const PRIdLEAST64: &[u8; 4usize] = b"lld\0"; -pub const PRIdFAST8: &[u8; 2usize] = b"d\0"; -pub const PRIdFAST64: &[u8; 4usize] = b"lld\0"; -pub const PRIi8: &[u8; 2usize] = b"i\0"; -pub const PRIi16: &[u8; 2usize] = b"i\0"; -pub const PRIi32: &[u8; 2usize] = b"i\0"; -pub const PRIi64: &[u8; 4usize] = b"lli\0"; -pub const PRIiLEAST8: &[u8; 2usize] = b"i\0"; -pub const PRIiLEAST16: &[u8; 2usize] = b"i\0"; -pub const PRIiLEAST32: &[u8; 2usize] = b"i\0"; -pub const PRIiLEAST64: &[u8; 4usize] = b"lli\0"; -pub const PRIiFAST8: &[u8; 2usize] = b"i\0"; -pub const PRIiFAST64: &[u8; 4usize] = b"lli\0"; -pub const PRIo8: &[u8; 2usize] = b"o\0"; -pub const PRIo16: &[u8; 2usize] = b"o\0"; -pub const PRIo32: &[u8; 2usize] = b"o\0"; -pub const PRIo64: &[u8; 4usize] = b"llo\0"; -pub const PRIoLEAST8: &[u8; 2usize] = b"o\0"; -pub const PRIoLEAST16: &[u8; 2usize] = b"o\0"; -pub const PRIoLEAST32: &[u8; 2usize] = b"o\0"; -pub const PRIoLEAST64: &[u8; 4usize] = b"llo\0"; -pub const PRIoFAST8: &[u8; 2usize] = b"o\0"; -pub const PRIoFAST64: &[u8; 4usize] = b"llo\0"; -pub const PRIu8: &[u8; 2usize] = b"u\0"; -pub const PRIu16: &[u8; 2usize] = b"u\0"; -pub const PRIu32: &[u8; 2usize] = b"u\0"; -pub const PRIu64: &[u8; 4usize] = b"llu\0"; -pub const PRIuLEAST8: &[u8; 2usize] = b"u\0"; -pub const PRIuLEAST16: &[u8; 2usize] = b"u\0"; -pub const PRIuLEAST32: &[u8; 2usize] = b"u\0"; -pub const PRIuLEAST64: &[u8; 4usize] = b"llu\0"; -pub const PRIuFAST8: &[u8; 2usize] = b"u\0"; -pub const PRIuFAST64: &[u8; 4usize] = b"llu\0"; -pub const PRIx8: &[u8; 2usize] = b"x\0"; -pub const PRIx16: &[u8; 2usize] = b"x\0"; -pub const PRIx32: &[u8; 2usize] = b"x\0"; -pub const PRIx64: &[u8; 4usize] = b"llx\0"; -pub const PRIxLEAST8: &[u8; 2usize] = b"x\0"; -pub const PRIxLEAST16: &[u8; 2usize] = b"x\0"; -pub const PRIxLEAST32: &[u8; 2usize] = b"x\0"; -pub const PRIxLEAST64: &[u8; 4usize] = b"llx\0"; -pub const PRIxFAST8: &[u8; 2usize] = b"x\0"; -pub const PRIxFAST64: &[u8; 4usize] = b"llx\0"; -pub const PRIX8: &[u8; 2usize] = b"X\0"; -pub const PRIX16: &[u8; 2usize] = b"X\0"; -pub const PRIX32: &[u8; 2usize] = b"X\0"; -pub const PRIX64: &[u8; 4usize] = b"llX\0"; -pub const PRIXLEAST8: &[u8; 2usize] = b"X\0"; -pub const PRIXLEAST16: &[u8; 2usize] = b"X\0"; -pub const PRIXLEAST32: &[u8; 2usize] = b"X\0"; -pub const PRIXLEAST64: &[u8; 4usize] = b"llX\0"; -pub const PRIXFAST8: &[u8; 2usize] = b"X\0"; -pub const PRIXFAST64: &[u8; 4usize] = b"llX\0"; -pub const PRIdMAX: &[u8; 4usize] = b"lld\0"; -pub const PRIiMAX: &[u8; 4usize] = b"lli\0"; -pub const PRIoMAX: &[u8; 4usize] = b"llo\0"; -pub const PRIuMAX: &[u8; 4usize] = b"llu\0"; -pub const PRIxMAX: &[u8; 4usize] = b"llx\0"; -pub const PRIXMAX: &[u8; 4usize] = b"llX\0"; -pub const SCNd8: &[u8; 4usize] = b"hhd\0"; -pub const SCNd16: &[u8; 3usize] = b"hd\0"; -pub const SCNd32: &[u8; 2usize] = b"d\0"; -pub const SCNd64: &[u8; 4usize] = b"lld\0"; -pub const SCNdLEAST8: &[u8; 4usize] = b"hhd\0"; -pub const SCNdLEAST16: &[u8; 3usize] = b"hd\0"; -pub const SCNdLEAST32: &[u8; 2usize] = b"d\0"; -pub const SCNdLEAST64: &[u8; 4usize] = b"lld\0"; -pub const SCNdFAST8: &[u8; 4usize] = b"hhd\0"; -pub const SCNdFAST64: &[u8; 4usize] = b"lld\0"; -pub const SCNi8: &[u8; 4usize] = b"hhi\0"; -pub const SCNi16: &[u8; 3usize] = b"hi\0"; -pub const SCNi32: &[u8; 2usize] = b"i\0"; -pub const SCNi64: &[u8; 4usize] = b"lli\0"; -pub const SCNiLEAST8: &[u8; 4usize] = b"hhi\0"; -pub const SCNiLEAST16: &[u8; 3usize] = b"hi\0"; -pub const SCNiLEAST32: &[u8; 2usize] = b"i\0"; -pub const SCNiLEAST64: &[u8; 4usize] = b"lli\0"; -pub const SCNiFAST8: &[u8; 4usize] = b"hhi\0"; -pub const SCNiFAST64: &[u8; 4usize] = b"lli\0"; -pub const SCNu8: &[u8; 4usize] = b"hhu\0"; -pub const SCNu16: &[u8; 3usize] = b"hu\0"; -pub const SCNu32: &[u8; 2usize] = b"u\0"; -pub const SCNu64: &[u8; 4usize] = b"llu\0"; -pub const SCNuLEAST8: &[u8; 4usize] = b"hhu\0"; -pub const SCNuLEAST16: &[u8; 3usize] = b"hu\0"; -pub const SCNuLEAST32: &[u8; 2usize] = b"u\0"; -pub const SCNuLEAST64: &[u8; 4usize] = b"llu\0"; -pub const SCNuFAST8: &[u8; 4usize] = b"hhu\0"; -pub const SCNuFAST64: &[u8; 4usize] = b"llu\0"; -pub const SCNo8: &[u8; 4usize] = b"hho\0"; -pub const SCNo16: &[u8; 3usize] = b"ho\0"; -pub const SCNo32: &[u8; 2usize] = b"o\0"; -pub const SCNo64: &[u8; 4usize] = b"llo\0"; -pub const SCNoLEAST8: &[u8; 4usize] = b"hho\0"; -pub const SCNoLEAST16: &[u8; 3usize] = b"ho\0"; -pub const SCNoLEAST32: &[u8; 2usize] = b"o\0"; -pub const SCNoLEAST64: &[u8; 4usize] = b"llo\0"; -pub const SCNoFAST8: &[u8; 4usize] = b"hho\0"; -pub const SCNoFAST64: &[u8; 4usize] = b"llo\0"; -pub const SCNx8: &[u8; 4usize] = b"hhx\0"; -pub const SCNx16: &[u8; 3usize] = b"hx\0"; -pub const SCNx32: &[u8; 2usize] = b"x\0"; -pub const SCNx64: &[u8; 4usize] = b"llx\0"; -pub const SCNxLEAST8: &[u8; 4usize] = b"hhx\0"; -pub const SCNxLEAST16: &[u8; 3usize] = b"hx\0"; -pub const SCNxLEAST32: &[u8; 2usize] = b"x\0"; -pub const SCNxLEAST64: &[u8; 4usize] = b"llx\0"; -pub const SCNxFAST8: &[u8; 4usize] = b"hhx\0"; -pub const SCNxFAST64: &[u8; 4usize] = b"llx\0"; -pub const SCNdMAX: &[u8; 4usize] = b"lld\0"; -pub const SCNiMAX: &[u8; 4usize] = b"lli\0"; -pub const SCNoMAX: &[u8; 4usize] = b"llo\0"; -pub const SCNuMAX: &[u8; 4usize] = b"llu\0"; -pub const SCNxMAX: &[u8; 4usize] = b"llx\0"; +pub const __PRI64_PREFIX: &[u8; 3] = b"ll\0"; +pub const PRId8: &[u8; 2] = b"d\0"; +pub const PRId16: &[u8; 2] = b"d\0"; +pub const PRId32: &[u8; 2] = b"d\0"; +pub const PRId64: &[u8; 4] = b"lld\0"; +pub const PRIdLEAST8: &[u8; 2] = b"d\0"; +pub const PRIdLEAST16: &[u8; 2] = b"d\0"; +pub const PRIdLEAST32: &[u8; 2] = b"d\0"; +pub const PRIdLEAST64: &[u8; 4] = b"lld\0"; +pub const PRIdFAST8: &[u8; 2] = b"d\0"; +pub const PRIdFAST64: &[u8; 4] = b"lld\0"; +pub const PRIi8: &[u8; 2] = b"i\0"; +pub const PRIi16: &[u8; 2] = b"i\0"; +pub const PRIi32: &[u8; 2] = b"i\0"; +pub const PRIi64: &[u8; 4] = b"lli\0"; +pub const PRIiLEAST8: &[u8; 2] = b"i\0"; +pub const PRIiLEAST16: &[u8; 2] = b"i\0"; +pub const PRIiLEAST32: &[u8; 2] = b"i\0"; +pub const PRIiLEAST64: &[u8; 4] = b"lli\0"; +pub const PRIiFAST8: &[u8; 2] = b"i\0"; +pub const PRIiFAST64: &[u8; 4] = b"lli\0"; +pub const PRIo8: &[u8; 2] = b"o\0"; +pub const PRIo16: &[u8; 2] = b"o\0"; +pub const PRIo32: &[u8; 2] = b"o\0"; +pub const PRIo64: &[u8; 4] = b"llo\0"; +pub const PRIoLEAST8: &[u8; 2] = b"o\0"; +pub const PRIoLEAST16: &[u8; 2] = b"o\0"; +pub const PRIoLEAST32: &[u8; 2] = b"o\0"; +pub const PRIoLEAST64: &[u8; 4] = b"llo\0"; +pub const PRIoFAST8: &[u8; 2] = b"o\0"; +pub const PRIoFAST64: &[u8; 4] = b"llo\0"; +pub const PRIu8: &[u8; 2] = b"u\0"; +pub const PRIu16: &[u8; 2] = b"u\0"; +pub const PRIu32: &[u8; 2] = b"u\0"; +pub const PRIu64: &[u8; 4] = b"llu\0"; +pub const PRIuLEAST8: &[u8; 2] = b"u\0"; +pub const PRIuLEAST16: &[u8; 2] = b"u\0"; +pub const PRIuLEAST32: &[u8; 2] = b"u\0"; +pub const PRIuLEAST64: &[u8; 4] = b"llu\0"; +pub const PRIuFAST8: &[u8; 2] = b"u\0"; +pub const PRIuFAST64: &[u8; 4] = b"llu\0"; +pub const PRIx8: &[u8; 2] = b"x\0"; +pub const PRIx16: &[u8; 2] = b"x\0"; +pub const PRIx32: &[u8; 2] = b"x\0"; +pub const PRIx64: &[u8; 4] = b"llx\0"; +pub const PRIxLEAST8: &[u8; 2] = b"x\0"; +pub const PRIxLEAST16: &[u8; 2] = b"x\0"; +pub const PRIxLEAST32: &[u8; 2] = b"x\0"; +pub const PRIxLEAST64: &[u8; 4] = b"llx\0"; +pub const PRIxFAST8: &[u8; 2] = b"x\0"; +pub const PRIxFAST64: &[u8; 4] = b"llx\0"; +pub const PRIX8: &[u8; 2] = b"X\0"; +pub const PRIX16: &[u8; 2] = b"X\0"; +pub const PRIX32: &[u8; 2] = b"X\0"; +pub const PRIX64: &[u8; 4] = b"llX\0"; +pub const PRIXLEAST8: &[u8; 2] = b"X\0"; +pub const PRIXLEAST16: &[u8; 2] = b"X\0"; +pub const PRIXLEAST32: &[u8; 2] = b"X\0"; +pub const PRIXLEAST64: &[u8; 4] = b"llX\0"; +pub const PRIXFAST8: &[u8; 2] = b"X\0"; +pub const PRIXFAST64: &[u8; 4] = b"llX\0"; +pub const PRIdMAX: &[u8; 4] = b"lld\0"; +pub const PRIiMAX: &[u8; 4] = b"lli\0"; +pub const PRIoMAX: &[u8; 4] = b"llo\0"; +pub const PRIuMAX: &[u8; 4] = b"llu\0"; +pub const PRIxMAX: &[u8; 4] = b"llx\0"; +pub const PRIXMAX: &[u8; 4] = b"llX\0"; +pub const SCNd8: &[u8; 4] = b"hhd\0"; +pub const SCNd16: &[u8; 3] = b"hd\0"; +pub const SCNd32: &[u8; 2] = b"d\0"; +pub const SCNd64: &[u8; 4] = b"lld\0"; +pub const SCNdLEAST8: &[u8; 4] = b"hhd\0"; +pub const SCNdLEAST16: &[u8; 3] = b"hd\0"; +pub const SCNdLEAST32: &[u8; 2] = b"d\0"; +pub const SCNdLEAST64: &[u8; 4] = b"lld\0"; +pub const SCNdFAST8: &[u8; 4] = b"hhd\0"; +pub const SCNdFAST64: &[u8; 4] = b"lld\0"; +pub const SCNi8: &[u8; 4] = b"hhi\0"; +pub const SCNi16: &[u8; 3] = b"hi\0"; +pub const SCNi32: &[u8; 2] = b"i\0"; +pub const SCNi64: &[u8; 4] = b"lli\0"; +pub const SCNiLEAST8: &[u8; 4] = b"hhi\0"; +pub const SCNiLEAST16: &[u8; 3] = b"hi\0"; +pub const SCNiLEAST32: &[u8; 2] = b"i\0"; +pub const SCNiLEAST64: &[u8; 4] = b"lli\0"; +pub const SCNiFAST8: &[u8; 4] = b"hhi\0"; +pub const SCNiFAST64: &[u8; 4] = b"lli\0"; +pub const SCNu8: &[u8; 4] = b"hhu\0"; +pub const SCNu16: &[u8; 3] = b"hu\0"; +pub const SCNu32: &[u8; 2] = b"u\0"; +pub const SCNu64: &[u8; 4] = b"llu\0"; +pub const SCNuLEAST8: &[u8; 4] = b"hhu\0"; +pub const SCNuLEAST16: &[u8; 3] = b"hu\0"; +pub const SCNuLEAST32: &[u8; 2] = b"u\0"; +pub const SCNuLEAST64: &[u8; 4] = b"llu\0"; +pub const SCNuFAST8: &[u8; 4] = b"hhu\0"; +pub const SCNuFAST64: &[u8; 4] = b"llu\0"; +pub const SCNo8: &[u8; 4] = b"hho\0"; +pub const SCNo16: &[u8; 3] = b"ho\0"; +pub const SCNo32: &[u8; 2] = b"o\0"; +pub const SCNo64: &[u8; 4] = b"llo\0"; +pub const SCNoLEAST8: &[u8; 4] = b"hho\0"; +pub const SCNoLEAST16: &[u8; 3] = b"ho\0"; +pub const SCNoLEAST32: &[u8; 2] = b"o\0"; +pub const SCNoLEAST64: &[u8; 4] = b"llo\0"; +pub const SCNoFAST8: &[u8; 4] = b"hho\0"; +pub const SCNoFAST64: &[u8; 4] = b"llo\0"; +pub const SCNx8: &[u8; 4] = b"hhx\0"; +pub const SCNx16: &[u8; 3] = b"hx\0"; +pub const SCNx32: &[u8; 2] = b"x\0"; +pub const SCNx64: &[u8; 4] = b"llx\0"; +pub const SCNxLEAST8: &[u8; 4] = b"hhx\0"; +pub const SCNxLEAST16: &[u8; 3] = b"hx\0"; +pub const SCNxLEAST32: &[u8; 2] = b"x\0"; +pub const SCNxLEAST64: &[u8; 4] = b"llx\0"; +pub const SCNxFAST8: &[u8; 4] = b"hhx\0"; +pub const SCNxFAST64: &[u8; 4] = b"llx\0"; +pub const SCNdMAX: &[u8; 4] = b"lld\0"; +pub const SCNiMAX: &[u8; 4] = b"lli\0"; +pub const SCNoMAX: &[u8; 4] = b"llo\0"; +pub const SCNuMAX: &[u8; 4] = b"llu\0"; +pub const SCNxMAX: &[u8; 4] = b"llx\0"; pub const _STDLIB_H: u32 = 1; pub const WNOHANG: u32 = 1; pub const WUNTRACED: u32 = 2; @@ -389,7 +413,7 @@ pub const BYTE_ORDER: u32 = 1234; pub const _BITS_BYTESWAP_H: u32 = 1; pub const _BITS_UINTN_IDENTITY_H: u32 = 1; pub const _SYS_SELECT_H: u32 = 1; -pub const __FD_ZERO_STOS: &[u8; 6usize] = b"stosl\0"; +pub const __FD_ZERO_STOS: &[u8; 6] = b"stosl\0"; pub const __sigset_t_defined: u32 = 1; pub const __timeval_defined: u32 = 1; pub const _STRUCT_TIMESPEC: u32 = 1; @@ -3441,6 +3465,7 @@ impl Default for TPMS_AUTH_RESPONSE { pub type TPMI_AES_KEY_BITS = TPM2_KEY_BITS; pub type TPMI_SM4_KEY_BITS = TPM2_KEY_BITS; pub type TPMI_TPM2_CAMELLIA_KEY_BITS = TPM2_KEY_BITS; +pub type TPMI_CAMELLIA_KEY_BITS = TPM2_KEY_BITS; #[repr(C)] #[derive(Copy, Clone)] pub union TPMU_SYM_KEY_BITS { @@ -10740,6 +10765,20 @@ extern "C" { nonceTPM: *mut *mut TPM2B_NONCE, ) -> TSS2_RC; } +extern "C" { + pub fn Esys_TR_GetTpmHandle( + esys_context: *mut ESYS_CONTEXT, + esys_handle: ESYS_TR, + tpm_handle: *mut TPM2_HANDLE, + ) -> TSS2_RC; +} +extern "C" { + pub fn Esys_TRSess_GetAuthRequired( + esys_context: *mut ESYS_CONTEXT, + esys_handle: ESYS_TR, + auth_needed: *mut TPMI_YES_NO, + ) -> TSS2_RC; +} extern "C" { pub fn Esys_Startup(esysContext: *mut ESYS_CONTEXT, startupType: TPM2_SU) -> TSS2_RC; } @@ -13785,6 +13824,12 @@ extern "C" { extern "C" { pub fn Esys_Free(__ptr: *mut ::std::os::raw::c_void); } +extern "C" { + pub fn Esys_GetSysContext( + esys_context: *mut ESYS_CONTEXT, + sys_context: *mut *mut TSS2_SYS_CONTEXT, + ) -> TSS2_RC; +} pub type __gwchar_t = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tss-esapi-sys/src/bindings/arm-unknown-linux-gnueabi.rs b/tss-esapi-sys/src/bindings/arm-unknown-linux-gnueabi.rs index c9c1750a..3d5da749 100644 --- a/tss-esapi-sys/src/bindings/arm-unknown-linux-gnueabi.rs +++ b/tss-esapi-sys/src/bindings/arm-unknown-linux-gnueabi.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.63.0 */ +/* automatically generated by rust-bindgen 0.66.1 */ pub const _STDINT_H: u32 = 1; pub const _FEATURES_H: u32 = 1; @@ -118,6 +118,30 @@ pub const TSS2_BASE_RC_BAD_TR: u32 = 24; pub const TSS2_BASE_RC_MULTIPLE_DECRYPT_SESSIONS: u32 = 25; pub const TSS2_BASE_RC_MULTIPLE_ENCRYPT_SESSIONS: u32 = 26; pub const TSS2_BASE_RC_RSP_AUTH_FAILED: u32 = 27; +pub const TSS2_BASE_RC_NO_CONFIG: u32 = 28; +pub const TSS2_BASE_RC_BAD_PATH: u32 = 29; +pub const TSS2_BASE_RC_NOT_DELETABLE: u32 = 30; +pub const TSS2_BASE_RC_PATH_ALREADY_EXISTS: u32 = 31; +pub const TSS2_BASE_RC_KEY_NOT_FOUND: u32 = 32; +pub const TSS2_BASE_RC_SIGNATURE_VERIFICATION_FAILED: u32 = 33; +pub const TSS2_BASE_RC_HASH_MISMATCH: u32 = 34; +pub const TSS2_BASE_RC_KEY_NOT_DUPLICABLE: u32 = 35; +pub const TSS2_BASE_RC_PATH_NOT_FOUND: u32 = 36; +pub const TSS2_BASE_RC_NO_CERT: u32 = 37; +pub const TSS2_BASE_RC_NO_PCR: u32 = 38; +pub const TSS2_BASE_RC_PCR_NOT_RESETTABLE: u32 = 39; +pub const TSS2_BASE_RC_BAD_TEMPLATE: u32 = 40; +pub const TSS2_BASE_RC_AUTHORIZATION_FAILED: u32 = 41; +pub const TSS2_BASE_RC_AUTHORIZATION_UNKNOWN: u32 = 42; +pub const TSS2_BASE_RC_NV_NOT_READABLE: u32 = 43; +pub const TSS2_BASE_RC_NV_TOO_SMALL: u32 = 44; +pub const TSS2_BASE_RC_NV_NOT_WRITEABLE: u32 = 45; +pub const TSS2_BASE_RC_POLICY_UNKNOWN: u32 = 46; +pub const TSS2_BASE_RC_NV_WRONG_TYPE: u32 = 47; +pub const TSS2_BASE_RC_NAME_ALREADY_EXISTS: u32 = 48; +pub const TSS2_BASE_RC_NO_TPM: u32 = 49; +pub const TSS2_BASE_RC_BAD_KEY: u32 = 50; +pub const TSS2_BASE_RC_NO_HANDLE: u32 = 51; pub const TSS2_LAYER_IMPLEMENTATION_SPECIFIC_OFFSET: u32 = 63488; pub const TSS2_LEVEL_IMPLEMENTATION_SPECIFIC_SHIFT: u32 = 11; pub const TPM2_MAX_COMMAND_SIZE: u32 = 4096; @@ -166,7 +190,7 @@ pub const POLLHUP: u32 = 16; pub const POLLNVAL: u32 = 32; pub const TSS2_TCTI_TIMEOUT_BLOCK: i32 = -1; pub const TSS2_TCTI_TIMEOUT_NONE: u32 = 0; -pub const TSS2_TCTI_INFO_SYMBOL: &[u8; 15usize] = b"Tss2_Tcti_Info\0"; +pub const TSS2_TCTI_INFO_SYMBOL: &[u8; 15] = b"Tss2_Tcti_Info\0"; pub const TSS2_SYS_MAX_SESSIONS: u32 = 3; pub const ESYS_TR_NONE: u32 = 4095; pub const ESYS_TR_PASSWORD: u32 = 255; @@ -212,128 +236,128 @@ pub const ESYS_TR_RH_AUTH_FIRST: u32 = 272; pub const ESYS_TR_MIN_OBJECT: u32 = 4096; pub const _INTTYPES_H: u32 = 1; pub const ____gwchar_t_defined: u32 = 1; -pub const __PRI64_PREFIX: &[u8; 3usize] = b"ll\0"; -pub const PRId8: &[u8; 2usize] = b"d\0"; -pub const PRId16: &[u8; 2usize] = b"d\0"; -pub const PRId32: &[u8; 2usize] = b"d\0"; -pub const PRId64: &[u8; 4usize] = b"lld\0"; -pub const PRIdLEAST8: &[u8; 2usize] = b"d\0"; -pub const PRIdLEAST16: &[u8; 2usize] = b"d\0"; -pub const PRIdLEAST32: &[u8; 2usize] = b"d\0"; -pub const PRIdLEAST64: &[u8; 4usize] = b"lld\0"; -pub const PRIdFAST8: &[u8; 2usize] = b"d\0"; -pub const PRIdFAST64: &[u8; 4usize] = b"lld\0"; -pub const PRIi8: &[u8; 2usize] = b"i\0"; -pub const PRIi16: &[u8; 2usize] = b"i\0"; -pub const PRIi32: &[u8; 2usize] = b"i\0"; -pub const PRIi64: &[u8; 4usize] = b"lli\0"; -pub const PRIiLEAST8: &[u8; 2usize] = b"i\0"; -pub const PRIiLEAST16: &[u8; 2usize] = b"i\0"; -pub const PRIiLEAST32: &[u8; 2usize] = b"i\0"; -pub const PRIiLEAST64: &[u8; 4usize] = b"lli\0"; -pub const PRIiFAST8: &[u8; 2usize] = b"i\0"; -pub const PRIiFAST64: &[u8; 4usize] = b"lli\0"; -pub const PRIo8: &[u8; 2usize] = b"o\0"; -pub const PRIo16: &[u8; 2usize] = b"o\0"; -pub const PRIo32: &[u8; 2usize] = b"o\0"; -pub const PRIo64: &[u8; 4usize] = b"llo\0"; -pub const PRIoLEAST8: &[u8; 2usize] = b"o\0"; -pub const PRIoLEAST16: &[u8; 2usize] = b"o\0"; -pub const PRIoLEAST32: &[u8; 2usize] = b"o\0"; -pub const PRIoLEAST64: &[u8; 4usize] = b"llo\0"; -pub const PRIoFAST8: &[u8; 2usize] = b"o\0"; -pub const PRIoFAST64: &[u8; 4usize] = b"llo\0"; -pub const PRIu8: &[u8; 2usize] = b"u\0"; -pub const PRIu16: &[u8; 2usize] = b"u\0"; -pub const PRIu32: &[u8; 2usize] = b"u\0"; -pub const PRIu64: &[u8; 4usize] = b"llu\0"; -pub const PRIuLEAST8: &[u8; 2usize] = b"u\0"; -pub const PRIuLEAST16: &[u8; 2usize] = b"u\0"; -pub const PRIuLEAST32: &[u8; 2usize] = b"u\0"; -pub const PRIuLEAST64: &[u8; 4usize] = b"llu\0"; -pub const PRIuFAST8: &[u8; 2usize] = b"u\0"; -pub const PRIuFAST64: &[u8; 4usize] = b"llu\0"; -pub const PRIx8: &[u8; 2usize] = b"x\0"; -pub const PRIx16: &[u8; 2usize] = b"x\0"; -pub const PRIx32: &[u8; 2usize] = b"x\0"; -pub const PRIx64: &[u8; 4usize] = b"llx\0"; -pub const PRIxLEAST8: &[u8; 2usize] = b"x\0"; -pub const PRIxLEAST16: &[u8; 2usize] = b"x\0"; -pub const PRIxLEAST32: &[u8; 2usize] = b"x\0"; -pub const PRIxLEAST64: &[u8; 4usize] = b"llx\0"; -pub const PRIxFAST8: &[u8; 2usize] = b"x\0"; -pub const PRIxFAST64: &[u8; 4usize] = b"llx\0"; -pub const PRIX8: &[u8; 2usize] = b"X\0"; -pub const PRIX16: &[u8; 2usize] = b"X\0"; -pub const PRIX32: &[u8; 2usize] = b"X\0"; -pub const PRIX64: &[u8; 4usize] = b"llX\0"; -pub const PRIXLEAST8: &[u8; 2usize] = b"X\0"; -pub const PRIXLEAST16: &[u8; 2usize] = b"X\0"; -pub const PRIXLEAST32: &[u8; 2usize] = b"X\0"; -pub const PRIXLEAST64: &[u8; 4usize] = b"llX\0"; -pub const PRIXFAST8: &[u8; 2usize] = b"X\0"; -pub const PRIXFAST64: &[u8; 4usize] = b"llX\0"; -pub const PRIdMAX: &[u8; 4usize] = b"lld\0"; -pub const PRIiMAX: &[u8; 4usize] = b"lli\0"; -pub const PRIoMAX: &[u8; 4usize] = b"llo\0"; -pub const PRIuMAX: &[u8; 4usize] = b"llu\0"; -pub const PRIxMAX: &[u8; 4usize] = b"llx\0"; -pub const PRIXMAX: &[u8; 4usize] = b"llX\0"; -pub const SCNd8: &[u8; 4usize] = b"hhd\0"; -pub const SCNd16: &[u8; 3usize] = b"hd\0"; -pub const SCNd32: &[u8; 2usize] = b"d\0"; -pub const SCNd64: &[u8; 4usize] = b"lld\0"; -pub const SCNdLEAST8: &[u8; 4usize] = b"hhd\0"; -pub const SCNdLEAST16: &[u8; 3usize] = b"hd\0"; -pub const SCNdLEAST32: &[u8; 2usize] = b"d\0"; -pub const SCNdLEAST64: &[u8; 4usize] = b"lld\0"; -pub const SCNdFAST8: &[u8; 4usize] = b"hhd\0"; -pub const SCNdFAST64: &[u8; 4usize] = b"lld\0"; -pub const SCNi8: &[u8; 4usize] = b"hhi\0"; -pub const SCNi16: &[u8; 3usize] = b"hi\0"; -pub const SCNi32: &[u8; 2usize] = b"i\0"; -pub const SCNi64: &[u8; 4usize] = b"lli\0"; -pub const SCNiLEAST8: &[u8; 4usize] = b"hhi\0"; -pub const SCNiLEAST16: &[u8; 3usize] = b"hi\0"; -pub const SCNiLEAST32: &[u8; 2usize] = b"i\0"; -pub const SCNiLEAST64: &[u8; 4usize] = b"lli\0"; -pub const SCNiFAST8: &[u8; 4usize] = b"hhi\0"; -pub const SCNiFAST64: &[u8; 4usize] = b"lli\0"; -pub const SCNu8: &[u8; 4usize] = b"hhu\0"; -pub const SCNu16: &[u8; 3usize] = b"hu\0"; -pub const SCNu32: &[u8; 2usize] = b"u\0"; -pub const SCNu64: &[u8; 4usize] = b"llu\0"; -pub const SCNuLEAST8: &[u8; 4usize] = b"hhu\0"; -pub const SCNuLEAST16: &[u8; 3usize] = b"hu\0"; -pub const SCNuLEAST32: &[u8; 2usize] = b"u\0"; -pub const SCNuLEAST64: &[u8; 4usize] = b"llu\0"; -pub const SCNuFAST8: &[u8; 4usize] = b"hhu\0"; -pub const SCNuFAST64: &[u8; 4usize] = b"llu\0"; -pub const SCNo8: &[u8; 4usize] = b"hho\0"; -pub const SCNo16: &[u8; 3usize] = b"ho\0"; -pub const SCNo32: &[u8; 2usize] = b"o\0"; -pub const SCNo64: &[u8; 4usize] = b"llo\0"; -pub const SCNoLEAST8: &[u8; 4usize] = b"hho\0"; -pub const SCNoLEAST16: &[u8; 3usize] = b"ho\0"; -pub const SCNoLEAST32: &[u8; 2usize] = b"o\0"; -pub const SCNoLEAST64: &[u8; 4usize] = b"llo\0"; -pub const SCNoFAST8: &[u8; 4usize] = b"hho\0"; -pub const SCNoFAST64: &[u8; 4usize] = b"llo\0"; -pub const SCNx8: &[u8; 4usize] = b"hhx\0"; -pub const SCNx16: &[u8; 3usize] = b"hx\0"; -pub const SCNx32: &[u8; 2usize] = b"x\0"; -pub const SCNx64: &[u8; 4usize] = b"llx\0"; -pub const SCNxLEAST8: &[u8; 4usize] = b"hhx\0"; -pub const SCNxLEAST16: &[u8; 3usize] = b"hx\0"; -pub const SCNxLEAST32: &[u8; 2usize] = b"x\0"; -pub const SCNxLEAST64: &[u8; 4usize] = b"llx\0"; -pub const SCNxFAST8: &[u8; 4usize] = b"hhx\0"; -pub const SCNxFAST64: &[u8; 4usize] = b"llx\0"; -pub const SCNdMAX: &[u8; 4usize] = b"lld\0"; -pub const SCNiMAX: &[u8; 4usize] = b"lli\0"; -pub const SCNoMAX: &[u8; 4usize] = b"llo\0"; -pub const SCNuMAX: &[u8; 4usize] = b"llu\0"; -pub const SCNxMAX: &[u8; 4usize] = b"llx\0"; +pub const __PRI64_PREFIX: &[u8; 3] = b"ll\0"; +pub const PRId8: &[u8; 2] = b"d\0"; +pub const PRId16: &[u8; 2] = b"d\0"; +pub const PRId32: &[u8; 2] = b"d\0"; +pub const PRId64: &[u8; 4] = b"lld\0"; +pub const PRIdLEAST8: &[u8; 2] = b"d\0"; +pub const PRIdLEAST16: &[u8; 2] = b"d\0"; +pub const PRIdLEAST32: &[u8; 2] = b"d\0"; +pub const PRIdLEAST64: &[u8; 4] = b"lld\0"; +pub const PRIdFAST8: &[u8; 2] = b"d\0"; +pub const PRIdFAST64: &[u8; 4] = b"lld\0"; +pub const PRIi8: &[u8; 2] = b"i\0"; +pub const PRIi16: &[u8; 2] = b"i\0"; +pub const PRIi32: &[u8; 2] = b"i\0"; +pub const PRIi64: &[u8; 4] = b"lli\0"; +pub const PRIiLEAST8: &[u8; 2] = b"i\0"; +pub const PRIiLEAST16: &[u8; 2] = b"i\0"; +pub const PRIiLEAST32: &[u8; 2] = b"i\0"; +pub const PRIiLEAST64: &[u8; 4] = b"lli\0"; +pub const PRIiFAST8: &[u8; 2] = b"i\0"; +pub const PRIiFAST64: &[u8; 4] = b"lli\0"; +pub const PRIo8: &[u8; 2] = b"o\0"; +pub const PRIo16: &[u8; 2] = b"o\0"; +pub const PRIo32: &[u8; 2] = b"o\0"; +pub const PRIo64: &[u8; 4] = b"llo\0"; +pub const PRIoLEAST8: &[u8; 2] = b"o\0"; +pub const PRIoLEAST16: &[u8; 2] = b"o\0"; +pub const PRIoLEAST32: &[u8; 2] = b"o\0"; +pub const PRIoLEAST64: &[u8; 4] = b"llo\0"; +pub const PRIoFAST8: &[u8; 2] = b"o\0"; +pub const PRIoFAST64: &[u8; 4] = b"llo\0"; +pub const PRIu8: &[u8; 2] = b"u\0"; +pub const PRIu16: &[u8; 2] = b"u\0"; +pub const PRIu32: &[u8; 2] = b"u\0"; +pub const PRIu64: &[u8; 4] = b"llu\0"; +pub const PRIuLEAST8: &[u8; 2] = b"u\0"; +pub const PRIuLEAST16: &[u8; 2] = b"u\0"; +pub const PRIuLEAST32: &[u8; 2] = b"u\0"; +pub const PRIuLEAST64: &[u8; 4] = b"llu\0"; +pub const PRIuFAST8: &[u8; 2] = b"u\0"; +pub const PRIuFAST64: &[u8; 4] = b"llu\0"; +pub const PRIx8: &[u8; 2] = b"x\0"; +pub const PRIx16: &[u8; 2] = b"x\0"; +pub const PRIx32: &[u8; 2] = b"x\0"; +pub const PRIx64: &[u8; 4] = b"llx\0"; +pub const PRIxLEAST8: &[u8; 2] = b"x\0"; +pub const PRIxLEAST16: &[u8; 2] = b"x\0"; +pub const PRIxLEAST32: &[u8; 2] = b"x\0"; +pub const PRIxLEAST64: &[u8; 4] = b"llx\0"; +pub const PRIxFAST8: &[u8; 2] = b"x\0"; +pub const PRIxFAST64: &[u8; 4] = b"llx\0"; +pub const PRIX8: &[u8; 2] = b"X\0"; +pub const PRIX16: &[u8; 2] = b"X\0"; +pub const PRIX32: &[u8; 2] = b"X\0"; +pub const PRIX64: &[u8; 4] = b"llX\0"; +pub const PRIXLEAST8: &[u8; 2] = b"X\0"; +pub const PRIXLEAST16: &[u8; 2] = b"X\0"; +pub const PRIXLEAST32: &[u8; 2] = b"X\0"; +pub const PRIXLEAST64: &[u8; 4] = b"llX\0"; +pub const PRIXFAST8: &[u8; 2] = b"X\0"; +pub const PRIXFAST64: &[u8; 4] = b"llX\0"; +pub const PRIdMAX: &[u8; 4] = b"lld\0"; +pub const PRIiMAX: &[u8; 4] = b"lli\0"; +pub const PRIoMAX: &[u8; 4] = b"llo\0"; +pub const PRIuMAX: &[u8; 4] = b"llu\0"; +pub const PRIxMAX: &[u8; 4] = b"llx\0"; +pub const PRIXMAX: &[u8; 4] = b"llX\0"; +pub const SCNd8: &[u8; 4] = b"hhd\0"; +pub const SCNd16: &[u8; 3] = b"hd\0"; +pub const SCNd32: &[u8; 2] = b"d\0"; +pub const SCNd64: &[u8; 4] = b"lld\0"; +pub const SCNdLEAST8: &[u8; 4] = b"hhd\0"; +pub const SCNdLEAST16: &[u8; 3] = b"hd\0"; +pub const SCNdLEAST32: &[u8; 2] = b"d\0"; +pub const SCNdLEAST64: &[u8; 4] = b"lld\0"; +pub const SCNdFAST8: &[u8; 4] = b"hhd\0"; +pub const SCNdFAST64: &[u8; 4] = b"lld\0"; +pub const SCNi8: &[u8; 4] = b"hhi\0"; +pub const SCNi16: &[u8; 3] = b"hi\0"; +pub const SCNi32: &[u8; 2] = b"i\0"; +pub const SCNi64: &[u8; 4] = b"lli\0"; +pub const SCNiLEAST8: &[u8; 4] = b"hhi\0"; +pub const SCNiLEAST16: &[u8; 3] = b"hi\0"; +pub const SCNiLEAST32: &[u8; 2] = b"i\0"; +pub const SCNiLEAST64: &[u8; 4] = b"lli\0"; +pub const SCNiFAST8: &[u8; 4] = b"hhi\0"; +pub const SCNiFAST64: &[u8; 4] = b"lli\0"; +pub const SCNu8: &[u8; 4] = b"hhu\0"; +pub const SCNu16: &[u8; 3] = b"hu\0"; +pub const SCNu32: &[u8; 2] = b"u\0"; +pub const SCNu64: &[u8; 4] = b"llu\0"; +pub const SCNuLEAST8: &[u8; 4] = b"hhu\0"; +pub const SCNuLEAST16: &[u8; 3] = b"hu\0"; +pub const SCNuLEAST32: &[u8; 2] = b"u\0"; +pub const SCNuLEAST64: &[u8; 4] = b"llu\0"; +pub const SCNuFAST8: &[u8; 4] = b"hhu\0"; +pub const SCNuFAST64: &[u8; 4] = b"llu\0"; +pub const SCNo8: &[u8; 4] = b"hho\0"; +pub const SCNo16: &[u8; 3] = b"ho\0"; +pub const SCNo32: &[u8; 2] = b"o\0"; +pub const SCNo64: &[u8; 4] = b"llo\0"; +pub const SCNoLEAST8: &[u8; 4] = b"hho\0"; +pub const SCNoLEAST16: &[u8; 3] = b"ho\0"; +pub const SCNoLEAST32: &[u8; 2] = b"o\0"; +pub const SCNoLEAST64: &[u8; 4] = b"llo\0"; +pub const SCNoFAST8: &[u8; 4] = b"hho\0"; +pub const SCNoFAST64: &[u8; 4] = b"llo\0"; +pub const SCNx8: &[u8; 4] = b"hhx\0"; +pub const SCNx16: &[u8; 3] = b"hx\0"; +pub const SCNx32: &[u8; 2] = b"x\0"; +pub const SCNx64: &[u8; 4] = b"llx\0"; +pub const SCNxLEAST8: &[u8; 4] = b"hhx\0"; +pub const SCNxLEAST16: &[u8; 3] = b"hx\0"; +pub const SCNxLEAST32: &[u8; 2] = b"x\0"; +pub const SCNxLEAST64: &[u8; 4] = b"llx\0"; +pub const SCNxFAST8: &[u8; 4] = b"hhx\0"; +pub const SCNxFAST64: &[u8; 4] = b"llx\0"; +pub const SCNdMAX: &[u8; 4] = b"lld\0"; +pub const SCNiMAX: &[u8; 4] = b"lli\0"; +pub const SCNoMAX: &[u8; 4] = b"llo\0"; +pub const SCNuMAX: &[u8; 4] = b"llu\0"; +pub const SCNxMAX: &[u8; 4] = b"llx\0"; pub const _STDLIB_H: u32 = 1; pub const WNOHANG: u32 = 1; pub const WUNTRACED: u32 = 2; @@ -389,7 +413,7 @@ pub const BYTE_ORDER: u32 = 1234; pub const _BITS_BYTESWAP_H: u32 = 1; pub const _BITS_UINTN_IDENTITY_H: u32 = 1; pub const _SYS_SELECT_H: u32 = 1; -pub const __FD_ZERO_STOS: &[u8; 6usize] = b"stosl\0"; +pub const __FD_ZERO_STOS: &[u8; 6] = b"stosl\0"; pub const __sigset_t_defined: u32 = 1; pub const __timeval_defined: u32 = 1; pub const _STRUCT_TIMESPEC: u32 = 1; @@ -3441,6 +3465,7 @@ impl Default for TPMS_AUTH_RESPONSE { pub type TPMI_AES_KEY_BITS = TPM2_KEY_BITS; pub type TPMI_SM4_KEY_BITS = TPM2_KEY_BITS; pub type TPMI_TPM2_CAMELLIA_KEY_BITS = TPM2_KEY_BITS; +pub type TPMI_CAMELLIA_KEY_BITS = TPM2_KEY_BITS; #[repr(C)] #[derive(Copy, Clone)] pub union TPMU_SYM_KEY_BITS { @@ -10740,6 +10765,20 @@ extern "C" { nonceTPM: *mut *mut TPM2B_NONCE, ) -> TSS2_RC; } +extern "C" { + pub fn Esys_TR_GetTpmHandle( + esys_context: *mut ESYS_CONTEXT, + esys_handle: ESYS_TR, + tpm_handle: *mut TPM2_HANDLE, + ) -> TSS2_RC; +} +extern "C" { + pub fn Esys_TRSess_GetAuthRequired( + esys_context: *mut ESYS_CONTEXT, + esys_handle: ESYS_TR, + auth_needed: *mut TPMI_YES_NO, + ) -> TSS2_RC; +} extern "C" { pub fn Esys_Startup(esysContext: *mut ESYS_CONTEXT, startupType: TPM2_SU) -> TSS2_RC; } @@ -13785,6 +13824,12 @@ extern "C" { extern "C" { pub fn Esys_Free(__ptr: *mut ::std::os::raw::c_void); } +extern "C" { + pub fn Esys_GetSysContext( + esys_context: *mut ESYS_CONTEXT, + sys_context: *mut *mut TSS2_SYS_CONTEXT, + ) -> TSS2_RC; +} pub type __gwchar_t = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tss-esapi-sys/src/bindings/x86_64-unknown-linux-gnu.rs b/tss-esapi-sys/src/bindings/x86_64-unknown-linux-gnu.rs index 72466089..14c28b94 100644 --- a/tss-esapi-sys/src/bindings/x86_64-unknown-linux-gnu.rs +++ b/tss-esapi-sys/src/bindings/x86_64-unknown-linux-gnu.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.63.0 */ +/* automatically generated by rust-bindgen 0.66.1 */ pub const _STDINT_H: u32 = 1; pub const _FEATURES_H: u32 = 1; @@ -191,7 +191,7 @@ pub const POLLHUP: u32 = 16; pub const POLLNVAL: u32 = 32; pub const TSS2_TCTI_TIMEOUT_BLOCK: i32 = -1; pub const TSS2_TCTI_TIMEOUT_NONE: u32 = 0; -pub const TSS2_TCTI_INFO_SYMBOL: &[u8; 15usize] = b"Tss2_Tcti_Info\0"; +pub const TSS2_TCTI_INFO_SYMBOL: &[u8; 15] = b"Tss2_Tcti_Info\0"; pub const TSS2_SYS_MAX_SESSIONS: u32 = 3; pub const ESYS_TR_NONE: u32 = 4095; pub const ESYS_TR_PASSWORD: u32 = 255; @@ -237,162 +237,162 @@ pub const ESYS_TR_RH_AUTH_FIRST: u32 = 272; pub const ESYS_TR_MIN_OBJECT: u32 = 4096; pub const _INTTYPES_H: u32 = 1; pub const ____gwchar_t_defined: u32 = 1; -pub const __PRI64_PREFIX: &[u8; 2usize] = b"l\0"; -pub const __PRIPTR_PREFIX: &[u8; 2usize] = b"l\0"; -pub const PRId8: &[u8; 2usize] = b"d\0"; -pub const PRId16: &[u8; 2usize] = b"d\0"; -pub const PRId32: &[u8; 2usize] = b"d\0"; -pub const PRId64: &[u8; 3usize] = b"ld\0"; -pub const PRIdLEAST8: &[u8; 2usize] = b"d\0"; -pub const PRIdLEAST16: &[u8; 2usize] = b"d\0"; -pub const PRIdLEAST32: &[u8; 2usize] = b"d\0"; -pub const PRIdLEAST64: &[u8; 3usize] = b"ld\0"; -pub const PRIdFAST8: &[u8; 2usize] = b"d\0"; -pub const PRIdFAST16: &[u8; 3usize] = b"ld\0"; -pub const PRIdFAST32: &[u8; 3usize] = b"ld\0"; -pub const PRIdFAST64: &[u8; 3usize] = b"ld\0"; -pub const PRIi8: &[u8; 2usize] = b"i\0"; -pub const PRIi16: &[u8; 2usize] = b"i\0"; -pub const PRIi32: &[u8; 2usize] = b"i\0"; -pub const PRIi64: &[u8; 3usize] = b"li\0"; -pub const PRIiLEAST8: &[u8; 2usize] = b"i\0"; -pub const PRIiLEAST16: &[u8; 2usize] = b"i\0"; -pub const PRIiLEAST32: &[u8; 2usize] = b"i\0"; -pub const PRIiLEAST64: &[u8; 3usize] = b"li\0"; -pub const PRIiFAST8: &[u8; 2usize] = b"i\0"; -pub const PRIiFAST16: &[u8; 3usize] = b"li\0"; -pub const PRIiFAST32: &[u8; 3usize] = b"li\0"; -pub const PRIiFAST64: &[u8; 3usize] = b"li\0"; -pub const PRIo8: &[u8; 2usize] = b"o\0"; -pub const PRIo16: &[u8; 2usize] = b"o\0"; -pub const PRIo32: &[u8; 2usize] = b"o\0"; -pub const PRIo64: &[u8; 3usize] = b"lo\0"; -pub const PRIoLEAST8: &[u8; 2usize] = b"o\0"; -pub const PRIoLEAST16: &[u8; 2usize] = b"o\0"; -pub const PRIoLEAST32: &[u8; 2usize] = b"o\0"; -pub const PRIoLEAST64: &[u8; 3usize] = b"lo\0"; -pub const PRIoFAST8: &[u8; 2usize] = b"o\0"; -pub const PRIoFAST16: &[u8; 3usize] = b"lo\0"; -pub const PRIoFAST32: &[u8; 3usize] = b"lo\0"; -pub const PRIoFAST64: &[u8; 3usize] = b"lo\0"; -pub const PRIu8: &[u8; 2usize] = b"u\0"; -pub const PRIu16: &[u8; 2usize] = b"u\0"; -pub const PRIu32: &[u8; 2usize] = b"u\0"; -pub const PRIu64: &[u8; 3usize] = b"lu\0"; -pub const PRIuLEAST8: &[u8; 2usize] = b"u\0"; -pub const PRIuLEAST16: &[u8; 2usize] = b"u\0"; -pub const PRIuLEAST32: &[u8; 2usize] = b"u\0"; -pub const PRIuLEAST64: &[u8; 3usize] = b"lu\0"; -pub const PRIuFAST8: &[u8; 2usize] = b"u\0"; -pub const PRIuFAST16: &[u8; 3usize] = b"lu\0"; -pub const PRIuFAST32: &[u8; 3usize] = b"lu\0"; -pub const PRIuFAST64: &[u8; 3usize] = b"lu\0"; -pub const PRIx8: &[u8; 2usize] = b"x\0"; -pub const PRIx16: &[u8; 2usize] = b"x\0"; -pub const PRIx32: &[u8; 2usize] = b"x\0"; -pub const PRIx64: &[u8; 3usize] = b"lx\0"; -pub const PRIxLEAST8: &[u8; 2usize] = b"x\0"; -pub const PRIxLEAST16: &[u8; 2usize] = b"x\0"; -pub const PRIxLEAST32: &[u8; 2usize] = b"x\0"; -pub const PRIxLEAST64: &[u8; 3usize] = b"lx\0"; -pub const PRIxFAST8: &[u8; 2usize] = b"x\0"; -pub const PRIxFAST16: &[u8; 3usize] = b"lx\0"; -pub const PRIxFAST32: &[u8; 3usize] = b"lx\0"; -pub const PRIxFAST64: &[u8; 3usize] = b"lx\0"; -pub const PRIX8: &[u8; 2usize] = b"X\0"; -pub const PRIX16: &[u8; 2usize] = b"X\0"; -pub const PRIX32: &[u8; 2usize] = b"X\0"; -pub const PRIX64: &[u8; 3usize] = b"lX\0"; -pub const PRIXLEAST8: &[u8; 2usize] = b"X\0"; -pub const PRIXLEAST16: &[u8; 2usize] = b"X\0"; -pub const PRIXLEAST32: &[u8; 2usize] = b"X\0"; -pub const PRIXLEAST64: &[u8; 3usize] = b"lX\0"; -pub const PRIXFAST8: &[u8; 2usize] = b"X\0"; -pub const PRIXFAST16: &[u8; 3usize] = b"lX\0"; -pub const PRIXFAST32: &[u8; 3usize] = b"lX\0"; -pub const PRIXFAST64: &[u8; 3usize] = b"lX\0"; -pub const PRIdMAX: &[u8; 3usize] = b"ld\0"; -pub const PRIiMAX: &[u8; 3usize] = b"li\0"; -pub const PRIoMAX: &[u8; 3usize] = b"lo\0"; -pub const PRIuMAX: &[u8; 3usize] = b"lu\0"; -pub const PRIxMAX: &[u8; 3usize] = b"lx\0"; -pub const PRIXMAX: &[u8; 3usize] = b"lX\0"; -pub const PRIdPTR: &[u8; 3usize] = b"ld\0"; -pub const PRIiPTR: &[u8; 3usize] = b"li\0"; -pub const PRIoPTR: &[u8; 3usize] = b"lo\0"; -pub const PRIuPTR: &[u8; 3usize] = b"lu\0"; -pub const PRIxPTR: &[u8; 3usize] = b"lx\0"; -pub const PRIXPTR: &[u8; 3usize] = b"lX\0"; -pub const SCNd8: &[u8; 4usize] = b"hhd\0"; -pub const SCNd16: &[u8; 3usize] = b"hd\0"; -pub const SCNd32: &[u8; 2usize] = b"d\0"; -pub const SCNd64: &[u8; 3usize] = b"ld\0"; -pub const SCNdLEAST8: &[u8; 4usize] = b"hhd\0"; -pub const SCNdLEAST16: &[u8; 3usize] = b"hd\0"; -pub const SCNdLEAST32: &[u8; 2usize] = b"d\0"; -pub const SCNdLEAST64: &[u8; 3usize] = b"ld\0"; -pub const SCNdFAST8: &[u8; 4usize] = b"hhd\0"; -pub const SCNdFAST16: &[u8; 3usize] = b"ld\0"; -pub const SCNdFAST32: &[u8; 3usize] = b"ld\0"; -pub const SCNdFAST64: &[u8; 3usize] = b"ld\0"; -pub const SCNi8: &[u8; 4usize] = b"hhi\0"; -pub const SCNi16: &[u8; 3usize] = b"hi\0"; -pub const SCNi32: &[u8; 2usize] = b"i\0"; -pub const SCNi64: &[u8; 3usize] = b"li\0"; -pub const SCNiLEAST8: &[u8; 4usize] = b"hhi\0"; -pub const SCNiLEAST16: &[u8; 3usize] = b"hi\0"; -pub const SCNiLEAST32: &[u8; 2usize] = b"i\0"; -pub const SCNiLEAST64: &[u8; 3usize] = b"li\0"; -pub const SCNiFAST8: &[u8; 4usize] = b"hhi\0"; -pub const SCNiFAST16: &[u8; 3usize] = b"li\0"; -pub const SCNiFAST32: &[u8; 3usize] = b"li\0"; -pub const SCNiFAST64: &[u8; 3usize] = b"li\0"; -pub const SCNu8: &[u8; 4usize] = b"hhu\0"; -pub const SCNu16: &[u8; 3usize] = b"hu\0"; -pub const SCNu32: &[u8; 2usize] = b"u\0"; -pub const SCNu64: &[u8; 3usize] = b"lu\0"; -pub const SCNuLEAST8: &[u8; 4usize] = b"hhu\0"; -pub const SCNuLEAST16: &[u8; 3usize] = b"hu\0"; -pub const SCNuLEAST32: &[u8; 2usize] = b"u\0"; -pub const SCNuLEAST64: &[u8; 3usize] = b"lu\0"; -pub const SCNuFAST8: &[u8; 4usize] = b"hhu\0"; -pub const SCNuFAST16: &[u8; 3usize] = b"lu\0"; -pub const SCNuFAST32: &[u8; 3usize] = b"lu\0"; -pub const SCNuFAST64: &[u8; 3usize] = b"lu\0"; -pub const SCNo8: &[u8; 4usize] = b"hho\0"; -pub const SCNo16: &[u8; 3usize] = b"ho\0"; -pub const SCNo32: &[u8; 2usize] = b"o\0"; -pub const SCNo64: &[u8; 3usize] = b"lo\0"; -pub const SCNoLEAST8: &[u8; 4usize] = b"hho\0"; -pub const SCNoLEAST16: &[u8; 3usize] = b"ho\0"; -pub const SCNoLEAST32: &[u8; 2usize] = b"o\0"; -pub const SCNoLEAST64: &[u8; 3usize] = b"lo\0"; -pub const SCNoFAST8: &[u8; 4usize] = b"hho\0"; -pub const SCNoFAST16: &[u8; 3usize] = b"lo\0"; -pub const SCNoFAST32: &[u8; 3usize] = b"lo\0"; -pub const SCNoFAST64: &[u8; 3usize] = b"lo\0"; -pub const SCNx8: &[u8; 4usize] = b"hhx\0"; -pub const SCNx16: &[u8; 3usize] = b"hx\0"; -pub const SCNx32: &[u8; 2usize] = b"x\0"; -pub const SCNx64: &[u8; 3usize] = b"lx\0"; -pub const SCNxLEAST8: &[u8; 4usize] = b"hhx\0"; -pub const SCNxLEAST16: &[u8; 3usize] = b"hx\0"; -pub const SCNxLEAST32: &[u8; 2usize] = b"x\0"; -pub const SCNxLEAST64: &[u8; 3usize] = b"lx\0"; -pub const SCNxFAST8: &[u8; 4usize] = b"hhx\0"; -pub const SCNxFAST16: &[u8; 3usize] = b"lx\0"; -pub const SCNxFAST32: &[u8; 3usize] = b"lx\0"; -pub const SCNxFAST64: &[u8; 3usize] = b"lx\0"; -pub const SCNdMAX: &[u8; 3usize] = b"ld\0"; -pub const SCNiMAX: &[u8; 3usize] = b"li\0"; -pub const SCNoMAX: &[u8; 3usize] = b"lo\0"; -pub const SCNuMAX: &[u8; 3usize] = b"lu\0"; -pub const SCNxMAX: &[u8; 3usize] = b"lx\0"; -pub const SCNdPTR: &[u8; 3usize] = b"ld\0"; -pub const SCNiPTR: &[u8; 3usize] = b"li\0"; -pub const SCNoPTR: &[u8; 3usize] = b"lo\0"; -pub const SCNuPTR: &[u8; 3usize] = b"lu\0"; -pub const SCNxPTR: &[u8; 3usize] = b"lx\0"; +pub const __PRI64_PREFIX: &[u8; 2] = b"l\0"; +pub const __PRIPTR_PREFIX: &[u8; 2] = b"l\0"; +pub const PRId8: &[u8; 2] = b"d\0"; +pub const PRId16: &[u8; 2] = b"d\0"; +pub const PRId32: &[u8; 2] = b"d\0"; +pub const PRId64: &[u8; 3] = b"ld\0"; +pub const PRIdLEAST8: &[u8; 2] = b"d\0"; +pub const PRIdLEAST16: &[u8; 2] = b"d\0"; +pub const PRIdLEAST32: &[u8; 2] = b"d\0"; +pub const PRIdLEAST64: &[u8; 3] = b"ld\0"; +pub const PRIdFAST8: &[u8; 2] = b"d\0"; +pub const PRIdFAST16: &[u8; 3] = b"ld\0"; +pub const PRIdFAST32: &[u8; 3] = b"ld\0"; +pub const PRIdFAST64: &[u8; 3] = b"ld\0"; +pub const PRIi8: &[u8; 2] = b"i\0"; +pub const PRIi16: &[u8; 2] = b"i\0"; +pub const PRIi32: &[u8; 2] = b"i\0"; +pub const PRIi64: &[u8; 3] = b"li\0"; +pub const PRIiLEAST8: &[u8; 2] = b"i\0"; +pub const PRIiLEAST16: &[u8; 2] = b"i\0"; +pub const PRIiLEAST32: &[u8; 2] = b"i\0"; +pub const PRIiLEAST64: &[u8; 3] = b"li\0"; +pub const PRIiFAST8: &[u8; 2] = b"i\0"; +pub const PRIiFAST16: &[u8; 3] = b"li\0"; +pub const PRIiFAST32: &[u8; 3] = b"li\0"; +pub const PRIiFAST64: &[u8; 3] = b"li\0"; +pub const PRIo8: &[u8; 2] = b"o\0"; +pub const PRIo16: &[u8; 2] = b"o\0"; +pub const PRIo32: &[u8; 2] = b"o\0"; +pub const PRIo64: &[u8; 3] = b"lo\0"; +pub const PRIoLEAST8: &[u8; 2] = b"o\0"; +pub const PRIoLEAST16: &[u8; 2] = b"o\0"; +pub const PRIoLEAST32: &[u8; 2] = b"o\0"; +pub const PRIoLEAST64: &[u8; 3] = b"lo\0"; +pub const PRIoFAST8: &[u8; 2] = b"o\0"; +pub const PRIoFAST16: &[u8; 3] = b"lo\0"; +pub const PRIoFAST32: &[u8; 3] = b"lo\0"; +pub const PRIoFAST64: &[u8; 3] = b"lo\0"; +pub const PRIu8: &[u8; 2] = b"u\0"; +pub const PRIu16: &[u8; 2] = b"u\0"; +pub const PRIu32: &[u8; 2] = b"u\0"; +pub const PRIu64: &[u8; 3] = b"lu\0"; +pub const PRIuLEAST8: &[u8; 2] = b"u\0"; +pub const PRIuLEAST16: &[u8; 2] = b"u\0"; +pub const PRIuLEAST32: &[u8; 2] = b"u\0"; +pub const PRIuLEAST64: &[u8; 3] = b"lu\0"; +pub const PRIuFAST8: &[u8; 2] = b"u\0"; +pub const PRIuFAST16: &[u8; 3] = b"lu\0"; +pub const PRIuFAST32: &[u8; 3] = b"lu\0"; +pub const PRIuFAST64: &[u8; 3] = b"lu\0"; +pub const PRIx8: &[u8; 2] = b"x\0"; +pub const PRIx16: &[u8; 2] = b"x\0"; +pub const PRIx32: &[u8; 2] = b"x\0"; +pub const PRIx64: &[u8; 3] = b"lx\0"; +pub const PRIxLEAST8: &[u8; 2] = b"x\0"; +pub const PRIxLEAST16: &[u8; 2] = b"x\0"; +pub const PRIxLEAST32: &[u8; 2] = b"x\0"; +pub const PRIxLEAST64: &[u8; 3] = b"lx\0"; +pub const PRIxFAST8: &[u8; 2] = b"x\0"; +pub const PRIxFAST16: &[u8; 3] = b"lx\0"; +pub const PRIxFAST32: &[u8; 3] = b"lx\0"; +pub const PRIxFAST64: &[u8; 3] = b"lx\0"; +pub const PRIX8: &[u8; 2] = b"X\0"; +pub const PRIX16: &[u8; 2] = b"X\0"; +pub const PRIX32: &[u8; 2] = b"X\0"; +pub const PRIX64: &[u8; 3] = b"lX\0"; +pub const PRIXLEAST8: &[u8; 2] = b"X\0"; +pub const PRIXLEAST16: &[u8; 2] = b"X\0"; +pub const PRIXLEAST32: &[u8; 2] = b"X\0"; +pub const PRIXLEAST64: &[u8; 3] = b"lX\0"; +pub const PRIXFAST8: &[u8; 2] = b"X\0"; +pub const PRIXFAST16: &[u8; 3] = b"lX\0"; +pub const PRIXFAST32: &[u8; 3] = b"lX\0"; +pub const PRIXFAST64: &[u8; 3] = b"lX\0"; +pub const PRIdMAX: &[u8; 3] = b"ld\0"; +pub const PRIiMAX: &[u8; 3] = b"li\0"; +pub const PRIoMAX: &[u8; 3] = b"lo\0"; +pub const PRIuMAX: &[u8; 3] = b"lu\0"; +pub const PRIxMAX: &[u8; 3] = b"lx\0"; +pub const PRIXMAX: &[u8; 3] = b"lX\0"; +pub const PRIdPTR: &[u8; 3] = b"ld\0"; +pub const PRIiPTR: &[u8; 3] = b"li\0"; +pub const PRIoPTR: &[u8; 3] = b"lo\0"; +pub const PRIuPTR: &[u8; 3] = b"lu\0"; +pub const PRIxPTR: &[u8; 3] = b"lx\0"; +pub const PRIXPTR: &[u8; 3] = b"lX\0"; +pub const SCNd8: &[u8; 4] = b"hhd\0"; +pub const SCNd16: &[u8; 3] = b"hd\0"; +pub const SCNd32: &[u8; 2] = b"d\0"; +pub const SCNd64: &[u8; 3] = b"ld\0"; +pub const SCNdLEAST8: &[u8; 4] = b"hhd\0"; +pub const SCNdLEAST16: &[u8; 3] = b"hd\0"; +pub const SCNdLEAST32: &[u8; 2] = b"d\0"; +pub const SCNdLEAST64: &[u8; 3] = b"ld\0"; +pub const SCNdFAST8: &[u8; 4] = b"hhd\0"; +pub const SCNdFAST16: &[u8; 3] = b"ld\0"; +pub const SCNdFAST32: &[u8; 3] = b"ld\0"; +pub const SCNdFAST64: &[u8; 3] = b"ld\0"; +pub const SCNi8: &[u8; 4] = b"hhi\0"; +pub const SCNi16: &[u8; 3] = b"hi\0"; +pub const SCNi32: &[u8; 2] = b"i\0"; +pub const SCNi64: &[u8; 3] = b"li\0"; +pub const SCNiLEAST8: &[u8; 4] = b"hhi\0"; +pub const SCNiLEAST16: &[u8; 3] = b"hi\0"; +pub const SCNiLEAST32: &[u8; 2] = b"i\0"; +pub const SCNiLEAST64: &[u8; 3] = b"li\0"; +pub const SCNiFAST8: &[u8; 4] = b"hhi\0"; +pub const SCNiFAST16: &[u8; 3] = b"li\0"; +pub const SCNiFAST32: &[u8; 3] = b"li\0"; +pub const SCNiFAST64: &[u8; 3] = b"li\0"; +pub const SCNu8: &[u8; 4] = b"hhu\0"; +pub const SCNu16: &[u8; 3] = b"hu\0"; +pub const SCNu32: &[u8; 2] = b"u\0"; +pub const SCNu64: &[u8; 3] = b"lu\0"; +pub const SCNuLEAST8: &[u8; 4] = b"hhu\0"; +pub const SCNuLEAST16: &[u8; 3] = b"hu\0"; +pub const SCNuLEAST32: &[u8; 2] = b"u\0"; +pub const SCNuLEAST64: &[u8; 3] = b"lu\0"; +pub const SCNuFAST8: &[u8; 4] = b"hhu\0"; +pub const SCNuFAST16: &[u8; 3] = b"lu\0"; +pub const SCNuFAST32: &[u8; 3] = b"lu\0"; +pub const SCNuFAST64: &[u8; 3] = b"lu\0"; +pub const SCNo8: &[u8; 4] = b"hho\0"; +pub const SCNo16: &[u8; 3] = b"ho\0"; +pub const SCNo32: &[u8; 2] = b"o\0"; +pub const SCNo64: &[u8; 3] = b"lo\0"; +pub const SCNoLEAST8: &[u8; 4] = b"hho\0"; +pub const SCNoLEAST16: &[u8; 3] = b"ho\0"; +pub const SCNoLEAST32: &[u8; 2] = b"o\0"; +pub const SCNoLEAST64: &[u8; 3] = b"lo\0"; +pub const SCNoFAST8: &[u8; 4] = b"hho\0"; +pub const SCNoFAST16: &[u8; 3] = b"lo\0"; +pub const SCNoFAST32: &[u8; 3] = b"lo\0"; +pub const SCNoFAST64: &[u8; 3] = b"lo\0"; +pub const SCNx8: &[u8; 4] = b"hhx\0"; +pub const SCNx16: &[u8; 3] = b"hx\0"; +pub const SCNx32: &[u8; 2] = b"x\0"; +pub const SCNx64: &[u8; 3] = b"lx\0"; +pub const SCNxLEAST8: &[u8; 4] = b"hhx\0"; +pub const SCNxLEAST16: &[u8; 3] = b"hx\0"; +pub const SCNxLEAST32: &[u8; 2] = b"x\0"; +pub const SCNxLEAST64: &[u8; 3] = b"lx\0"; +pub const SCNxFAST8: &[u8; 4] = b"hhx\0"; +pub const SCNxFAST16: &[u8; 3] = b"lx\0"; +pub const SCNxFAST32: &[u8; 3] = b"lx\0"; +pub const SCNxFAST64: &[u8; 3] = b"lx\0"; +pub const SCNdMAX: &[u8; 3] = b"ld\0"; +pub const SCNiMAX: &[u8; 3] = b"li\0"; +pub const SCNoMAX: &[u8; 3] = b"lo\0"; +pub const SCNuMAX: &[u8; 3] = b"lu\0"; +pub const SCNxMAX: &[u8; 3] = b"lx\0"; +pub const SCNdPTR: &[u8; 3] = b"ld\0"; +pub const SCNiPTR: &[u8; 3] = b"li\0"; +pub const SCNoPTR: &[u8; 3] = b"lo\0"; +pub const SCNuPTR: &[u8; 3] = b"lu\0"; +pub const SCNxPTR: &[u8; 3] = b"lx\0"; pub const _STDLIB_H: u32 = 1; pub const WNOHANG: u32 = 1; pub const WUNTRACED: u32 = 2; @@ -448,7 +448,7 @@ pub const BYTE_ORDER: u32 = 1234; pub const _BITS_BYTESWAP_H: u32 = 1; pub const _BITS_UINTN_IDENTITY_H: u32 = 1; pub const _SYS_SELECT_H: u32 = 1; -pub const __FD_ZERO_STOS: &[u8; 6usize] = b"stosq\0"; +pub const __FD_ZERO_STOS: &[u8; 6] = b"stosq\0"; pub const __sigset_t_defined: u32 = 1; pub const __timeval_defined: u32 = 1; pub const _STRUCT_TIMESPEC: u32 = 1; diff --git a/tss-esapi/tests/Dockerfile-ubuntu b/tss-esapi/tests/Dockerfile-ubuntu index b1dedb81..f1671e92 100644 --- a/tss-esapi/tests/Dockerfile-ubuntu +++ b/tss-esapi/tests/Dockerfile-ubuntu @@ -1,6 +1,6 @@ FROM ghcr.io/tpm2-software/ubuntu-18.04:latest -ARG TPM2_TSS_VERSION=2.3.3 +ARG TPM2_TSS_VERSION=2.4.6 ENV TPM2_TSS_VERSION=$TPM2_TSS_VERSION ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig diff --git a/tss-esapi/tests/all-ubuntu.sh b/tss-esapi/tests/all-ubuntu.sh index 96e95fe2..02910fb5 100755 --- a/tss-esapi/tests/all-ubuntu.sh +++ b/tss-esapi/tests/all-ubuntu.sh @@ -23,7 +23,7 @@ fi ################################################# # Generate bindings for non-"standard" versions # ################################################# -if [[ "$TPM2_TSS_VERSION" != "2.3.3" ]]; then +if [[ "$TPM2_TSS_VERSION" != "2.4.6" ]]; then FEATURES="--features=generate-bindings" else FEATURES="" diff --git a/tss-esapi/tests/cross-compile.sh b/tss-esapi/tests/cross-compile.sh index e3acfba5..cbca5aee 100755 --- a/tss-esapi/tests/cross-compile.sh +++ b/tss-esapi/tests/cross-compile.sh @@ -8,46 +8,51 @@ set -euf -o pipefail +OPENSSL_GIT="https://github.com/openssl/openssl.git" OPENSSL_VERSION="OpenSSL_1_1_1j" +TPM2_TSS_GIT="https://github.com/tpm2-software/tpm2-tss.git" +TPM2_TSS_VERSION="2.4.6" -cross-compile-openssl() { - # Prepare directory for cross-compiled OpenSSL files - mkdir -p /tmp/openssl-$1 - export INSTALL_DIR=/tmp/openssl-$1 +export SYSROOT="/tmp/sysroot" + +git_checkout() { + if [ ! -d "/tmp/$(basename "$1" ".git")" ]; then + pushd /tmp + git clone "$1" --branch "$2" + popd + fi +} + +prepare_sysroot() { + # Prepare the SYSROOT + [ -d "$SYSROOT" ] && rm -fr "$SYSROOT" + mkdir -p "$SYSROOT" + # Allow the `pkg-config` crate to cross-compile + export PKG_CONFIG_ALLOW_CROSS=1 + export PKG_CONFIG_PATH="$SYSROOT"/lib/pkgconfig:"$SYSROOT"/share/pkgconfig + export PKG_CONFIG_SYSROOT_DIR="$SYSROOT" +} + +cross-compile-openssl() { pushd /tmp/openssl # Compile and copy files over - ./Configure $2 shared --prefix=$INSTALL_DIR --openssldir=$INSTALL_DIR/openssl --cross-compile-prefix=$1- + ./Configure $2 shared --prefix="$SYSROOT" --openssldir="$SYSROOT"/openssl --cross-compile-prefix=$1- make clean make depend make -j$(nproc) - make install + make install_sw popd - - export INSTALL_DIR= } cross-compile-tpm2-tss() { - # Prepare directory for cross-compiled TSS lib - # `DESTDIR` is used in `make install` below to set the root of the installation paths. - # The `./configure` script accepts a `--prefix` input variable which sets the same root, - # but also adds it to the paths in `.pc` files used by `pkg-config`. This prevents the - # use of `PKG_CONFIG_SYSROOT_DIR`. - mkdir -p /tmp/tpm2-tss-$1 - export DESTDIR=/tmp/tpm2-tss-$1 - # Set sysroot to be used by the `pkg-config` wrapper - export SYSROOT=/tmp/tpm2-tss-$1 - - pushd /tpm2-tss - # Compile and copy files over - ./configure --build=x86_64-pc-linux-gnu --host=$1 --target=$1 CC=$1-gcc \ - LIBCRYPTO_CFLAGS="-I/tmp/openssl-$1/include" LIBCRYPTO_LIBS="-L/tmp/openssl-$1/lib -lcrypto" + pushd /tmp/tpm2-tss + [ ! -f configure ] && ./bootstrap + ./configure --enable-fapi=no --prefix=/ --build=x86_64-pc-linux-gnu --host=$1 --target=$1 CC=$1-gcc make clean make -j$(nproc) - make install + make DESTDIR="$SYSROOT" install popd - - export DESTDIR= } # Download cross-compilers @@ -56,6 +61,18 @@ apt install -y gcc-multilib apt install -y gcc-arm-linux-gnueabi apt install -y gcc-aarch64-linux-gnu +# Download other dependencies +apt install -y autoconf +apt install -y autoconf-archive +apt install -y cmake +apt install -y libclang-dev +apt install -y libtool +apt install -y pkgconf + +# Download OpenSSL, tpm2-tss and dependencies source code +git_checkout "$OPENSSL_GIT" "$OPENSSL_VERSION" +git_checkout "$TPM2_TSS_GIT" "$TPM2_TSS_VERSION" + # Download OpenSSL source code if [ ! -d "/tmp/openssl" ]; then pushd /tmp @@ -63,10 +80,8 @@ if [ ! -d "/tmp/openssl" ]; then popd fi -# Allow the `pkg-config` crate to cross-compile -export PKG_CONFIG_ALLOW_CROSS=1 -# Make the `pkg-config` crate use our wrapper -export PKG_CONFIG=$(pwd)/tests/pkg-config +# Clean and prepare SYSROOT +prepare_sysroot # Compile OpenSSL and TSS stack for aarch64-unknown-linux-gnu cross-compile-openssl aarch64-linux-gnu linux-generic64 @@ -76,6 +91,9 @@ rustup target add aarch64-unknown-linux-gnu cargo build --features generate-bindings --target aarch64-unknown-linux-gnu cargo build --target aarch64-unknown-linux-gnu +# Clean and prepare SYSROOT +prepare_sysroot + # Compile OpenSSL and TSS stack for armv7-unknown-linux-gnueabi cross-compile-openssl arm-linux-gnueabi linux-generic32 cross-compile-tpm2-tss arm-linux-gnueabi