diff options
| author | Steven Fackler <[email protected]> | 2013-11-20 21:45:05 -0800 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2013-11-20 21:45:05 -0800 |
| commit | 2216f86bd3acbcf165d83cf617834c334168fe3b (patch) | |
| tree | 2cb4f35d34f979aaef0ae8d72a816368ab146cf4 /test.rs | |
| parent | Fix locking (diff) | |
| download | rust-openssl-2216f86bd3acbcf165d83cf617834c334168fe3b.tar.xz rust-openssl-2216f86bd3acbcf165d83cf617834c334168fe3b.zip | |
Make verification callbacks sound
Diffstat (limited to 'test.rs')
| -rw-r--r-- | test.rs | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -47,7 +47,7 @@ fn test_verify_trusted() { #[test] fn test_verify_untrusted_callback_override_ok() { - fn callback(_preverify_ok: bool, _x509_ctx: X509StoreContext) -> bool { + fn callback(_preverify_ok: bool, _x509_ctx: &X509StoreContext) -> bool { true } let stream = TcpStream::connect(FromStr::from_str("127.0.0.1:15418").unwrap()).unwrap(); @@ -61,7 +61,7 @@ fn test_verify_untrusted_callback_override_ok() { #[test] fn test_verify_untrusted_callback_override_bad() { - fn callback(_preverify_ok: bool, _x509_ctx: X509StoreContext) -> bool { + fn callback(_preverify_ok: bool, _x509_ctx: &X509StoreContext) -> bool { false } let stream = TcpStream::connect(FromStr::from_str("127.0.0.1:15418").unwrap()).unwrap(); @@ -72,7 +72,7 @@ fn test_verify_untrusted_callback_override_bad() { #[test] fn test_verify_trusted_callback_override_ok() { - fn callback(_preverify_ok: bool, _x509_ctx: X509StoreContext) -> bool { + fn callback(_preverify_ok: bool, _x509_ctx: &X509StoreContext) -> bool { true } let stream = TcpStream::connect(FromStr::from_str("127.0.0.1:15418").unwrap()).unwrap(); @@ -90,7 +90,7 @@ fn test_verify_trusted_callback_override_ok() { #[test] fn test_verify_trusted_callback_override_bad() { - fn callback(_preverify_ok: bool, _x509_ctx: X509StoreContext) -> bool { + fn callback(_preverify_ok: bool, _x509_ctx: &X509StoreContext) -> bool { false } let stream = TcpStream::connect(FromStr::from_str("127.0.0.1:15418").unwrap()).unwrap(); @@ -105,7 +105,7 @@ fn test_verify_trusted_callback_override_bad() { #[test] fn test_verify_callback_load_certs() { - fn callback(_preverify_ok: bool, x509_ctx: X509StoreContext) -> bool { + fn callback(_preverify_ok: bool, x509_ctx: &X509StoreContext) -> bool { assert!(x509_ctx.get_current_cert().is_some()); true } @@ -117,7 +117,7 @@ fn test_verify_callback_load_certs() { #[test] fn test_verify_trusted_get_error_ok() { - fn callback(_preverify_ok: bool, x509_ctx: X509StoreContext) -> bool { + fn callback(_preverify_ok: bool, x509_ctx: &X509StoreContext) -> bool { assert!(x509_ctx.get_error().is_none()); true } @@ -133,7 +133,7 @@ fn test_verify_trusted_get_error_ok() { #[test] fn test_verify_trusted_get_error_err() { - fn callback(_preverify_ok: bool, x509_ctx: X509StoreContext) -> bool { + fn callback(_preverify_ok: bool, x509_ctx: &X509StoreContext) -> bool { assert!(x509_ctx.get_error().is_some()); false } |