diff mbox series

[wotmate] get_key_paths: Fix keypath for top key

Message ID 20250411064226.1461929-2-u.kleine-koenig@baylibre.com (mailing list archive)
State New
Headers show
Series [wotmate] get_key_paths: Fix keypath for top key | expand

Commit Message

Uwe Kleine-König April 11, 2025, 6:42 a.m. UTC
The root key is trusted implicitly and not because it is self signed. So
it's trust path set is [[$rootkey]] and not [[$rootkey, $rootkey]].
---
Hello,

this fixes the issue with Linus' trust graph that I found in
https://lore.kernel.org/tools/6sa3iqt64w2vxne3h2w7oxuna7wae5o3ko664vvrd5aqffk6zg@v6iioe56nnma/.

With that the text representation of Linus' trust path is:

	from  Linus Torvalds <torvalds@kernel.org>

which is better than before, but still a bit ugly.

Best regards
Uwe

 wotmate/__init__.py | 4 ++++
 1 file changed, 4 insertions(+)


base-commit: f146a1815ad93b2f318e0a5fa857b11814a78b8b
diff mbox series

Patch

diff --git a/wotmate/__init__.py b/wotmate/__init__.py
index 32f91cf2a75b..20e7a9a588b2 100644
--- a/wotmate/__init__.py
+++ b/wotmate/__init__.py
@@ -348,6 +348,10 @@  def get_pubrow_id(c, whatnot):
 
 
 def get_key_paths(c, t_p_rowid, b_p_rowid, maxdepth=5, maxpaths=5):
+    if t_p_rowid == b_p_rowid:
+        logger.debug('Bottom key is top key')
+        return [[t_p_rowid]]
+
     # Next, get rowids of all keys signed by top key
     sigs = get_all_signed_by(c, t_p_rowid)
     if not sigs: