Accept smaller key files

I can generate a valid key file for my Mosquitto setup that fails the minimum size check of 128, for example this kind of key:

-----BEGIN PRIVATE KEY-----
MC4CAQAwBQYDK2VwBCIEIFXWXY9yVJRKhZRfLz/oaAcjmOzX/2El+QRU+/1Npyfe
-----END PRIVATE KEY-----
This commit is contained in:
Pawel Defée
2021-06-30 08:43:49 +03:00
committed by Thomas Nordquist
parent 9cdfa2de7b
commit e4add31793

View File

@@ -83,7 +83,7 @@ async function openCertificate(): Promise<CertificateParameters> {
}
const data = await fsPromise.readFile(selectedFile)
if (data.length > 16_384 || data.length < 128) {
if (data.length > 16_384 || data.length < 64) {
throw rejectReasons.certificateSizeDoesNotMatch
}