Skip to content
This repository has been archived by the owner on Aug 27, 2022. It is now read-only.

Commit

Permalink
8261472: BasicConstraintsExtension::toString shows "PathLen:214748364…
Browse files Browse the repository at this point in the history
…7" if there is no pathLenConstraint

Reviewed-by: jnimeh
  • Loading branch information
wangweij committed Feb 10, 2021
1 parent 699a3cd commit 4619f37
Showing 1 changed file with 10 additions and 3 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -171,10 +171,17 @@ public BasicConstraintsExtension(Boolean critical, Object value)
* Return user readable form of extension.
*/
public String toString() {
String pathLenAsString;
if (pathLen < 0) {
pathLenAsString = " undefined";
} else if (pathLen == Integer.MAX_VALUE) {
pathLenAsString = " no limit";
} else {
pathLenAsString = String.valueOf(pathLen);
}
return super.toString() +
"BasicConstraints:[\n CA:" + ca +
"\n PathLen:" +
((pathLen >= 0) ? String.valueOf(pathLen) : " undefined") +
"\n PathLen:" + pathLenAsString +
"\n]\n";
}

Expand Down

0 comments on commit 4619f37

Please sign in to comment.