Skip to content

Commit

Permalink
Make regex ungreedy
Browse files Browse the repository at this point in the history
  • Loading branch information
KostasTsiounis committed Jan 14, 2025
1 parent dbd4d2f commit 1565dd7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1496,7 +1496,7 @@ private void setConstraints(String providerName, String providerInfo, boolean pr
final String typeRE = "\\w+";
final String algoRE = "[A-Za-z0-9./_-]+";
final String attrRE = "[A-Za-z0-9=*|.:]+";
final String consRE = "\\{(" + typeRE + "),(" + algoRE + "),(" + attrRE + ")(,\\S+)*\\}";
final String consRE = "\\{(" + typeRE + "),(" + algoRE + "),(" + attrRE + ")(,\\S+)*?\\}";
p = Pattern.compile(
"\\["
+ "([+-]?)" // option to append or remove
Expand Down Expand Up @@ -1808,7 +1808,7 @@ private static void checkProviderFormat(String providerInfo, boolean update) {
+ "(\\[" // constraints [optional]
+ "\\s*"
+ "([+-])?" // action [optional]
+ "[A-Za-z0-9{}.=*|:,/\\\\_\\s-]+" // constraint definition
+ "[A-Za-z0-9{}.=*|:?,/\\\\_\\s-]+" // constraint definition
+ "\\])?"
+ "\\s*"
+ "$");
Expand Down
2 changes: 1 addition & 1 deletion src/java.base/share/conf/security/java.security
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ RestrictedSecurity.OpenJCEPlusFIPS.FIPS140-3.jce.provider.1 = com.ibm.crypto.plu
{KeyGenerator, SunTlsMasterSecret, *}, \
{KeyGenerator, SunTlsPrf, *}, \
{KeyGenerator, SunTlsRsaPremasterSecret, *}, \
{KeyPairGenerator, EC, *, \\S*StackConstraints\\S*}, \
{KeyPairGenerator, EC, *, \\S*?StackConstraints\\S*?}, \
{KeyPairGenerator, RSA, *}, \
{KeyPairGenerator, RSAPSS, *}, \
{Mac, HmacSHA224, *}, \
Expand Down

0 comments on commit 1565dd7

Please sign in to comment.