mirror of
https://github.com/romanz/amodem.git
synced 2026-04-02 01:36:49 +08:00
proto: don't hardcode name length
This commit is contained in:
@@ -80,7 +80,7 @@ def _serialize_ed25519(vk):
|
||||
def _compute_keygrip(params):
|
||||
parts = []
|
||||
for name, value in params:
|
||||
exp = '1:{}{}:'.format(name, len(value))
|
||||
exp = '{}:{}{}:'.format(len(name), name, len(value))
|
||||
parts.append(b'(' + exp.encode('ascii') + value + b')')
|
||||
|
||||
return hashlib.sha1(b''.join(parts)).digest()
|
||||
|
||||
Reference in New Issue
Block a user