Properly escape passwords and ssids
This commit is contained in:
parent
69ccdc58c1
commit
839ff97f5a
|
@ -160,7 +160,7 @@ class Wifi {
|
||||||
* @param {function} callback Function called after psk hash is generated
|
* @param {function} callback Function called after psk hash is generated
|
||||||
*/
|
*/
|
||||||
createPSK (ssid, pwd, callback) {
|
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 lines
|
||||||
let hash
|
let hash
|
||||||
let plaintext
|
let plaintext
|
||||||
|
|
Loading…
Reference in New Issue