!JiiOHXrIUCtcOJsZCa:matrix.org

nio

359 Members
The nio matrix python library | Latest release 0.6 https://pypi.org/project/matrix-nio/ | Documentation: https://matrix-nio.readthedocs.io/en/stable/145 Servers

Load older messages


SenderMessageTime
20 Mar 2024
@maru:mike.it-loops.comMaruThis whole verification dance is really not that simple 15:57:14
@juju:matrix.juju.rejuju

I checked only a little bit,
The error seems to be raised here in matrix-rust-sdk in element

                VerificationLevel::UnsignedDevice => {
                    // This is a high warning. The sender hasn't verified his own device.
                    ShieldState::Red { message: UNSIGNED_DEVICE }
                }

Which is only called if this returns false

    /// Is this device cross signed by its owner?
    pub fn is_cross_signed_by_owner(&self) -> bool {
        self.device_owner_identity.as_ref().is_some_and(|device_identity| match device_identity {
            // If it's one of our own devices, just check that
            // we signed the device.
            ReadOnlyUserIdentities::Own(identity) => identity.is_device_signed(&self.inner).is_ok(),
            // If it's a device from someone else, check
            // if the other user has signed this device.
            ReadOnlyUserIdentities::Other(device_identity) => {
                device_identity.is_device_signed(&self.inner).is_ok()
            }
        })
    }

But I do not know if nio supports such device signing

16:11:52
@maru:mike.it-loops.comMaruI am testing the verification steps. what I wonder is how do I get an OlmDevice?20:35:35
@maru:mike.it-loops.comMarufor methods like verify_device20:35:46
@maru:mike.it-loops.comMaruCan I even access this from AsyncClient?20:55:35
@me:shahpaarth.comPaarth Shah - Github Maintainer
In reply to @maru:mike.it-loops.com
I am testing the verification steps. what I wonder is how do I get an OlmDevice?
In this example code, olm_device is an OlmDevice
21:06:02
@maru:mike.it-loops.comMaruthanks, the devices() method apparently tripped me up21:07:06
@maru:mike.it-loops.comMarulet me try again with the device_store21:07:14
@maru:mike.it-loops.comMaruhmm after login this is empty21:26:56
@maru:mike.it-loops.comMaruRedacted or Malformed Event21:32:24
@me:shahpaarth.comPaarth Shah - Github Maintainer
In reply to @maru:mike.it-loops.com
hmm after login this is empty
you need to sync first. The example code calls trust_devices in a function aptly called after_first_sync: https://github.com/matrix-nio/matrix-nio/blob/81b057f8b5a8882bca3ff69651c7ca35a30ce11d/examples/manual_encrypted_verify.py#L260-L276
21:33:35
@maru:mike.it-loops.comMaruI did an await asynclient.sync() first21:35:43
@maru:mike.it-loops.comMarubut let me start from scratch completely21:36:04
@maru:mike.it-loops.comMarunope still empty21:42:45
@maru:mike.it-loops.comMaru
21:42:53
@maru:mike.it-loops.comMaru * import nio21:43:05
@maru:mike.it-loops.comMaru *
import nio

ac = nio.AsyncClient("server","user",store_path="store")
await ac.login("password")
await ac.sync()
ac.device_store.items()
dict_items([('user1, {}),.....])
21:45:13
@juju:matrix.juju.rejujuIs your bot in any room? I am guessing it only gets the devices that share a room with it21:50:51
@maru:mike.it-loops.comMaruI am trying with my account and this one is in several room21:52:47
@maru:mike.it-loops.comMaruso even after a sync with full_state=True device_store is empty for me. This is really strange22:04:28
@maru:mike.it-loops.comMaruFOUND IT22:09:05
@maru:mike.it-loops.comMaruif you run sync() and not sync_forever() you have to call keys_query() as well22:09:31
21 Mar 2024
@me:shahpaarth.comPaarth Shah - Github Maintainer
In reply to @maru:mike.it-loops.com
if you run sync() and not sync_forever() you have to call keys_query() as well
Interesting; if there are indeed steps missing, would you want to make a PR to fix the example?
Else I'd not mind checking out whatever snippet you have and doing the update
05:00:25
@me:shahpaarth.comPaarth Shah - Github Maintainer

Oh interesting:

Automatically called by sync_forever() and room_send().

05:01:53
@maru:mike.it-loops.comMaruOk, so looking at this some more I wonder if it is even possible right now to verfiy one of your own devices. 18:05:48
@adam:bostoncoop.netAdamShouldn't it be possible for a verified session of one device to verify the other session of that device?19:00:33
@adam:bostoncoop.netAdamAre you saying as a matter of Matrix design or with respect to Nio specifically?19:00:47
@maru:mike.it-loops.comMaru I guess my lack of knowledge of the nio api is making it difficult to make it work. All i want is to verifs my nio created session with one of my verified ones20:49:38
@maru:mike.it-loops.comMaruBut since cross signing is not supported yet, using a passphrase would work for me as well but i did not figure how and if this is possible20:55:47
23 Mar 2024
@me:shahpaarth.comPaarth Shah - Github Maintainer

Have you tried using emoji verification rather than manual?

https://github.com/matrix-nio/matrix-nio/blob/main/examples%2Fverify_with_emoji.py

21:05:53

Show newer messages


Back to Room ListRoom Version: 4