mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +00:00
sso: Add comments to mark needed crypto upgrades.
This commit is contained in:
parent
995365f3df
commit
70c06ec9c1
@ -66,6 +66,7 @@ def subcommand_create_key_pair(_):
|
|||||||
for key_file in [public_key_file, private_key_file]
|
for key_file in [public_key_file, private_key_file]
|
||||||
]):
|
]):
|
||||||
pkey = crypto.PKey()
|
pkey = crypto.PKey()
|
||||||
|
# XXX: Use RSA when available in mod-auth-pubtkt.
|
||||||
pkey.generate_key(crypto.TYPE_DSA, 1024)
|
pkey.generate_key(crypto.TYPE_DSA, 1024)
|
||||||
|
|
||||||
with open(private_key_file, 'w') as priv_key_file:
|
with open(private_key_file, 'w') as priv_key_file:
|
||||||
@ -101,6 +102,7 @@ def create_ticket(pkey, uid, validuntil, ip=None, tokens=None,
|
|||||||
|
|
||||||
def sign(pkey, data):
|
def sign(pkey, data):
|
||||||
"""Calculates and returns ticket's signature."""
|
"""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, 'sha1')
|
||||||
return base64.b64encode(sig).decode()
|
return base64.b64encode(sig).decode()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user