-
Bug
-
Resolution: Fixed
-
P3
-
8u151, 9.0.1
-
b32
-
Not verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8191716 | 9.0.6 | Robert Mckenna | P3 | Resolved | Fixed | master |
JDK-8191207 | 9.0.4 | Robert Mckenna | P3 | Resolved | Fixed | b08 |
JDK-8197379 | 8u192 | Robert Mckenna | P3 | Resolved | Fixed | b01 |
JDK-8195548 | 8u172 | Robert Mckenna | P3 | Resolved | Fixed | b03 |
JDK-8191718 | 8u171 | Robert Mckenna | P3 | Resolved | Fixed | b01 |
JDK-8192769 | 8u162 | Robert Mckenna | P3 | Resolved | Fixed | b09 |
JDK-8191208 | 8u161 | Robert Mckenna | P3 | Resolved | Fixed | b09 |
JDK-8198162 | emb-8u171 | Robert Mckenna | P3 | Resolved | Fixed | b01 |
JDK-8194211 | emb-8u161 | Robert Mckenna | P3 | Resolved | Fixed | b09 |
JDK-8191720 | 7u181 | Robert Mckenna | P3 | Resolved | Fixed | b01 |
JDK-8191209 | 7u171 | Robert Mckenna | P3 | Resolved | Fixed | b09 |
JDK-8194032 | openjdk7u | Weijun Wang | P3 | Resolved | Fixed | master |
private String withWeak(PublicKey key) {
if (DISABLED_CHECK.permits(SIG_PRIMITIVE_SET, key)) {
return String.format(rb.getString("key.bit"),
KeyUtil.getKeySize(key), key.getAlgorithm());
} else {
return String.format(rb.getString("key.bit.weak"),
KeyUtil.getKeySize(key), key.getAlgorithm());
}
}
That is the format is determined by rb.getString("key.bit.weak") or rb.getString("key.bit"). For example for -Duser.language=en, these formats are:
%d-bit %s key
and
%d-bit %s key (weak)
Thus, in English this expects an integer as first argument and a String as the second. In some languages however, the formats returned by rb.getString("key.bit.weak") and rb.getString("key.bit") return different format strings: E.g. String and then Integer in French or Spanish.
Attached is a simple reproducer. It fails with -Duser.language=es with:
$ javac TestKeyTool
$ java -Duser.language=es TestKeyTool
DEBUG: Format is: Clave %s de %d bits (débil)
Exception in thread "main" java.util.IllegalFormatConversionException: d != java.lang.String
at java.util.Formatter$FormatSpecifier.failConversion(Formatter.java:4302)
at java.util.Formatter$FormatSpecifier.printInteger(Formatter.java:2793)
at java.util.Formatter$FormatSpecifier.print(Formatter.java:2747)
at java.util.Formatter.format(Formatter.java:2520)
at java.util.Formatter.format(Formatter.java:2455)
at java.lang.String.format(String.java:2940)
at TestKeyTool.main(TestKeyTool.java:11)
Expected:
Ordering of format is the same as in English: Integer then String. For example in English the reproducer prints:
$ java -Duser.language=en TestKeyTool
DEBUG: Format is: %d-bit %s key (weak)
23-bit foo key (weak)
DEBUG: Format is: %d-bit %s key
23-bit foo key
- backported by
-
JDK-8191207 keytool fails to format resource strings for keys for some languages after JDK-8171319
- Resolved
-
JDK-8191208 keytool fails to format resource strings for keys for some languages after JDK-8171319
- Resolved
-
JDK-8191209 keytool fails to format resource strings for keys for some languages after JDK-8171319
- Resolved
-
JDK-8191716 keytool fails to format resource strings for keys for some languages after JDK-8171319
- Resolved
-
JDK-8191718 keytool fails to format resource strings for keys for some languages after JDK-8171319
- Resolved
-
JDK-8191720 keytool fails to format resource strings for keys for some languages after JDK-8171319
- Resolved
-
JDK-8192769 keytool fails to format resource strings for keys for some languages after JDK-8171319
- Resolved
-
JDK-8194032 keytool fails to format resource strings for keys for some languages after JDK-8171319
- Resolved
-
JDK-8194211 keytool fails to format resource strings for keys for some languages after JDK-8171319
- Resolved
-
JDK-8195548 keytool fails to format resource strings for keys for some languages after JDK-8171319
- Resolved
-
JDK-8197379 keytool fails to format resource strings for keys for some languages after JDK-8171319
- Resolved
-
JDK-8198162 keytool fails to format resource strings for keys for some languages after JDK-8171319
- Resolved
- blocks
-
JDK-8191840 Update localizations with positional arguments following JDK-8191137
- Resolved
- duplicates
-
JDK-8191181 keytool, wrong localisation prevents import cert
- Closed
- relates to
-
JDK-8171319 keytool should print out warnings when reading or generating cert/cert req using weak algorithms
- Closed