-
-
Notifications
You must be signed in to change notification settings - Fork 122
fix: Fix order of operations when handling "vc-request-with-auth" #6850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -951,3 +951,34 @@ async fn test_parallel_setup_contact() -> Result<()> { | |
|
|
||
| Ok(()) | ||
| } | ||
|
|
||
| #[tokio::test(flavor = "multi_thread", worker_threads = 2)] | ||
| async fn test_wrong_auth_token() -> Result<()> { | ||
| let mut tcm = TestContextManager::new(); | ||
| let alice = &tcm.alice().await; | ||
| let bob = &tcm.bob().await; | ||
|
|
||
| // Bob should already have Alice's key | ||
| // so that he can directly send vc-request-with-auth | ||
| tcm.send_recv(alice, bob, "hi").await; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You don't need to send any messages, just import a vCard with
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Importing a vCard only sets gossiped key, and |
||
|
|
||
| let alice_qr = get_securejoin_qr(alice, None).await?; | ||
| println!("{}", &alice_qr); | ||
| let invalid_alice_qr = alice_qr.replace("&s=", "&s=INVALIDAUTHTOKEN&someotherkey="); | ||
|
|
||
| join_securejoin(bob, &invalid_alice_qr).await?; | ||
| let sent = bob.pop_sent_msg().await; | ||
|
|
||
| let msg = alice.parse_msg(&sent).await; | ||
| assert_eq!( | ||
| msg.get_header(HeaderDef::SecureJoin).unwrap(), | ||
| "vc-request-with-auth" | ||
| ); | ||
|
|
||
| alice.recv_msg_trash(&sent).await; | ||
|
|
||
| let alice_bob_contact = alice.add_or_lookup_contact(bob).await; | ||
| assert!(!alice_bob_contact.is_forward_verified(alice).await?); | ||
|
|
||
| Ok(()) | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.