Source valid ssh prefixes from config

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
This commit is contained in:
Steven Guikal 2021-06-10 14:46:24 -04:00 committed by Eli Schwartz
parent f9f41dc99b
commit a625df07e2
No known key found for this signature in database
GPG key ID: CEB167EFB5722BD6

View file

@ -875,10 +875,7 @@ function valid_pgp_fingerprint($fingerprint) {
* @return bool True if the SSH public key is valid, otherwise false
*/
function valid_ssh_pubkey($pubkey) {
$valid_prefixes = array(
"ssh-rsa", "ssh-dss", "ecdsa-sha2-nistp256",
"ecdsa-sha2-nistp384", "ecdsa-sha2-nistp521", "ssh-ed25519"
);
$valid_prefixes = explode(' ', config_get('auth', 'valid-keytypes'));
$has_valid_prefix = false;
foreach ($valid_prefixes as $prefix) {