-
-
Notifications
You must be signed in to change notification settings - Fork 116
Closed
Description
Describe the bug
Console tools key:generate:rsa
are broken because they expect a string to be an int:
jwt-framework/src/Component/Console/RsaKeyGeneratorCommand.php
Lines 36 to 40 in 95e1a3b
$size = $input->getArgument('size'); | |
$args = $this->getOptions($input); | |
if (!\is_int($size)) { | |
throw new InvalidArgumentException('Invalid size'); | |
} |
These lines are an impossible situation, as input values in command line are always strings. The correct check might be:
if (!is_int($size) && !ctype_digit($size)) {
// throw exception
}
To Reproduce
./jose.phar key:generate:rsa 2048
In RsaKeyGeneratorCommand.php line 39:
Invalid size
key:generate:rsa [-u|--use [USE]] [-a|--alg [ALG]] [--random_id] [--] <size>
Expected behavior
A RSA key is generated.
Metadata
Metadata
Assignees
Labels
No labels