-
Notifications
You must be signed in to change notification settings - Fork 99
Open
Description
Caracal/handlers/authHandlers.js
Lines 31 to 61 in 91fec6d
| try { | |
| const prikeyPath = './keys/key'; | |
| if (fs.existsSync(prikeyPath)) { | |
| PRIKEY = fs.readFileSync(prikeyPath, 'utf8'); | |
| } else { | |
| if (DISABLE_SEC || ENABLE_SECURITY_AT && Date.parse(ENABLE_SECURITY_AT) > Date.now()) { | |
| PRIKEY = ''; | |
| console.warn('prikey null since DISABLE_SEC and no prikey provided'); | |
| } else { | |
| console.error('prikey does not exist'); | |
| } | |
| } | |
| } catch (err) { | |
| console.error(err); | |
| } | |
| try { | |
| const pubkeyPath = './keys/key.pub'; | |
| if (fs.existsSync(pubkeyPath)) { | |
| var PUBKEY = fs.readFileSync(pubkeyPath, 'utf8'); | |
| } else { | |
| if (DISABLE_SEC || ENABLE_SECURITY_AT && Date.parse(ENABLE_SECURITY_AT) > Date.now()) { | |
| PUBKEY = ''; | |
| console.warn('pubkey null since DISABLE_SEC and no pubkey provided'); | |
| } else { | |
| console.error('pubkey does not exist'); | |
| } | |
| } | |
| } catch (err) { | |
| console.error(err); | |
| } |
The code block on line 40 and 56 are triggered when DISABLE_SEC || ENABLE_SECURITY_AT && Date.parse(ENABLE_SECURITY_AT) > Date.now() turns false. This has no relation to the files being present or not, whereas the block logs out a message saying XXX does not exist
Metadata
Metadata
Assignees
Labels
No labels