You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tooling.apache.org by ak...@apache.org on 2026/05/07 19:53:43 UTC

(tooling-trusted-releases) branch fix-keys-dsa-bits created (now cf456600)

This is an automated email from the ASF dual-hosted git repository.

andrewmusselman pushed a change to branch fix-keys-dsa-bits
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git


      at cf456600 Drop dsa_bits reference; rpgp-py 0.19.7 doesn't expose it

This branch includes the following new commits:

     new cf456600 Drop dsa_bits reference; rpgp-py 0.19.7 doesn't expose it

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tooling.apache.org
For additional commands, e-mail: commits-help@tooling.apache.org


(tooling-trusted-releases) 01/01: Drop dsa_bits reference; rpgp-py 0.19.7 doesn't expose it

Posted by ak...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

andrewmusselman pushed a commit to branch fix-keys-dsa-bits
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git

commit cf4566000d2c1fb3c352da196e3147167e577479
Author: Andrew K. Musselman <ak...@apache.org>
AuthorDate: Thu May 7 12:51:54 2026 -0700

    Drop dsa_bits reference; rpgp-py 0.19.7 doesn't expose it
    
    git add -A
    uv run --frozen pre-commit run --all-files
    check that hooks apply...................................................Passed
    check python ast.........................................................Passed
    check for case conflicts.................................................Passed
    check that executables have shebangs.....................................Passed
    check illegal windows names..........................(no files to check)Skipped
    check json...............................................................Passed
    check for merge conflicts................................................Passed
    check that scripts with shebangs are executable..........................Passed
    check toml...............................................................Passed
    check vcs permalinks.....................................................Passed
    check yaml...............................................................Passed
    detect private key.......................................................Passed
    fix end of files.........................................................Passed
    fix utf-8 byte order marker..............................................Passed
    forbid submodules....................................(no files to check)Skipped
    mixed line ending........................................................Passed
    trim trailing whitespace.................................................Passed
    add a license for all Python files.......................................Passed
    add a license for JS and TS files........................................Passed
    run Markdown lints.......................................................Passed
    shellcheck...............................................................Passed
    DjHTML...................................................................Passed
    DjCSS....................................................................Passed
    stylelint................................................................Passed
    zizmor...................................................................Passed
    pip-audit................................................................Passed
    lint JS files with Oxlint................................................Passed
    lint Python files with Ruff..............................................Passed
    format Python files with Ruff............................................Passed
    format JS files with Biome...............................................Passed
    lint JS files with Biome.................................................Passed
    type check Python files with Pyright.....................................Passed
    check Jinja2 routes......................................................Passed
    check when dependencies were updated.....................................Passed
    check models imports.....................................................Passed
    check SQL model nullability..............................................Passed
    check template usage.....................................................Passed fails pyright on main with reportAttributeAccessIssue for
    PublicParamsInfo.dsa_bits, added in 9cc1dbbe (Restore support for DSA
    keys). rpgp-py 0.19.7 has no dsa_bits attribute and no equivalent
    field; for a DSA key, all numeric fields on PublicParamsInfo return
    None, only kind == dsa identifies it.
    
    DSA keys now raise a clear ValueError instead of AttributeError. RSA
    and ECC unaffected. Restoring DSA bit-length validation needs upstream
    work in rpgp-py.
---
 atr/storage/writers/keys.py | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/atr/storage/writers/keys.py b/atr/storage/writers/keys.py
index aa8c4d76..612caa71 100644
--- a/atr/storage/writers/keys.py
+++ b/atr/storage/writers/keys.py
@@ -133,16 +133,19 @@ def _key_length(key: openpgp.PublicKey) -> int:
     rsa_bits = public_params.rsa_bits
     if isinstance(rsa_bits, int):
         return rsa_bits
-    dsa_bits = public_params.dsa_bits
-    if isinstance(dsa_bits, int):
-        return dsa_bits
     curve_bits = public_params.curve_bits
     if isinstance(curve_bits, int):
         return curve_bits
-    raise ValueError(
-        f"Key size is not available for algorithm {key.public_key_algorithm}:"
-        f" rsa_bits={rsa_bits!r}, dsa_bits={dsa_bits!r}, curve_bits={curve_bits!r}"
-    )
+    # rpgp-py 0.19.7's PublicParamsInfo does not expose a bit-length
+    # field for DSA keys: kind == "dsa" but rsa_bits, curve_bits, and
+    # secret_key_length are all None. Until rpgp-py exposes the DSA
+    # parameter size we cannot validate the key size for DSA keys.
+    if public_params.kind == "dsa":
+        raise ValueError(
+            f"DSA key bit-length is not currently retrievable via rpgp-py "
+            f"({key.public_key_algorithm}); see TODO upstream issue"
+        )
+    raise ValueError(f"Key size is not available for algorithm {key.public_key_algorithm}")
 
 
 def _key_expires_at(key: openpgp.PublicKey) -> datetime.datetime | None:


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tooling.apache.org
For additional commands, e-mail: commits-help@tooling.apache.org