mirror of
https://github.com/romanz/amodem.git
synced 2026-03-20 09:29:31 +08:00
Allow unicode in identity string for SSH and GPG
This commit is contained in:
@@ -188,7 +188,7 @@ def main(device_type):
|
||||
public_keys = None
|
||||
if args.identity.startswith('/'):
|
||||
filename = args.identity
|
||||
contents = open(filename, 'rb').read().decode('ascii')
|
||||
contents = open(filename, 'rb').read().decode('utf-8')
|
||||
# Allow loading previously exported SSH public keys
|
||||
if filename.endswith('.pub'):
|
||||
public_keys = list(import_public_keys(contents))
|
||||
|
||||
@@ -138,7 +138,7 @@ class Handler(object):
|
||||
else:
|
||||
raise KeyError('key not found')
|
||||
|
||||
label = key['name'].decode('ascii') # label should be a string
|
||||
label = key['name'].decode('utf-8')
|
||||
log.debug('signing %d-byte blob with "%s" key', len(blob), label)
|
||||
try:
|
||||
signature = self.conn.sign(blob=blob, identity=key['identity'])
|
||||
|
||||
Reference in New Issue
Block a user