kaikramer / keystore-explorer

KeyStore Explorer is a free GUI replacement for the Java command-line utilities keytool and jarsigner.
https://keystore-explorer.org/
GNU General Public License v3.0
1.7k stars 275 forks source link

manually entered rsa key size is ignored #215

Open james-k-polk opened 4 years ago

james-k-polk commented 4 years ago

I am using 5.4.3 on Mac OS. When I choose to generate a new RSA keypair I am presented with a small dialog with a suggested key size in bits. If I use the little up arrow or down arrow to change the key size then it all works correctly. However, if I just type the keysize into the textbox and click OK the number I typed in is ignored. Instead, the value that was there previously is used. However however, if I enter the keysize manually and then press return the new value seems to captured and all works correctly.

Perhaps this is intended behavior but it was a little surprising.

kaikramer commented 4 years ago

It depends on the entered value if this behavior is intended or not. What KSE does is to check the input value against a rule for the respective key type. For RSA keys allowed key sizes range from 512 to 16384 bit in 8 bit steps. If the entered value does not match one of the allowed values, then the value is adjusted to the next allowed value. For example a value of 2047 is changed by KSE to 2048.

If the value you have entered is among the allowed ones, then this is a bug. On Windows this does not happen, but it still might be a bug specific to macOS. Swing often behaves differently on the different platforms.

thephoen commented 4 years ago

It depends on the entered value if this behavior is intended or not. What KSE does is to check the input value against a rule for the respective key type. For RSA keys allowed key sizes range from 512 to 16384 bit in 8 bit steps. If the entered value does not match one of the allowed values, then the value is adjusted to the next allowed value. For example a value of 2047 is changed by KSE to 2048.

If the value you have entered is among the allowed ones, then this is a bug. On Windows this does not happen, but it still might be a bug specific to macOS. Swing often behaves differently on the different platforms.

I only tried it with two values, 1024 and 2048, so perhaps it is a bug.

kaikramer commented 4 years ago

Not sure if I can do something about it. Do you also have this issue?: https://github.com/kaikramer/keystore-explorer/issues/171

james-k-polk commented 4 years ago

Not sure if I can do something about it.

No problem, since the workaround is simply to press return or use the arrows it's hardly a major problem.

Do you also have this issue?: #171

No, I don't have any problem selecting different extensions.