mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8258915: Temporary buffer cleanup
Reviewed-by: valeriep
This commit is contained in:
parent
31d8a19e47
commit
f834557ae0
79 changed files with 1517 additions and 1039 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2006, 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
|
||||
|
@ -25,6 +25,8 @@
|
|||
|
||||
package sun.security.util;
|
||||
|
||||
import jdk.internal.access.SharedSecrets;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.math.BigInteger;
|
||||
import java.security.*;
|
||||
|
@ -122,8 +124,11 @@ public final class ECUtil {
|
|||
throws InvalidKeySpecException {
|
||||
KeyFactory keyFactory = getKeyFactory();
|
||||
PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(encoded);
|
||||
|
||||
return (ECPrivateKey)keyFactory.generatePrivate(keySpec);
|
||||
try {
|
||||
return (ECPrivateKey) keyFactory.generatePrivate(keySpec);
|
||||
} finally {
|
||||
SharedSecrets.getJavaSecuritySpecAccess().clearEncodedKeySpec(keySpec);
|
||||
}
|
||||
}
|
||||
|
||||
public static ECPrivateKey generateECPrivateKey(BigInteger s,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue