File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/test/java/com/rabbitmq/client Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1717
1818import java .security .KeyStore ;
1919import java .security .cert .X509Certificate ;
20+ import java .util .Collections ;
2021import java .util .List ;
2122import java .util .Optional ;
2223import org .junit .jupiter .api .Test ;
@@ -104,7 +105,11 @@ void testNullPrivateKeyContent() {
104105 @ Test
105106 void testRedosResilienceLongDashString () {
106107 String dosPayload =
107- "-----BEGIN " + "-" .repeat (1000 ) + "-----\n " + "data\n " + "-----END CERTIFICATE-----" ;
108+ "-----BEGIN "
109+ + String .join ("" , Collections .nCopies (1000 , "-" ))
110+ + "-----\n "
111+ + "data\n "
112+ + "-----END CERTIFICATE-----" ;
108113 long startTime = System .nanoTime ();
109114 try {
110115 PemReader .readCertificateChain (dosPayload );
@@ -118,7 +123,7 @@ void testRedosResilienceLongDashString() {
118123 void testRedosResilienceRepeatedPattern () {
119124 String dosPayload =
120125 "-----BEGIN "
121- + "CERTIFICATE " . repeat (100 )
126+ + String . join ( "" , Collections . nCopies (100 , "CERTIFICATE " ) )
122127 + "-----\n data\n -----END CERTIFICATE-----" ;
123128 long startTime = System .nanoTime ();
124129 try {
You can’t perform that action at this time.
0 commit comments