fix(fastapi): check ssh key prefixes against configured valid-keytypes

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2021-11-24 21:28:49 -08:00
parent 1aab960401
commit e558e979ff
No known key found for this signature in database
GPG key ID: F7E46DED420788F3

View file

@ -84,9 +84,8 @@ def valid_pgp_fingerprint(fp):
def valid_ssh_pubkey(pk):
valid_prefixes = ("ssh-rsa", "ecdsa-sha2-nistp256",
"ecdsa-sha2-nistp384", "ecdsa-sha2-nistp521",
"ssh-ed25519")
valid_prefixes = aurweb.config.get("auth", "valid-keytypes")
valid_prefixes = set(valid_prefixes.split(" "))
has_valid_prefix = False
for prefix in valid_prefixes: