Caused an exception when somebody tried to upload an SSH key where the
*key type* contains non-ascii (this would normally be things like
"ssh-rsa", and there are definitely no legit key types outside the ascii
range, but we still shouldn't crash)
if pieces[0] == 'ssh-dss':
raise ValidationError("For security reasons, ssh-dss keys are not supported")
if pieces[0] not in _valid_keytypes:
- raise ValidationError("Only keys of types {0} are supported, not {1}.".format(", ".join(_valid_keytypes), pieces[0]))
+ raise ValidationError(u"Only keys of types {0} are supported, not {1}.".format(", ".join(_valid_keytypes), pieces[0]))
try:
base64.b64decode(pieces[1])
except: