Skip to content
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

verification issue #182

Open
kilavila opened this issue Aug 21, 2024 · 13 comments
Open

verification issue #182

kilavila opened this issue Aug 21, 2024 · 13 comments

Comments

@kilavila
Copy link

verification isn't working for me, it just won't connect to the other sessions?
would be nice if we could use keys tho: --verify 'secret key'

@jknedlik
Copy link

+1 from my side. Sadly 🥹

@8go
Copy link
Owner

8go commented Sep 3, 2024

Yes, there is a verification issue.

Matrix has modified the verification specification. And then thereafter modified the implementation of the Element clients. Hence verification is no longer working.

Sadly, matrix-nio has not yet adopted these changes. And hence since mc depends on matri-nio verification is also not working in mc.

I spent many hours trying some work-arounds, work-arounds that seemed to have worked some months ago. These work-arounds got mc a step further in the emoji verificatin process but in the end they all failed with "key not matching".

The matrix-nio verification issues are discussed her:

matrix-nio/matrix-nio#512

matrix-nio/matrix-nio#430

I tried this code: wreald/matrix-nio@5cb8e99

It helps as it picks up events that before had been dropped, but as I said finally it ends with "key mismatch".

It might be a long wait until matrix-nio fixes this and hence a long wait for mc users too ...

@8go
Copy link
Owner

8go commented Sep 3, 2024

See other comments in closed issue #171
I am trying to concentrate all verify-related issue here, in Issue #182.

@8go
Copy link
Owner

8go commented Sep 4, 2024

Added new release v7.7.0 with commit 1470570

added 2 new verification features: --verify manual, --verify emojireq

  • --verify manual does a one-way setting of trust
  • --verify emojireq initiates an emoji verification (instead of waiting for one)

Verification remains broken or partially broken. So this release does not fix the broken verification, but it adds new code to adapt to the new specification. This new code might also help someone else to adjust the code and to write a workaround for the problem.

If someone knows how to fix the known verify issues please contribute. Look at tags TOFIX and TODO in the source code.

@8go
Copy link
Owner

8go commented Sep 4, 2024

Anyone else is using matrix-nio and is doing verification? Please raise your hand. 🙏

@8go
Copy link
Owner

8go commented Sep 4, 2024

@kilavila

would be nice if we could use keys tho: --verify 'secret key'

There is no such functionality in matrix-nio. Submit an issue with matrix-nio to request this feature please.

@jknedlik
Copy link

jknedlik commented Sep 7, 2024

Anyone else is using matrix-nio and is doing verification? Please raise your hand. 🙏

Not yet, but I might get interested in contributing (later, see down below) , as I see this as a perfect scriptable client for bots.
As far as I know there are 2 problems:

If I got anything wrong, please correct me 👼 .

Hope this helps?

Cheers 😄

@8go
Copy link
Owner

8go commented Sep 10, 2024

Yes, @jknedlik , this is my understanding as well.

@8go
Copy link
Owner

8go commented Sep 10, 2024

I might add that those who truly wish to verify, could do it by using matrix-commander-rs to verify and to swap the credentials back and forth between matrix-commander and matrix-commander-rs to make it work.

In theory it should work, but I have not tried it.

You manually copy paste the credentials from the Py version into the Rust version credentials file. Verity with the Rust version (using the Py credentials). Next time the Py version is started it should be verified.

If someone attempts this, please report back here on your success/failure.

Or similarly, have Rust verify and then have Py "steal" the credentials from Rust, i.e. the Rust device becomes the Py device.

@fingon
Copy link

fingon commented Oct 1, 2024

Just copying Rust credentials to the Python configuration file worked for me (I guess using same file would have worked too, although Rust one has refresh_token null which I am not sure if the Python version would feel offended by).

@windows8prew
Copy link

Maybe we can import verified session from element?

@hax0rbana-adam
Copy link

matrix-commander-rs verification

Hey all, I tried doing emoji verification using matrix-commander-rs and then importing it to matrix-commander.

I was unable to verify with matrix-commander-rs. I went through the process and accepted on both sides (using element-web) and element web said I've successfully verified, but matrix-commander-rs said The verification has been cancelled, reason: Unknown cancel reason. After this, the matrix-commander session was still not marked as trusted in element-web.

I tried it again in Chromium (instead of Firefox) and it was even worse: I couldn't get the emojis to load to accept them. On the matrix-commander side, it hung at Accepting verification request from @adamtest:hax0rbana.org and on the Chrome side it hung when trying to load the emojis (immediately after clicking "Start"). Eventually it timed out.

If I should open tickets on the matrix-commander-rs and element-web projects for these issues, please let me know.

If I can get matrix-commander-rs to verify my session, I'd be happy to try importing it to the python implementation.

Manual verification

I also tried using "Manually verify by text" in element-web, and just blindly accepting the session key (since it's just a test account anyway), but clicking the Verify session over there didn't have any effect.

In any case, thank you for the --verify manual option. Side note: It might be reasonable to only add the line to the .trusted_devices file if it is not already there.

Debian 11 incompatibility

I wanted to also make sure that people know that Debian 11 users will never get a fix for this problem because they can't get a newer version of matrix-commander than 7.6.1. If you use Debian 11, you'll have to be happy with the old version, upgrade your O/S or find a newer machine to use to interact with matrix from the command line.

Debian 11 currently has Python 3.9.2 and pip 20.3.4. When using pip to install matrix-commander, they get version 7.6.1.

In contrast, Debian 12 has Python 3.11.2, pip 23.0.1, and gets matrix-commander-8.0.0 from the pypi repos.

Note: Debian 11 is still supported until 2026-08-31. I'm not sure why this project isn't backward compatible (maybe a library it depends on?), but I wanted to make sure to draw attention to it so users will know whether they can get updates or not, and make sure that the lack of backward compatibility is a deliberate choice as opposed not something that just happened in the background by accident and can be fixed.

Note: If this project drops Python 3.11 support, everyone who uses any stable version of Debian will be unable to update their matrix-commander. I mention this so people are aware of the impact of changing the minimum requirements.

@8go
Copy link
Owner

8go commented Nov 21, 2024

@hax0rbana-adam : While I have no immediate solution for you, I appreciate you sharing your experience. It will help others, and thanks for drawing attention to the Debian 11 situation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants