Skip to content

Commit 22c1649

Browse files
committed
Fix compilation issues of OpenSSL tests on 32-bit architectures
1 parent 964f9c6 commit 22c1649

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

rcgen/tests/openssl.rs

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -422,11 +422,27 @@ fn test_openssl_crl_parse() {
422422

423423
// The properties of the CRL should match expected.
424424
let openssl_issuer = X509::from_der(issuer.der()).unwrap();
425-
let expected_last_update =
426-
Asn1Time::from_unix(crl.params().this_update.unix_timestamp()).unwrap();
425+
// Asn1Time::from_unix takes i64 or i32 (depending on CPU architecture)
426+
#[allow(clippy::useless_conversion)]
427+
let expected_last_update = Asn1Time::from_unix(
428+
crl.params()
429+
.this_update
430+
.unix_timestamp()
431+
.try_into()
432+
.unwrap(),
433+
)
434+
.unwrap();
427435
assert!(openssl_crl.last_update().eq(&expected_last_update));
428-
let expected_next_update =
429-
Asn1Time::from_unix(crl.params().next_update.unix_timestamp()).unwrap();
436+
// Asn1Time::from_unix takes i64 or i32 (depending on CPU architecture)
437+
#[allow(clippy::useless_conversion)]
438+
let expected_next_update = Asn1Time::from_unix(
439+
crl.params()
440+
.next_update
441+
.unix_timestamp()
442+
.try_into()
443+
.unwrap(),
444+
)
445+
.unwrap();
430446
assert!(openssl_crl.next_update().unwrap().eq(&expected_next_update));
431447
assert!(matches!(
432448
openssl_crl

0 commit comments

Comments
 (0)