8246383: NullPointerException in JceSecurity.getVerificationResult when using Entrust provider

Removed the static SecureRandom object in JceSecurity whose instantion caused NPE

Reviewed-by: xuelei
This commit is contained in:
Valerie Peng 2020-08-21 03:09:42 +00:00
parent b2da6e1a90
commit 03f2ab325d
5 changed files with 15 additions and 17 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2020, 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
@ -446,7 +446,7 @@ public class KeyAgreement {
* has an incompatible algorithm type.
*/
public final void init(Key key) throws InvalidKeyException {
init(key, JceSecurity.RANDOM);
init(key, JCAUtil.getSecureRandom());
}
/**
@ -514,7 +514,7 @@ public class KeyAgreement {
public final void init(Key key, AlgorithmParameterSpec params)
throws InvalidKeyException, InvalidAlgorithmParameterException
{
init(key, params, JceSecurity.RANDOM);
init(key, params, JCAUtil.getSecureRandom());
}
private String getProviderName() {