Improve private key detection
This commit is contained in:
parent
ea7df30aa7
commit
436a4ca4d1
1 changed files with 1 additions and 1 deletions
|
|
@ -16,7 +16,7 @@ try {
|
||||||
const stats = fs.statSync(file);
|
const stats = fs.statSync(file);
|
||||||
if (stats.size < 1024*8 && stats.isFile()) {
|
if (stats.size < 1024*8 && stats.isFile()) {
|
||||||
const fileContents = fs.readFileSync(file, {'encoding': 'utf8'});
|
const fileContents = fs.readFileSync(file, {'encoding': 'utf8'});
|
||||||
if (fileContents.includes('-BEGIN RSA PRIVATE KEY-')) {
|
if (fileContents.includes('-BEGIN PRIVATE KEY-') || fileContents.includes('-BEGIN RSA PRIVATE KEY-')) {
|
||||||
privateKey = fs.readFileSync(file);
|
privateKey = fs.readFileSync(file);
|
||||||
}
|
}
|
||||||
if (fileContents.includes('widevine_cdm_version')) {
|
if (fileContents.includes('widevine_cdm_version')) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue