@@ -300,35 +300,37 @@ static PerContext createPerContext(boolean isFipsContext, JcaTlsCrypto crypto,
300
300
return new PerContext (index , candidatesClient , candidatesServer );
301
301
}
302
302
303
- static String [] getJcaSignatureAlgorithms (Collection <SignatureSchemeInfo > infos )
303
+ private static String [] getJcaSignatureAlgorithms (Collection <SignatureSchemeInfo > infos )
304
304
{
305
305
if (null == infos )
306
306
{
307
307
return TlsUtils .EMPTY_STRINGS ;
308
308
}
309
309
310
- ArrayList <String > result = new ArrayList <String >();
310
+ String [] result = new String [infos .size ()];
311
+ int resultPos = 0 ;
311
312
for (SignatureSchemeInfo info : infos )
312
313
{
313
314
// TODO The two kinds of PSS signature scheme can give duplicates here
314
- result . add ( info .getJcaSignatureAlgorithm () );
315
+ result [ resultPos ++] = info .getJcaSignatureAlgorithm ();
315
316
}
316
- return result . toArray ( TlsUtils . EMPTY_STRINGS ) ;
317
+ return result ;
317
318
}
318
319
319
- static String [] getJcaSignatureAlgorithmsBC (Collection <SignatureSchemeInfo > infos )
320
+ private static String [] getJcaSignatureAlgorithmsBC (Collection <SignatureSchemeInfo > infos )
320
321
{
321
322
if (null == infos )
322
323
{
323
324
return TlsUtils .EMPTY_STRINGS ;
324
325
}
325
326
326
- ArrayList <String > result = new ArrayList <String >();
327
+ String [] result = new String [infos .size ()];
328
+ int resultPos = 0 ;
327
329
for (SignatureSchemeInfo info : infos )
328
330
{
329
- result . add ( info .getJcaSignatureAlgorithmBC () );
331
+ result [ resultPos ++] = info .getJcaSignatureAlgorithmBC ();
330
332
}
331
- return result . toArray ( TlsUtils . EMPTY_STRINGS ) ;
333
+ return result ;
332
334
}
333
335
334
336
static SignatureAndHashAlgorithm getSignatureAndHashAlgorithm (int signatureScheme )
@@ -341,7 +343,8 @@ static SignatureAndHashAlgorithm getSignatureAndHashAlgorithm(int signatureSchem
341
343
return SignatureScheme .getSignatureAndHashAlgorithm (signatureScheme );
342
344
}
343
345
344
- static Vector <SignatureAndHashAlgorithm > getSignatureAndHashAlgorithms (List <SignatureSchemeInfo > signatureSchemeInfos )
346
+ private static Vector <SignatureAndHashAlgorithm > getSignatureAndHashAlgorithms (
347
+ Collection <SignatureSchemeInfo > signatureSchemeInfos )
345
348
{
346
349
// TODO[tls13] Actually should return empty for empty?
347
350
if (null == signatureSchemeInfos || signatureSchemeInfos .isEmpty ())
0 commit comments