mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2026-10-22 06:12:35 +00:00
Security tokens: reject unsupported paths when resolving keyfiles
Token::getTokenKeyfile returned null for a path that is neither a PKCS#11 nor an EMV token path, and every caller dereferenced the result. Keyfile application validates the path beforehand, but the text-mode export does not, so entering an ordinary file path at the --export-token-keyfile prompt crashed VeraCrypt. Throw InvalidSecurityTokenKeyfilePath instead, which the user interfaces already report.
This commit is contained in:
@@ -109,6 +109,10 @@ namespace VeraCrypt
|
||||
}
|
||||
}
|
||||
|
||||
// Callers use the keyfile directly, so any other path is an error.
|
||||
if (!tokenKeyfile)
|
||||
throw InvalidSecurityTokenKeyfilePath();
|
||||
|
||||
return tokenKeyfile;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user