Skip to content

Commit

Permalink
Add ASCII format of PGP keys, remove SHA-1 from release signing key
Browse files Browse the repository at this point in the history
  • Loading branch information
flashcode committed Jan 19, 2025
1 parent 71c4b9d commit a7f2247
Show file tree
Hide file tree
Showing 12 changed files with 738 additions and 298 deletions.
51 changes: 51 additions & 0 deletions media/pgp/11E9DE8848F2B65222AA75B8D1820DB22A11534E.asc
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----

mQINBFYaCXIBEAC3gDgm+9MKZV4va5dhIyUQOhRePHn+KQhxIAmyroDA04EBOwkE
EeluM420yStLeh0chdQyYsEOzEqzzUSgs7L7fI6jDo0qwcbtKOgZ+Lf7JaVH+g6j
wZqkLNzKFRFZPpKTmVUv9Z6U1TU2MfqgifiGmncVT7zChz1gb78W4SkIys38BvSm
EFqB76bHjDT8G5Wzv2h9VIntnEqUpzGEyQbtyUKPZ+eKT1kjSk1Mxk6HOTA+9a3I
ovEZNDsZY/mmIRO6jh3ah8YclsDMr7tFs23VpUpl9wINWxSwCg3ANAphFa1f9s3s
q7yoOIynj5HfMdA6P/mKvH58rvP1BIP19MKPdUVbFTgRKYoysFoCnZ17rH6e/T+3
HDALvTFRduO0X5beMAs+q5fYkhUNylZeUUmriwjYbxC/Nanp7TaD6DU0jikxrjh+
vqjuZS9M/coXa1XXEnsFeKYCzl0KPcqNyOU7ngd8f79BwcQyvaug18oxp/ZCf0Nl
rAqzN5iLITxOodXHYEKuxVUrjHC0BWrF3VoaOc4BcBuO+KHzxzOnuHOSQlWxQQsp
A7Tff+N2iP/E52/wHPPedXXdLofxdj7xiFveaPdrOb7f7YcZiccpTtWmjUK/6WsV
+lhTyvZZLHtvYxgK1wS+9g0NBc3qlp3hvElWS5q3K3BG+FaPUQphB1jmDQARAQAB
tC5XZWVDaGF0IERlYmlhbiBSZXBvc2l0b3J5IDxkZWJpYW5Ad2VlY2hhdC5vcmc+
iQI4BBMBAgAiBQJWGglyAhsDBgsJC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w88MhhbU4JP3qFQa34g2sk7CWygCUp1BJtl23U
qbO3wgTCCdnoticOvw==
=xmBr
-----END PGP PUBLIC KEY BLOCK-----
Binary file modified media/pgp/A9AB5AB778FA5C3522FD0378F82F4B16DEC408F8
Binary file not shown.
78 changes: 78 additions & 0 deletions media/pgp/A9AB5AB778FA5C3522FD0378F82F4B16DEC408F8.asc
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----

mQINBFCCu4cBEADNDLretQkViqptiL275IKrc+VaGvUAIfFZoNTZHYrBAGCFNU++
bXMqVxXM6QFhyXDbVSTAbl0gdmMPEQzi3ErtatyMsH3PDhU6mxLjwc61/P2JWNVf
4JGgEaqM/Gb0KEFnOWHGH1IDGMAxCL/duch8D3XrODOxqxCVLn/yFpjCANr9sXfh
V+K05KIvTE3ar8SZjVDH3APmdFYv2KSs01aoR+Zj0MIdJKgBIPUKod8VodH03RTu
ob4I1jocMad56hsMJk3NE179xxDA+DN7muIzv2yY+bw2EId+PhmvArKWgwFOvhmU
TTYNA5UOzC9jvzxVI/4g1ERImXXGdYBX9SllY5hqkk36EFchVAOmLz39zSTUQfIT
S9ugMiH3VudjSinNsn/R5iRvbuO1kHDGL583DT9qDadkXBxoFBgafgoEwiLLPuyH
BLdaZ51fmgvfupt0tP9F0Tcy4xCjz+Fesi3RtXlLJv351KIIbJsy8hNh1tSe/32t
dN4KoaULR2fGu+7NHeZBRk0r7+OjtRaXZWyaYfx4XAKqqdxcDcgYS8vb111JpkFN
/zf2HZtIA7IMUGQrf23O3xUun6voQb14qEMtWS49DxXmBc5g2KITtkpoVBSzHNVO
6aUzpgjeV8bRGTobpVvilz6Af34/gYIsvo0JQ14xB/F7cyaA1e4d6BtzSwARAQAB
tC1XZWVDaGF0IChzaWduaW5nIGtleSkgPHdlYm1hc3RlckB3ZWVjaGF0Lm9yZz6J
AjgEEwECACIFAlCCu4cCGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4B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9MCGwwWIQSpq1q3ePpcNSL9A3j4L0sW3sQI+AAANsUQALGKxCo7EFPdTUVubtxB
hrnVGFRHQF7zZe1lZg4lHv7crdNT2xcXqZSrREPO4+Mb1kZx0JfydAIrpmtNt4sI
/4Vy67t0EsubuYZYHtdxIdytNBoRIox5fNB4bNlWAxgBU2mXakLcgUX+kUA2UxsL
32mHcqirgmusVEM2Bz2Zk+oJoHg4O95q1pEtWeMtgP/c1z8HDwpsJhWanGzHyki4
zpO1gzClGezmyKie+X2KgifNYD0hBTFMwGTpsaLHpZ2Y6Hp1Oba9Pf6U8O7eFxBc
TGi1y7EtLK1O9i44/hNet4kuvert8wHqsRdNntDswaLACnOj0xiD8tjYhjOSL4vC
1v0wkhJ2VgZ3LEFRV/F+lok75t9haDMW/PGNFIKLlrDimlt+qqIjJMCXg9oDci+5
y6YvrHRzibNaBR7AOzN7VF10SJPWRDnZj9hQm32BaSSKLWC4QxlmL/yZmBOFdPG6
ZX5lc1w+9JjIrAFBwnd5r7+aAhbIZ92IMDLkd87kLD5oujlcFnDC3VmgqVOIWm1Y
1Knc0r2jfVbsX0xTAEn5WTZSAgPMwdr01//CKbwQB/WhICJynO4RI0XbaQgYjJ8u
H5/Q953qo6keD/PBjqJI82CH8j/dm2bgNJxyDsiflXkkKD3VT+IEydptf5k+280I
VAs2O8VIZ3kuhhCpM5z0Dskv
=whBR
-----END PGP PUBLIC KEY BLOCK-----
59 changes: 46 additions & 13 deletions weechat/dev/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,13 @@
),
(
'release_signing_key',
gettext_lazy('Release signing key (format: PGP public key).'),
gettext_lazy('Release signing key '
'(format: PGP public key as binary file).'),
),
(
'release_signing_key_asc',
gettext_lazy('Release signing key '
'(format: PGP public key as ASCII file).'),
),
(
'debian_repository_signing_fingerprint',
Expand All @@ -89,7 +95,12 @@
(
'debian_repository_signing_key',
gettext_lazy('Debian/Ubuntu repository signing key '
'(format: PGP public key).'),
'(format: PGP public key as binary file).'),
),
(
'debian_repository_signing_key_asc',
gettext_lazy('Debian/Ubuntu repository signing key '
'(format: PGP public key as ASCII file).'),
),
(
'all',
Expand All @@ -98,7 +109,15 @@
),
)

BINARY_INFO_KEYS = ('release_signing_key', 'debian_repository_signing_key')
INFO_PGP_KEYS_BIN = (
'release_signing_key',
'debian_repository_signing_key',
)
INFO_PGP_KEYS_ASC = (
'release_signing_key_asc',
'debian_repository_signing_key_asc',
)
INFO_PGP_KEYS = INFO_PGP_KEYS_BIN + INFO_PGP_KEYS_ASC

PGP_KEYS = {
'release_signing': 'A9AB5AB778FA5C3522FD0378F82F4B16DEC408F8',
Expand Down Expand Up @@ -248,17 +267,25 @@ def get_info(name, version):
if name == 'debian_repository_signing_fingerprint':
return PGP_KEYS['debian_repository_signing']
if name == 'release_signing_key':
fingerprint = PGP_KEYS['release_signing']
with open(media_path_join('pgp', fingerprint), 'rb') as _file:
filename = PGP_KEYS['release_signing']
with open(media_path_join('pgp', filename), 'rb') as _file:
return _file.read()
if name == 'release_signing_key_asc':
filename = PGP_KEYS['release_signing'] + '.asc'
with open(media_path_join('pgp', filename), 'r', encoding='utf-8') as _file:
return _file.read()
if name == 'debian_repository_signing_key':
fingerprint = PGP_KEYS['debian_repository_signing']
with open(media_path_join('pgp', fingerprint), 'rb') as _file:
filename = PGP_KEYS['debian_repository_signing']
with open(media_path_join('pgp', filename), 'rb') as _file:
return _file.read()
if name == 'debian_repository_signing_key_asc':
filename = PGP_KEYS['debian_repository_signing'] + '.asc'
with open(media_path_join('pgp', filename), 'r', encoding='utf-8') as _file:
return _file.read()
if name == 'all':
infos = []
for key in INFO_KEYS:
if key[0] != name and key[0] not in BINARY_INFO_KEYS:
if key[0] != name and key[0] not in INFO_PGP_KEYS:
infos.append(f'{key[0]}:{get_info(key[0], version)}')
return '\n'.join(infos)
return ''
Expand All @@ -283,11 +310,17 @@ def info(request, name=None):
},
)
if name:
if name in BINARY_INFO_KEYS:
if name in INFO_PGP_KEYS_BIN:
response = HttpResponse(get_info(name, version),
content_type='application/octet-stream')
response['Content-Disposition'] = (
f'attachment; filename="weechat_{name}.pgp"')
filename = f'weechat_{name}.pgp'
response['Content-Disposition'] = f'attachment; filename="{filename}"'
return response
if name in INFO_PGP_KEYS_ASC:
response = HttpResponse(get_info(name, version),
content_type='text/plain')
filename = f'weechat_{name.replace("_asc", "")}.pgp.asc'
response['Content-Disposition'] = f'attachment; filename="{filename}"'
return response
return render(
request,
Expand All @@ -299,8 +332,8 @@ def info(request, name=None):
)
infos = []
for oneinfo in INFO_KEYS:
if oneinfo[0] in BINARY_INFO_KEYS:
value = gettext('(binary data)')
if oneinfo[0] in INFO_PGP_KEYS:
value = gettext('(file)')
else:
value = get_info(oneinfo[0], version)
if oneinfo[0].endswith('_number'):
Expand Down
Loading

0 comments on commit a7f2247

Please sign in to comment.