mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 14:24:46 +02:00
8296742: Illegal X509 Extension should not be created
Reviewed-by: mullan
This commit is contained in:
parent
a6c418eaf8
commit
e174558cad
28 changed files with 303 additions and 92 deletions
|
@ -1582,7 +1582,11 @@ public final class Main {
|
|||
int d = id.indexOf(':');
|
||||
if (d >= 0) {
|
||||
CRLExtensions ext = new CRLExtensions();
|
||||
ext.setExtension("Reason", new CRLReasonCodeExtension(Integer.parseInt(id.substring(d+1))));
|
||||
int code = Integer.parseInt(id.substring(d+1));
|
||||
if (code <= 0) {
|
||||
throw new Exception("Reason code must be positive");
|
||||
}
|
||||
ext.setExtension("Reason", new CRLReasonCodeExtension(code));
|
||||
badCerts[i] = new X509CRLEntryImpl(new BigInteger(id.substring(0, d)),
|
||||
firstDate, ext);
|
||||
} else {
|
||||
|
@ -4632,6 +4636,9 @@ public final class Main {
|
|||
continue;
|
||||
}
|
||||
int exttype = oneOf(name, extSupported);
|
||||
if (exttype != -1 && value != null && value.isEmpty()) {
|
||||
throw new Exception(rb.getString("Illegal.value.") + extstr);
|
||||
}
|
||||
switch (exttype) {
|
||||
case 0: // BC
|
||||
int pathLen = -1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue