()
| 984 | |
| 985 | #[tokio::test(flavor = "multi_thread", worker_threads = 2)] |
| 986 | async fn test_wrong_auth_token() -> Result<()> { |
| 987 | let mut tcm = TestContextManager::new(); |
| 988 | let alice = &tcm.alice().await; |
| 989 | let bob = &tcm.bob().await; |
| 990 | |
| 991 | // Bob should already have Alice's key |
| 992 | // so that he can directly send vc-request-with-auth |
| 993 | tcm.send_recv(alice, bob, "hi").await; |
| 994 | |
| 995 | let alice_qr = get_securejoin_qr(alice, None).await?; |
| 996 | println!("{alice_qr}"); |
| 997 | let invalid_alice_qr = alice_qr.replace("&s=", "&s=INVALIDAUTHTOKEN&someotherkey="); |
| 998 | |
| 999 | join_securejoin(bob, &invalid_alice_qr).await?; |
| 1000 | let sent = bob.pop_sent_msg().await; |
| 1001 | |
| 1002 | let msg = alice.parse_msg(&sent).await; |
| 1003 | assert_eq!( |
| 1004 | msg.get_header(HeaderDef::SecureJoin).unwrap(), |
| 1005 | "vc-request-with-auth" |
| 1006 | ); |
| 1007 | |
| 1008 | alice.recv_msg_trash(&sent).await; |
| 1009 | |
| 1010 | let alice_bob_contact = alice.add_or_lookup_contact(bob).await; |
| 1011 | assert!(!alice_bob_contact.is_verified(alice).await?); |
| 1012 | |
| 1013 | Ok(()) |
| 1014 | } |
| 1015 | |
| 1016 | #[tokio::test(flavor = "multi_thread", worker_threads = 2)] |
| 1017 | async fn test_send_avatar_in_securejoin() -> Result<()> { |
nothing calls this directly
no test coverage detected