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:
Mounir IDRASSI
2026-10-15 07:57:07 +02:00
parent bd8e6a70aa
commit 86f6084b50
+4
View File
@@ -109,6 +109,10 @@ namespace VeraCrypt
}
}
// Callers use the keyfile directly, so any other path is an error.
if (!tokenKeyfile)
throw InvalidSecurityTokenKeyfilePath();
return tokenKeyfile;
}
}