Properly escape passwords and ssids

This commit is contained in:
mmcwilliams 2019-10-31 01:16:01 -04:00
parent 69ccdc58c1
commit 839ff97f5a
1 changed files with 1 additions and 1 deletions

View File

@ -160,7 +160,7 @@ class Wifi {
* @param {function} callback Function called after psk hash is generated
*/
createPSK (ssid, pwd, callback) {
const cmd = `wpa_passphrase "${ssid}" "${pwd}" | grep "psk="`
const cmd = `wpa_passphrase '${ssid.replace(/'/g, `'\\''`)}' '${pwd.replace(/'/g, `'\\''`)}' | grep "psk="`
let lines
let hash
let plaintext