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...................................................[42mPassed[m
check python ast.........................................................[42mPassed[m
check for case conflicts.................................................[42mPassed[m
check that executables have shebangs.....................................[42mPassed[m
check illegal windows names..........................(no files to check)[46;30mSkipped[m
check json...............................................................[42mPassed[m
check for merge conflicts................................................[42mPassed[m
check that scripts with shebangs are executable..........................[42mPassed[m
check toml...............................................................[42mPassed[m
check vcs permalinks.....................................................[42mPassed[m
check yaml...............................................................[42mPassed[m
detect private key.......................................................[42mPassed[m
fix end of files.........................................................[42mPassed[m
fix utf-8 byte order marker..............................................[42mPassed[m
forbid submodules....................................(no files to check)[46;30mSkipped[m
mixed line ending........................................................[42mPassed[m
trim trailing whitespace.................................................[42mPassed[m
add a license for all Python files.......................................[42mPassed[m
add a license for JS and TS files........................................[42mPassed[m
run Markdown lints.......................................................[42mPassed[m
shellcheck...............................................................[42mPassed[m
DjHTML...................................................................[42mPassed[m
DjCSS....................................................................[42mPassed[m
stylelint................................................................[42mPassed[m
zizmor...................................................................[42mPassed[m
pip-audit................................................................[42mPassed[m
lint JS files with Oxlint................................................[42mPassed[m
lint Python files with Ruff..............................................[42mPassed[m
format Python files with Ruff............................................[42mPassed[m
format JS files with Biome...............................................[42mPassed[m
lint JS files with Biome.................................................[42mPassed[m
type check Python files with Pyright.....................................[42mPassed[m
check Jinja2 routes......................................................[42mPassed[m
check when dependencies were updated.....................................[42mPassed[m
check models imports.....................................................[42mPassed[m
check SQL model nullability..............................................[42mPassed[m
check template usage.....................................................[42mPassed[m 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