shardeum / validator-cli

MIT License
20 stars 9 forks source link

gui login throws unhandled exception when password argument does not match length of hashed gui password #20

Open chrypnotoad opened 2 months ago

chrypnotoad commented 2 months ago

https://github.com/shardeum/validator-cli/blob/87ca9fa104cad917432d1ae2406c3356d95c4551/src/gui-commands.ts#L150

$ operator-cli gui login a                                                               
/home/node/app/cli/build/src/gui-commands.js:154
        if (!(0, crypto_1.timingSafeEqual)(Buffer.from(password), Buffer.from(config.gui.pass))) {
                                          ^

RangeError: Input buffers must have the same byte length
    at Command.<anonymous> (/home/node/app/cli/build/src/gui-commands.js:154:43)
    at Command.listener [as _actionHandler] (/home/node/app/cli/node_modules/commander/lib/command.js:482:17)
    at /home/node/app/cli/node_modules/commander/lib/command.js:1283:65
    at Command._chainOrCall (/home/node/app/cli/node_modules/commander/lib/command.js:1177:12)
    at Command._parseCommand (/home/node/app/cli/node_modules/commander/lib/command.js:1283:27)
    at /home/node/app/cli/node_modules/commander/lib/command.js:1081:27
    at Command._chainOrCall (/home/node/app/cli/node_modules/commander/lib/command.js:1177:12)
    at Command._dispatchSubcommand (/home/node/app/cli/node_modules/commander/lib/command.js:1077:23)
    at Command._parseCommand (/home/node/app/cli/node_modules/commander/lib/command.js:1248:19)
    at /home/node/app/cli/node_modules/commander/lib/command.js:1081:27 {
  code: 'ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH'
}

Node.js v18.16.1