Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@
classpathref="classpath"
includeantruntime="false">
<compilerarg value="-Xlint:-options"/>
<compilerarg value="-Xlint:-path"/>
</javac>
Comment thread
cconlon marked this conversation as resolved.
</target>

Expand Down
2 changes: 1 addition & 1 deletion src/java/com/wolfssl/WolfCryptEccKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public byte[] getPrivateKeyPKCS8() {
return EccPrivateKeyToPKCS8(getEccKeyPtr());
}

@SuppressWarnings("deprecation")
@SuppressWarnings({"deprecation", "removal"})
@Override
protected void finalize() throws Throwable
{
Expand Down
2 changes: 1 addition & 1 deletion src/java/com/wolfssl/WolfSSL.java
Original file line number Diff line number Diff line change
Expand Up @@ -2024,7 +2024,7 @@ protected static int getNamedGroupFromString(String curveName) {
}
}

@SuppressWarnings("deprecation")
@SuppressWarnings({"deprecation", "removal"})
@Override
protected void finalize() throws Throwable
{
Expand Down
2 changes: 1 addition & 1 deletion src/java/com/wolfssl/WolfSSLCRL.java
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ public synchronized void free() {
}
}

@SuppressWarnings("deprecation")
@SuppressWarnings({"deprecation", "removal"})
@Override
protected void finalize() throws Throwable {
this.free();
Expand Down
2 changes: 1 addition & 1 deletion src/java/com/wolfssl/WolfSSLCertManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ public synchronized void free() throws IllegalStateException {
}
}

@SuppressWarnings("deprecation")
@SuppressWarnings({"deprecation", "removal"})
@Override
protected void finalize() throws Throwable
{
Expand Down
2 changes: 1 addition & 1 deletion src/java/com/wolfssl/WolfSSLCertRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ public synchronized void free() {
}
}

@SuppressWarnings("deprecation")
@SuppressWarnings({"deprecation", "removal"})
@Override
protected void finalize() throws Throwable
{
Expand Down
2 changes: 1 addition & 1 deletion src/java/com/wolfssl/WolfSSLCertificate.java
Original file line number Diff line number Diff line change
Expand Up @@ -2624,7 +2624,7 @@ public synchronized void free() {
}
}

@SuppressWarnings("deprecation")
@SuppressWarnings({"deprecation", "removal"})
@Override
protected void finalize() throws Throwable
{
Expand Down
2 changes: 1 addition & 1 deletion src/java/com/wolfssl/WolfSSLContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -2546,7 +2546,7 @@ WolfSSLDebug.INFO, getContextPtr(),
flushSessions(getContextPtr(), tm);
}

@SuppressWarnings("deprecation")
@SuppressWarnings({"deprecation", "removal"})
@Override
protected void finalize() throws Throwable
{
Expand Down
2 changes: 2 additions & 0 deletions src/java/com/wolfssl/WolfSSLDebug.java
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ public String format(LogRecord record) {
Level level = record.getLevel();
String levelStr = (level != null) ? level.toString() : "UNKNOWN";

@SuppressWarnings("deprecation")
long threadId = record.getThreadID();
String message = record.getMessage();
if (message == null) {
Expand All @@ -233,6 +234,7 @@ public String format(LogRecord record) {
* JSON formatter for wolfSSL logs
*/
private static class JSONFormatter extends Formatter {
@SuppressWarnings("deprecation")
@Override
public String format(LogRecord record) {
if (record == null) {
Expand Down
2 changes: 1 addition & 1 deletion src/java/com/wolfssl/WolfSSLNameConstraints.java
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public void free() {
}

@Override
@SuppressWarnings("deprecation")
@SuppressWarnings({"deprecation", "removal"})
protected void finalize() throws Throwable {
try {
free();
Expand Down
1 change: 1 addition & 0 deletions src/java/com/wolfssl/WolfSSLNativeLoggingCallback.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
*/
class WolfSSLNativeLoggingCallback implements WolfSSLLoggingCallback
{
@SuppressWarnings("deprecation")
public synchronized void loggingCallback(int logLevel, String logMessage) {

System.err.println(
Expand Down
2 changes: 1 addition & 1 deletion src/java/com/wolfssl/WolfSSLSession.java
Original file line number Diff line number Diff line change
Expand Up @@ -5910,7 +5910,7 @@ public synchronized long sessionFromDer(byte[] data)
}
}

@SuppressWarnings("deprecation")
@SuppressWarnings({"deprecation", "removal"})
@Override
protected void finalize() throws Throwable
{
Expand Down
2 changes: 1 addition & 1 deletion src/java/com/wolfssl/WolfSSLX509Name.java
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ public synchronized void free() {
}
}

@SuppressWarnings("deprecation")
@SuppressWarnings({"deprecation", "removal"})
@Override
protected void finalize() throws Throwable
{
Expand Down
2 changes: 1 addition & 1 deletion src/java/com/wolfssl/provider/jsse/WolfSSLAuthStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ protected boolean removeEldestEntry(Map.Entry<K, V> oldest) {
}
}

@SuppressWarnings("deprecation")
@SuppressWarnings({"deprecation", "removal"})
@Override
protected synchronized void finalize() throws Throwable {
/* Clear LinkedHashMap and set to null to allow
Expand Down
2 changes: 1 addition & 1 deletion src/java/com/wolfssl/provider/jsse/WolfSSLContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ protected com.wolfssl.WolfSSLContext getInternalWolfSSLContext() {
return this.ctx;
}

@SuppressWarnings("deprecation")
@SuppressWarnings({"deprecation", "removal"})
@Override
protected void finalize() throws Throwable {
if (this.ctx != null) {
Expand Down
2 changes: 1 addition & 1 deletion src/java/com/wolfssl/provider/jsse/WolfSSLEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -2806,7 +2806,7 @@ public int sessionTicketCallback(WolfSSLSession ssl, byte[] ticket,
}
}

@SuppressWarnings("deprecation")
@SuppressWarnings({"deprecation", "removal"})
@Override
protected synchronized void finalize() throws Throwable {
if (this.ssl != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1971,7 +1971,7 @@ protected synchronized void clearObjectState() {
this.authStore = null;
}

@SuppressWarnings("deprecation")
@SuppressWarnings({"deprecation", "removal"})
@Override
protected synchronized void finalize() throws Throwable {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,7 @@ public Certificate[] getLocalCertificates() {
return km.getCertificateChain(authStore.getCertAlias());
}

@SuppressWarnings("removal")
@Override
public synchronized javax.security.cert.X509Certificate[]
getPeerCertificateChain() throws SSLPeerUnverifiedException {
Expand Down Expand Up @@ -1181,7 +1182,7 @@ public synchronized List<SNIServerName> getRequestedServerNames()
return Collections.emptyList();
}

@SuppressWarnings("deprecation")
@SuppressWarnings({"deprecation", "removal"})
@Override
protected synchronized void finalize() throws Throwable
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ else if (eng != null) {
* SSL/TLS handshake should continue. Otherwise return 0
* to mark verification failure and stop/abort handshake.
*/
@SuppressWarnings("deprecation")
public int verifyCallback(int preverify_ok, long x509StorePtr) {

WolfSSLCertificate[] certs = null;
Expand Down
10 changes: 7 additions & 3 deletions src/java/com/wolfssl/provider/jsse/WolfSSLKeyX509.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
package com.wolfssl.provider.jsse;

import java.net.Socket;
import java.security.AccessController;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.Principal;
Expand Down Expand Up @@ -90,9 +89,11 @@ public WolfSSLKeyX509(KeyStore store, char[] password)
() -> "creating new WolfSSLKeyX509 object");

/* Check Security property once at construction time.
* Use doPrivileged for SecurityManager compatibility. */
* Use doPrivileged for SecurityManager compatibility.
* AccessController used via FQN to avoid import-line removal
* warning on JDK 17+. */
@SuppressWarnings("removal")
String disableCacheValue = AccessController.doPrivileged(
String disableCacheValue = java.security.AccessController.doPrivileged(
new PrivilegedAction<String>() {
public String run() {
return Security.getProperty(DISABLE_CACHE_PROPERTY);
Expand Down Expand Up @@ -215,6 +216,7 @@ private void populateCache(KeyStore store, char[] password)
* null - if no alias matches found in KeyStore.
* String[] - aliases, if found that match type and/or issuers
*/
@SuppressWarnings("deprecation")
private String[] getAliasesFromKeyStore(String type, Principal[] issuers)
throws KeyStoreException {

Expand Down Expand Up @@ -286,6 +288,7 @@ private String[] getAliasesFromKeyStore(String type, Principal[] issuers)
* null - if no alias matches found.
* String[] - aliases, if found that match type and/or issuers
*/
@SuppressWarnings("deprecation")
private String[] getAliases(String type, Principal[] issuers) {

/* Check if caching is disabled, use direct KeyStore access */
Expand Down Expand Up @@ -555,6 +558,7 @@ public PrivateKey getPrivateKey(String alias) {
/**
* Clear sensitive data when object is garbage collected
*/
@SuppressWarnings({"deprecation", "removal"})
@Override
protected void finalize() throws Throwable {
try {
Expand Down
12 changes: 10 additions & 2 deletions src/java/com/wolfssl/provider/jsse/WolfSSLParametersHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
import java.security.AccessController;
import java.security.PrivilegedAction;
import javax.net.ssl.SSLParameters;
import com.wolfssl.provider.jsse.WolfSSLJDK8Helper;
Expand Down Expand Up @@ -53,7 +52,16 @@ public WolfSSLParametersHelper() { }
* has SSLParameters methods that older versions may not have */
static
{
AccessController.doPrivileged(new PrivilegedAction<Object>() {
detectSSLParametersMethods();
}

/* AccessController used via FQN to avoid import-line removal
* warning on JDK 17+. */
@SuppressWarnings("removal")
private static void detectSSLParametersMethods()
{
java.security.AccessController
.doPrivileged(new PrivilegedAction<Object>() {
public Object run() {
Class<?> c = SSLParameters.class;
Method[] methods = c.getDeclaredMethods();
Expand Down
1 change: 1 addition & 0 deletions src/java/com/wolfssl/provider/jsse/WolfSSLProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public void errorCallback(int ok, int err, String hash) {
/**
* wolfSSL JSSE Provider class
*/
@SuppressWarnings("deprecation")
public WolfSSLProvider() {
super("wolfJSSE", 1.17, "wolfSSL JSSE Provider");
/* super("wolfJSSE", "1.17", "wolfSSL JSSE Provider"); */
Expand Down
3 changes: 2 additions & 1 deletion src/java/com/wolfssl/provider/jsse/WolfSSLSocket.java
Original file line number Diff line number Diff line change
Expand Up @@ -1514,6 +1514,7 @@ public synchronized void removeHandshakeCompletedListener(
*
* @throws IOException if a network error occurs
*/
@SuppressWarnings("deprecation")
@Override
public synchronized void startHandshake() throws IOException {
int ret;
Expand Down Expand Up @@ -2319,7 +2320,7 @@ public synchronized void connect(SocketAddress endpoint, int timeout)
}
}

@SuppressWarnings("deprecation")
@SuppressWarnings({"deprecation", "removal"})
@Override
protected synchronized void finalize() throws Throwable {
if (this.ssl != null) {
Expand Down
2 changes: 1 addition & 1 deletion src/java/com/wolfssl/provider/jsse/WolfSSLTrustX509.java
Original file line number Diff line number Diff line change
Expand Up @@ -1339,7 +1339,7 @@ public X509Certificate[] getAcceptedIssuers() {
}
}

@SuppressWarnings("deprecation")
@SuppressWarnings({"deprecation", "removal"})
@Override
protected void finalize() throws Throwable {
this.store = null;
Expand Down
4 changes: 3 additions & 1 deletion src/java/com/wolfssl/provider/jsse/WolfSSLX509.java
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ public BigInteger getSerialNumber() {
return this.cert.getSerial();
}

@SuppressWarnings("deprecation")
@Override
public Principal getIssuerDN() {

Expand All @@ -194,6 +195,7 @@ public Principal getIssuerDN() {
return new WolfSSLPrincipal(name);
}

@SuppressWarnings("deprecation")
@Override
public Principal getSubjectDN() {

Expand Down Expand Up @@ -678,7 +680,7 @@ public byte[] getExtensionValue(String oid) {
}


@SuppressWarnings("removal")
@SuppressWarnings({"deprecation", "removal"})
@Override
protected void finalize() throws Throwable {
try {
Expand Down
2 changes: 1 addition & 1 deletion src/java/com/wolfssl/provider/jsse/WolfSSLX509X.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
*
* @author wolfSSL
*/
@SuppressWarnings("deprecation")
@SuppressWarnings({"deprecation", "removal"})
public class WolfSSLX509X extends X509Certificate {
WolfSSLX509 cert;

Expand Down
17 changes: 12 additions & 5 deletions src/java/com/wolfssl/provider/jsse/adapter/WolfSSLJDK8Helper.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import java.util.ArrayList;
import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
import java.security.AccessController;
import java.security.PrivilegedAction;
import javax.net.ssl.SSLParameters;
import javax.net.ssl.SNIServerName;
Expand Down Expand Up @@ -52,6 +51,7 @@ public WolfSSLJDK8Helper() { }
* @param m Java method to call to set SNI server names
* @param in WolfSSLParameters to set SNI names from
*/
@SuppressWarnings("removal")
protected static void setServerNames(final SSLParameters out,
final Method m, WolfSSLParameters in) {

Expand All @@ -69,8 +69,11 @@ protected static void setServerNames(final SSLParameters out,
sni.add(new SNIHostName(name.getEncoded()));
}

/* call SSLParameters.setServerName() */
AccessController.doPrivileged(new PrivilegedAction<Object>() {
/* call SSLParameters.setServerNames().
* AccessController used via FQN to avoid import-line removal
* warning on JDK 17+. */
java.security.AccessController
.doPrivileged(new PrivilegedAction<Object>() {
public Object run() {
try {
m.invoke(out, sni);
Expand Down Expand Up @@ -122,6 +125,7 @@ protected static void getServerNames(final SSLParameters in,
* @param m method to invoke to set protocols
* @param in input WolfSSLParameters to read ALPN protocols from
*/
@SuppressWarnings("removal")
protected static void setApplicationProtocols(final SSLParameters out,
final Method m, WolfSSLParameters in) {

Expand All @@ -134,7 +138,8 @@ protected static void setApplicationProtocols(final SSLParameters out,
final Object[] appProtoArr = {appProtos};
if (appProtos != null) {
/* call SSLParameters.setApplicationProtocols() */
AccessController.doPrivileged(new PrivilegedAction<Object>() {
java.security.AccessController
.doPrivileged(new PrivilegedAction<Object>() {
public Object run() {
try {
m.invoke(out, appProtoArr);
Expand Down Expand Up @@ -190,6 +195,7 @@ protected static void getApplicationProtocols(final SSLParameters in,
* @param m method to invoke to set endpoint ID algo
* @param in input WolfSSLParameters to read endpoint ID algo from
*/
@SuppressWarnings("removal")
protected static void setEndpointIdentificationAlgorithm(
final SSLParameters out, final Method m, WolfSSLParameters in) {

Expand All @@ -202,7 +208,8 @@ protected static void setEndpointIdentificationAlgorithm(
final String idAlgo = in.getEndpointIdentificationAlgorithm();
if (idAlgo != null) {
/* call SSLParameters.setEndpointIdentificationAlgorithm() */
AccessController.doPrivileged(new PrivilegedAction<Object>() {
java.security.AccessController
.doPrivileged(new PrivilegedAction<Object>() {
public Object run() {
try {
m.invoke(out, idAlgo);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public static void setupProvider() {
* The test will fail if JNI global references prevent garbage collection.
*/
@Test
@SuppressWarnings("removal")
public void testEngineMemoryLeakWithAbandonedEngines() throws Exception {

/* Skip on Android due to performance and timeout issues */
Expand Down
Loading
Loading