Skip to content

Commit 6a32c83

Browse files
committed
Remove hardcoded key mapping in chelon-sign, enable key-name alias
1 parent 0c4cbb6 commit 6a32c83

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

tools/chelon-sign

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,8 @@ def sign_rpm_integrated(rpm_path: str, key_type: str = 'modern', verbose: bool =
222222
rpm_file = Path(rpm_path).absolute()
223223
script_path = Path(__file__).absolute()
224224

225-
# Map key_type to standard Atomicorp Key IDs if not provided
226-
key_ids = {
227-
'legacy': '4520AFA9',
228-
'modern': 'CB2C73F04F3BE076'
229-
}
230-
key_id = key_ids.get(key_type, key_type)
225+
# Use the provided key type/name directly as the key ID
226+
key_id = key_type
231227

232228
if verbose:
233229
print(f"Integrated Signing: {rpm_file}")
@@ -325,8 +321,8 @@ def main():
325321
help='Signing type (default: guess from extension or "rpm")')
326322
parser.add_argument('--resign', action='store_true', help='Embed signature into RPM header (requires rpmsign, implies --type rpm)')
327323
parser.add_argument('-o', '--output', help='Output signature file (default: <file>.asc, only for detached)')
328-
parser.add_argument('-k', '--key-type', choices=['legacy', 'modern'], default='modern',
329-
help='GPG key type to use (default: modern)')
324+
parser.add_argument('-k', '--key-type', '--key-name', dest='key_type', default='modern',
325+
help='GPG key name/type (default: modern)') # --key-name is alias
330326
parser.add_argument('--insecure', action='store_true', help='Disable SSL certificate verification')
331327
parser.add_argument('-v', '--verbose', action='store_true', help='Verbose output')
332328

0 commit comments

Comments
 (0)