Ticket #6607: 6607.patch

File 6607.patch, 1.5 KB (added by Saurabh, 9 years ago)
  • twisted/conch/scripts/ckeygen.py

     
    102102def printFingerprint(options):
    103103    if not options['filename']:
    104104        filename = os.path.expanduser('~/.ssh/id_rsa')
    105         options['filename'] = raw_input('Enter file in which the key is (%s): ' % filename)
     105        options['filename'] = raw_input('Enter file in which the key is (%s): ' % filename).strip() or filename
    106106    if os.path.exists(options['filename']+'.pub'):
    107107        options['filename'] += '.pub'
    108108    try:
     
    122122    if not options['filename']:
    123123        filename = os.path.expanduser('~/.ssh/id_rsa')
    124124        options['filename'] = raw_input(
    125             'Enter file in which the key is (%s): ' % filename)
     125            'Enter file in which the key is (%s): ' % filename).strip() or filename
    126126    try:
    127127        key = keys.Key.fromFile(options['filename']).keyObject
    128128    except keys.EncryptedKeyError as e:
     
    171171def displayPublicKey(options):
    172172    if not options['filename']:
    173173        filename = os.path.expanduser('~/.ssh/id_rsa')
    174         options['filename'] = raw_input('Enter file in which the key is (%s): ' % filename)
     174        options['filename'] = raw_input('Enter file in which the key is (%s): ' % filename).strip() or filename
    175175    try:
    176176        key = keys.Key.fromFile(options['filename']).keyObject
    177177    except keys.EncryptedKeyError: