Skip to content

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

@chrypnotoad

Description

@chrypnotoad
  • sending any input that does not match the length of the hashed password will cause the exception
  • operator-cli gui login is currently only used by the gui which sends the hashed password.
  • the --help text for this should be updated to indicate it expects a hashed password

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions