also rearranged the regex groups to allow sk-ecdsa-sha2-...
note: FIDO keys are now parsable, the backend only supports it with
OpenSSH >= 8.2. This may be achieved with upgrading to PVE 7 or
using a back port.
parseSSHKey: function(key) {
// |--- options can have quotes--| type key comment
let keyre = /^(?:((?:[^\s"]|"(?:\\.|[^"\\])*")+)\s+)?(\S+)\s+(\S+)(?:\s+(.*))?$/;
- let typere = /^(?:(?:sk-)?ssh-(?:dss|rsa|ed25519)|ecdsa-sha2-nistp\d+)$/;
+ let typere = /^(?:(?:sk-)?(?:ssh-(?:dss|rsa|ed25519)|ecdsa-sha2-nistp\d+)(?:@(?:[a-z0-9_-]+\.)+[a-z]{2,})?)$/;
let m = key.match(keyre);
if (!m || m.length < 3 || !m[2]) { // [2] is always either type or key