allow colons in ssh key comments and adjust ssh key whitespace handling

This commit is contained in:
2021-05-12 11:48:55 -05:00
parent 46a691b876
commit 71db4b3333
3 changed files with 7 additions and 7 deletions

View File

@ -320,9 +320,9 @@ def ssh_public_keys():
if not content or len(content.strip()) < 1:
errors.append("Content is required")
else:
content = content.replace("\r", "").replace("\n", "")
if not re.match(r"^(ssh|ecdsa)-[0-9A-Za-z+/_=@. -]+$", content):
errors.append("Content must match \"^(ssh|ecdsa)-[0-9A-Za-z+/_=@. -]+$\"")
content = content.replace("\r", " ").replace("\n", " ").strip()
if not re.match(r"^(ssh|ecdsa)-[0-9A-Za-z+/_=@:. -]+$", content):
errors.append("Content must match \"^(ssh|ecdsa)-[0-9A-Za-z+/_=@:. -]+$\"")
if get_model().ssh_public_key_name_exists(session["account"], name):
errors.append("A key with that name already exists")