From e784a4ef02eb85215b93473dcd6f99222be75355 Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Thu, 19 Sep 2024 23:00:07 +0200 Subject: [PATCH] Fix compilation issues of OpenSSL tests on 32-bit architectures --- rcgen/tests/openssl.rs | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/rcgen/tests/openssl.rs b/rcgen/tests/openssl.rs index 478f565e..ae0b9bbf 100644 --- a/rcgen/tests/openssl.rs +++ b/rcgen/tests/openssl.rs @@ -422,11 +422,27 @@ fn test_openssl_crl_parse() { // The properties of the CRL should match expected. let openssl_issuer = X509::from_der(issuer.der()).unwrap(); - let expected_last_update = - Asn1Time::from_unix(crl.params().this_update.unix_timestamp()).unwrap(); + // Asn1Time::from_unix takes i64 or i32 (depending on CPU architecture) + #[allow(clippy::useless_conversion)] + let expected_last_update = Asn1Time::from_unix( + crl.params() + .this_update + .unix_timestamp() + .try_into() + .unwrap(), + ) + .unwrap(); assert!(openssl_crl.last_update().eq(&expected_last_update)); - let expected_next_update = - Asn1Time::from_unix(crl.params().next_update.unix_timestamp()).unwrap(); + // Asn1Time::from_unix takes i64 or i32 (depending on CPU architecture) + #[allow(clippy::useless_conversion)] + let expected_next_update = Asn1Time::from_unix( + crl.params() + .next_update + .unix_timestamp() + .try_into() + .unwrap(), + ) + .unwrap(); assert!(openssl_crl.next_update().unwrap().eq(&expected_next_update)); assert!(matches!( openssl_crl