Open pki-bot opened 4 years ago
Comment from edewata (@edewata) at 2012-05-22 18:44:22
The problem only happens with large serial number such as "12512514865863765114". In CertManagementDialog?.java:368 the console tries to parse the serial number that it receives from the server as an integer:
try {
if (serial != null) {
String hexserial = Integer.toHexString(Integer.parseInt(serial));
name = name + "Serial:0x"+hexserial;
}
} catch (Exception e) {}
If the serial number is outside the integer range the parseInt() throws a number format exception, so the serial number is not added to the string that's going to be read by line 334 above, causing the original problem. Also, the exception is swallowed by the code, so the problem is undetected until you try to remove a certificate.
So the integer parsing should be replaced with BigInteger (or SerialNumber class) and the exception should be handled properly (e.g. generating error dialog).
Comment from edewata (@edewata) at 2017-02-27 14:10:06
Metadata Update from @edewata:
This issue was migrated from Pagure Issue #181. Originally filed by edewata (@edewata) on 2012-05-22 17:36:55:
Console generates the following exception when removing a user certificate:
It looks like in CertManagementDialog.java:334 the code is trying to get the serial number from a string but the string doesn't have it.