8260274: Cipher.init(int, key) does not use highest priority provider for random bytes

Reviewed-by: ascarpino, xuelei
This commit is contained in:
Valerie Peng 2021-03-18 23:23:19 +00:00
parent 6aa28b3bdb
commit 434a399bea
8 changed files with 243 additions and 19 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2019, 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
@ -373,7 +373,7 @@ public abstract class KeyPairGenerator extends KeyPairGeneratorSpi {
* supported by this KeyPairGenerator object.
*/
public void initialize(int keysize) {
initialize(keysize, JCAUtil.getSecureRandom());
initialize(keysize, JCAUtil.getDefSecureRandom());
}
/**
@ -433,7 +433,7 @@ public abstract class KeyPairGenerator extends KeyPairGeneratorSpi {
*/
public void initialize(AlgorithmParameterSpec params)
throws InvalidAlgorithmParameterException {
initialize(params, JCAUtil.getSecureRandom());
initialize(params, JCAUtil.getDefSecureRandom());
}
/**