Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • G gajim-plugins
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 50
    • Issues 50
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 5
    • Merge requests 5
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gajim
  • gajim-plugins
  • Issues
  • #579

Closed
Open
Created Jan 25, 2022 by Klaus Umbach@treibholz

OMEMO: KeyError if trust is NULL

Versions

  • OS: Debian 11
  • Gajim version: 1.3.1
  • Plugin version: 2.7.15
  • GTK version: 3.24.24
  • Python-nbxmpp version: 2.0.2-1

Steps to reproduce the problem

  1. Maybe have a very old omemo_LOCALPART@DOMAIN.db where some of your own old (unused) keys have trust NULL in the table IDENTITIES
  2. try to talk to someone else with a yet unknown key.

Expected behavior

  1. popup with keys to choose to trust.

Actual behavior

  1. No popup opens to validate the key
  2. message get's sent anyway and can't be decrypted by the recipient.
  3. recipient answers, answer is encrypted but "untrusted"
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gajim/plugins/pluginmanager.py", line 476, in _execute_all_handlers_of_gui_extension_point
    handlers[0](*args)
  File "/home/MYUSER/.local/share/gajim/plugins/omemo/plugin.py", line 238, in _on_encryption_button_clicked
    self._show_fingerprint_window(chat_control)
  File "/home/MYUSER/.local/share/gajim/plugins/omemo/plugin.py", line 313, in _show_fingerprint_window
    KeyDialog(self, contact, transient,
  File "/home/MYUSER/.local/share/gajim/plugins/omemo/gtk/key.py", line 102, in __init__
    self.update()
  File "/home/MYUSER/.local/share/gajim/plugins/omemo/gtk/key.py", line 139, in update
    self._load_fingerprints(self._own_jid)
  File "/home/MYUSER/.local/share/gajim/plugins/omemo/gtk/key.py", line 157, in _load_fingerprints
    rows[result.public_key] = KeyRow(result.recipient_id,
  File "/home/MYUSER/.local/share/gajim/plugins/omemo/gtk/key.py", line 250, in __init__
    self._trust_button = TrustButton(self)
  File "/home/MYUSER/.local/share/gajim/plugins/omemo/gtk/key.py", line 348, in __init__
    self.update()
  File "/home/MYUSER/.local/share/gajim/plugins/omemo/gtk/key.py", line 351, in update
    icon_name, tooltip, css_class = TRUST_DATA[self._row.trust]
KeyError: None

This did not happen on another machine with the same OS/Gajim-Version.

After diging around, adding dirty print() in some lines, I found out that the KeyError was because of my own recipient_id, so I had a look in the sqlitedb. Some really old keys of my account had a trust of NULL (not found on the other machine). After deleteting those lines in the sqlitedb, gajim/omemo worked as expected.

So for me, on my machine this problem is solved. But maybe others might run in that problem too.

Assignee
Assign to
Time tracking