mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
sso: Upgrade crypto
- using latest version of lib-apache2-mod-authpubtkt - upgraded keys to 4096-bit RSA - upgraded hashing algorithm to sha512 Plinth needs dependency on libapache2-mod-auth-pubtkt >= 0.11 Signed-off-by: Joseph Nuthalpati <njoseph@thoughtworks.com> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
1 parent
0a6e45f1cc
commit
f9166f8e98
2 files changed
+3
-5
No files matched your search
+2
-4
@@ -66,8 +66,7 @@ def subcommand_create_key_pair(_):
|
||||
for key_file in [public_key_file, private_key_file]
|
||||
]):
|
||||
pkey = crypto.PKey()
|
||||
# XXX: Use RSA when available in mod-auth-pubtkt.
|
||||
pkey.generate_key(crypto.TYPE_DSA, 1024)
|
||||
pkey.generate_key(crypto.TYPE_RSA, 4096)
|
||||
|
||||
with open(private_key_file, 'w') as priv_key_file:
|
||||
priv_key = crypto.dump_privatekey(crypto.FILETYPE_PEM,
|
||||
@@ -102,8 +101,7 @@ def create_ticket(pkey, uid, validuntil, ip=None, tokens=None,
|
||||
|
||||
def sign(pkey, data):
|
||||
"""Calculates and returns ticket's signature."""
|
||||
# XXX: Use SHA256 when available in mod-auth-pubtkt.
|
||||
sig = crypto.sign(pkey, data, 'sha1')
|
||||
sig = crypto.sign(pkey, data, 'sha512')
|
||||
return base64.b64encode(sig).decode()
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user