You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2022/06/14 20:20:56 UTC

[tomcat] branch main updated: Remove remaining deprecated code from the o.a.t.jni package

This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new 42197e99b7 Remove remaining deprecated code from the o.a.t.jni package
42197e99b7 is described below

commit 42197e99b765fec3fa4c3a0c6df9774838001a6f
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue Jun 14 21:20:50 2022 +0100

    Remove remaining deprecated code from the o.a.t.jni package
---
 java/org/apache/tomcat/jni/BIOCallback.java      |  56 ---------
 java/org/apache/tomcat/jni/Buffer.java           |  78 ------------
 java/org/apache/tomcat/jni/Error.java            |  98 ---------------
 java/org/apache/tomcat/jni/FileInfo.java         |  70 -----------
 java/org/apache/tomcat/jni/OS.java               | 135 --------------------
 java/org/apache/tomcat/jni/PasswordCallback.java |  34 -----
 java/org/apache/tomcat/jni/Pool.java             | 153 -----------------------
 java/org/apache/tomcat/jni/SSL.java              | 152 ----------------------
 java/org/apache/tomcat/jni/SSLContext.java       | 151 ----------------------
 java/org/apache/tomcat/jni/Sockaddr.java         |  45 -------
 10 files changed, 972 deletions(-)

diff --git a/java/org/apache/tomcat/jni/BIOCallback.java b/java/org/apache/tomcat/jni/BIOCallback.java
deleted file mode 100644
index ea9ccff67c..0000000000
--- a/java/org/apache/tomcat/jni/BIOCallback.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.apache.tomcat.jni;
-
-/** Open SSL BIO Callback Interface
- *
- * @author Mladen Turk
- *
- * @deprecated Unused. Will be removed in Tomcat 10.1
- */
-@Deprecated
-public interface BIOCallback {
-
-    /**
-     * Write data
-     * @param buf containing the bytes to write.
-     * @return Number of characters written.
-     */
-    public int write(byte [] buf);
-
-    /**
-     * Read data
-     * @param buf buffer to store the read bytes.
-     * @return number of bytes read.
-     */
-    public int read(byte [] buf);
-
-    /**
-     * Puts string
-     * @param data String to write
-     * @return Number of characters written
-     */
-    public int puts(String data);
-
-    /**
-     * Read string up to the len or CLRLF
-     * @param len Maximum number of characters to read
-     * @return String with up to len bytes read
-     */
-    public String gets(int len);
-
-}
diff --git a/java/org/apache/tomcat/jni/Buffer.java b/java/org/apache/tomcat/jni/Buffer.java
index a9d29edb1e..15ce56968e 100644
--- a/java/org/apache/tomcat/jni/Buffer.java
+++ b/java/org/apache/tomcat/jni/Buffer.java
@@ -24,73 +24,6 @@ import java.nio.ByteBuffer;
  */
 public class Buffer {
 
-    /**
-     * Allocate a new ByteBuffer from memory
-     * @param size The amount of memory to allocate
-     * @return The ByteBuffer with allocated memory
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static native ByteBuffer malloc(int size);
-
-    /**
-     * Allocate a new ByteBuffer from memory and set all of the memory to 0
-     * @param num Number of elements.
-     * @param size Length in bytes of each element.
-     * @return The ByteBuffer with allocated memory
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static native ByteBuffer calloc(int num, int size);
-
-    /**
-     * Allocate a new ByteBuffer from a pool
-     * @param p The pool to allocate from
-     * @param size The amount of memory to allocate
-     * @return The ByteBuffer with allocated memory
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static native ByteBuffer palloc(long p, int size);
-
-    /**
-     * Allocate a new ByteBuffer from a pool and set all of the memory to 0
-     * @param p The pool to allocate from
-     * @param size The amount of memory to allocate
-     * @return The ByteBuffer with allocated memory
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static native ByteBuffer pcalloc(long p, int size);
-
-    /**
-     * Allocate a new ByteBuffer from already allocated memory.
-     * <br>Allocated memory must be provided from call to the
-     * Stdlib.alloc or Stdlib.calloc methods.
-     * @param mem The memory to use
-     * @param size The amount of memory to use
-     * @return The ByteBuffer with attached memory
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static native ByteBuffer create(long mem, int size);
-
-    /**
-     * Deallocates or frees a memory block used by ByteBuffer
-     * <br><b>Warning :</b> Call this method only on ByteBuffers
-     * that were created by calling Buffer.alloc or Buffer.calloc.
-     * @param buf Previously allocated ByteBuffer to be freed.
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static native void free(ByteBuffer buf);
-
     /**
      * Returns the memory address of the ByteBuffer.
      *
@@ -99,15 +32,4 @@ public class Buffer {
      * @return the memory address
      */
     public static native long address(ByteBuffer buf);
-
-    /**
-     * Returns the allocated memory size of the ByteBuffer.
-     * @param buf Previously allocated ByteBuffer.
-     * @return the size
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static native long size(ByteBuffer buf);
-
 }
diff --git a/java/org/apache/tomcat/jni/Error.java b/java/org/apache/tomcat/jni/Error.java
deleted file mode 100644
index a72cc15d56..0000000000
--- a/java/org/apache/tomcat/jni/Error.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.apache.tomcat.jni;
-
-/** Error
- *
- * @author Mladen Turk
- *
- * @deprecated Unused. Will be removed in Tomcat 10.1
- */
-@Deprecated
-public class Error extends Exception {
-
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * APR error type.
-     */
-    private final int error;
-
-    /**
-     * A description of the problem.
-     */
-    private final String description;
-
-    /**
-     * Construct an APRException.
-     *
-     * @param error one of the value in Error
-     * @param description error message
-     */
-    private Error(int error, String description)
-    {
-        super(error + ": " + description);
-        this.error = error;
-        this.description = description;
-    }
-
-    /**
-     * Get the APR error code of the exception.
-     *
-     * @return error of the Exception
-     */
-    public int getError()
-    {
-        return error;
-    }
-
-    /**
-     * Get the APR description of the exception.
-     *
-     * @return description of the Exception
-     */
-    public String getDescription()
-    {
-        return description;
-    }
-
-    /**
-     * Get the last platform error.
-     * @return apr_status_t the last platform error, folded into apr_status_t, on most platforms
-     * This retrieves errno, or calls a GetLastError() style function, and
-     *      folds it with APR_FROM_OS_ERROR.  Some platforms (such as OS2) have no
-     *      such mechanism, so this call may be unsupported.  Do NOT use this
-     *      call for socket errors from socket, send, recv etc!
-     */
-    public static native int osError();
-
-    /**
-     * Get the last platform socket error.
-     * @return the last socket error, folded into apr_status_t, on all platforms
-     * This retrieves errno or calls a GetLastSocketError() style function,
-     *      and folds it with APR_FROM_OS_ERROR.
-     */
-    public static native int netosError();
-
-    /**
-     * Return a human readable string describing the specified error.
-     * @param statcode The error code the get a string for.
-     * @return The error string.
-    */
-    public static native String strerror(int statcode);
-
-}
diff --git a/java/org/apache/tomcat/jni/FileInfo.java b/java/org/apache/tomcat/jni/FileInfo.java
deleted file mode 100644
index 34b67ff01c..0000000000
--- a/java/org/apache/tomcat/jni/FileInfo.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.apache.tomcat.jni;
-
-/** Fileinfo
- *
- * @author Mladen Turk
- *
- * @deprecated  The scope of the APR/Native Library will be reduced in Tomcat
- *              10.1.x / Tomcat Native 2.x onwards to only include those
- *              components required to provide OpenSSL integration with the NIO
- *              and NIO2 connectors.
- */
-@Deprecated
-public class FileInfo {
-
-    /** Allocates memory and closes lingering handles in the specified pool */
-    public long pool;
-    /** The bitmask describing valid fields of this apr_finfo_t structure
-     *  including all available 'wanted' fields and potentially more */
-    public int valid;
-    /** The access permissions of the file.  Mimics Unix access rights. */
-    public int protection;
-    /** The type of file.  One of APR_REG, APR_DIR, APR_CHR, APR_BLK, APR_PIPE,
-     * APR_LNK or APR_SOCK.  If the type is undetermined, the value is APR_NOFILE.
-     * If the type cannot be determined, the value is APR_UNKFILE.
-     */
-    public int filetype;
-    /** The user id that owns the file */
-    public int user;
-    /** The group id that owns the file */
-    public int group;
-    /** The inode of the file. */
-    public int inode;
-    /** The id of the device the file is on. */
-    public int device;
-    /** The number of hard links to the file. */
-    public int nlink;
-    /** The size of the file */
-    public long size;
-    /** The storage size consumed by the file */
-    public long csize;
-    /** The time the file was last accessed */
-    public long atime;
-    /** The time the file was last modified */
-    public long mtime;
-    /** The time the file was created, or the inode was last changed */
-    public long ctime;
-    /** The pathname of the file (possibly unrooted) */
-    public String fname;
-    /** The file's name (no path) in filesystem case */
-    public String name;
-    /** The file's handle, if accessed (can be submitted to apr_duphandle) */
-    public long filehand;
-
-}
diff --git a/java/org/apache/tomcat/jni/OS.java b/java/org/apache/tomcat/jni/OS.java
deleted file mode 100644
index 15fdb8c4e5..0000000000
--- a/java/org/apache/tomcat/jni/OS.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.apache.tomcat.jni;
-
-/** OS
- *
- * @author Mladen Turk
- *
- * @deprecated  The scope of the APR/Native Library will be reduced in Tomcat
- *              10.1.x / Tomcat Native 2.x onwards to only include those
- *              components required to provide OpenSSL integration with the NIO
- *              and NIO2 connectors.
- */
-@Deprecated
-public class OS {
-
-    /* OS Enums */
-    private static final int UNIX      = 1;
-    private static final int WIN32     = 3;
-    private static final int WIN64     = 4;
-    private static final int LINUX     = 5;
-    private static final int SOLARIS   = 6;
-    private static final int BSD       = 7;
-    private static final int MACOSX    = 8;
-
-    public static final int LOG_EMERG  = 1;
-    public static final int LOG_ERROR  = 2;
-    public static final int LOG_NOTICE = 3;
-    public static final int LOG_WARN   = 4;
-    public static final int LOG_INFO   = 5;
-    public static final int LOG_DEBUG  = 6;
-
-    /**
-     * Check for OS type.
-     * @param type OS type to test.
-     */
-    private static native boolean is(int type);
-
-    public static final boolean IS_UNIX    = is(UNIX);
-    public static final boolean IS_WIN32   = is(WIN32);
-    public static final boolean IS_WIN64   = is(WIN64);
-    public static final boolean IS_LINUX   = is(LINUX);
-    public static final boolean IS_SOLARIS = is(SOLARIS);
-    public static final boolean IS_BSD     = is(BSD);
-    public static final boolean IS_MACOSX  = is(MACOSX);
-
-    /**
-     * Get the name of the system default character set.
-     * @param pool the pool to allocate the name from, if needed
-     * @return the encoding
-     */
-    public static native String defaultEncoding(long pool);
-
-    /**
-     * Get the name of the current locale character set.
-     * Defers to apr_os_default_encoding if the current locale's
-     * data can't be retrieved on this system.
-     * @param pool the pool to allocate the name from, if needed
-     * @return the encoding
-     */
-    public static native String localeEncoding(long pool);
-
-    /**
-     * Generate random bytes.
-     * @param buf Buffer to fill with random bytes
-     * @param len Length of buffer in bytes
-     * @return the operation status
-     */
-    public static native int random(byte [] buf, int len);
-
-    /**
-     * Gather system info.
-     * <PRE>
-     * On exit the inf array will be filled with:
-     * inf[0]  - Total usable main memory size
-     * inf[1]  - Available memory size
-     * inf[2]  - Total page file/swap space size
-     * inf[3]  - Page file/swap space still available
-     * inf[4]  - Amount of shared memory
-     * inf[5]  - Memory used by buffers
-     * inf[6]  - Memory Load
-     *
-     * inf[7]  - Idle Time in microseconds
-     * inf[8]  - Kernel Time in microseconds
-     * inf[9]  - User Time in microseconds
-     *
-     * inf[10] - Process creation time (apr_time_t)
-     * inf[11] - Process Kernel Time in microseconds
-     * inf[12] - Process User Time in microseconds
-     *
-     * inf[13] - Current working set size.
-     * inf[14] - Peak working set size.
-     * inf[15] - Number of page faults.
-     * </PRE>
-     * @param inf array that will be filled with system information.
-     *            Array length must be at least 16.
-     * @return the operation status
-     */
-    public static native int info(long [] inf);
-
-    /**
-     * Expand environment variables.
-     * @param str String to expand
-     * @return Expanded string with replaced environment variables.
-     */
-    public static native String expand(String str);
-
-    /**
-     * Initialize system logging.
-     * @param domain String that will be prepended to every message
-     */
-    public static native void sysloginit(String domain);
-
-    /**
-     * Log message.
-     * @param level Log message severity. See LOG_XXX enums.
-     * @param message Message to log
-     */
-    public static native void syslog(int level, String message);
-
-}
diff --git a/java/org/apache/tomcat/jni/PasswordCallback.java b/java/org/apache/tomcat/jni/PasswordCallback.java
deleted file mode 100644
index 5c579ddd5e..0000000000
--- a/java/org/apache/tomcat/jni/PasswordCallback.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.apache.tomcat.jni;
-
-/** PasswordCallback Interface
- *
- * @author Mladen Turk
- *
- * @deprecated Unused. Will be removed in Tomcat 10.1
- */
-@Deprecated
-public interface PasswordCallback {
-
-    /**
-     * Called when the password is required
-     * @param prompt Password prompt
-     * @return Valid password or null
-     */
-    public String callback(String prompt);
-}
diff --git a/java/org/apache/tomcat/jni/Pool.java b/java/org/apache/tomcat/jni/Pool.java
index 3668a508b9..062c713bd8 100644
--- a/java/org/apache/tomcat/jni/Pool.java
+++ b/java/org/apache/tomcat/jni/Pool.java
@@ -16,8 +16,6 @@
  */
 package org.apache.tomcat.jni;
 
-import java.nio.ByteBuffer;
-
 /**
  * Provides access to APR memory pools which are used to manage memory
  * allocations for natively created instances.
@@ -36,18 +34,6 @@ public class Pool {
     */
     public static native long create(long parent);
 
-    /**
-     * Clear all memory in the pool and run all the cleanups. This also destroys all
-     * subpools.
-     * @param pool The pool to clear
-     * This does not actually free the memory, it just allows the pool
-     *         to re-use this memory for the next allocation.
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static native void clear(long pool);
-
     /**
      * Destroy the pool. This takes similar action as apr_pool_clear() and then
      * frees all the memory. This will actually free the memory.
@@ -55,143 +41,4 @@ public class Pool {
      * @param pool The pool to destroy
      */
     public static native void destroy(long pool);
-
-    /**
-     * Get the parent pool of the specified pool.
-     * @param pool The pool for retrieving the parent pool.
-     * @return The parent of the given pool.
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static native long parentGet(long pool);
-
-    /**
-     * Determine if pool a is an ancestor of pool b
-     * @param a The pool to search
-     * @param b The pool to search for
-     * @return True if a is an ancestor of b, NULL is considered an ancestor
-     * of all pools.
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static native boolean isAncestor(long a, long b);
-
-
-    /*
-     * Cleanup
-     *
-     * Cleanups are performed in the reverse order they were registered.  That is:
-     * Last In, First Out.  A cleanup function can safely allocate memory from
-     * the pool that is being cleaned up. It can also safely register additional
-     * cleanups which will be run LIFO, directly after the current cleanup
-     * terminates.  Cleanups have to take caution in calling functions that
-     * create subpools. Subpools, created during cleanup will NOT automatically
-     * be cleaned up.  In other words, cleanups are to clean up after themselves.
-     */
-
-    /**
-     * Register a function to be called when a pool is cleared or destroyed
-     * @param pool The pool register the cleanup with
-     * @param o The object to call when the pool is cleared
-     *                      or destroyed
-     * @return The cleanup handler.
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static native long cleanupRegister(long pool, Object o);
-
-    /**
-     * Remove a previously registered cleanup function
-     * @param pool The pool remove the cleanup from
-     * @param data The cleanup handler to remove from cleanup
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static native void cleanupKill(long pool, long data);
-
-    /**
-     * Register a process to be killed when a pool dies.
-     * @param a The pool to use to define the processes lifetime
-     * @param proc The process to register
-     * @param how How to kill the process, one of:
-     * <PRE>
-     * APR_KILL_NEVER         -- process is never sent any signals
-     * APR_KILL_ALWAYS        -- process is sent SIGKILL on apr_pool_t cleanup
-     * APR_KILL_AFTER_TIMEOUT -- SIGTERM, wait 3 seconds, SIGKILL
-     * APR_JUST_WAIT          -- wait forever for the process to complete
-     * APR_KILL_ONLY_ONCE     -- send SIGTERM and then wait
-     * </PRE>
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static native void noteSubprocess(long a, long proc, int how);
-
-    /**
-     * Allocate a block of memory from a pool
-     * @param p The pool to allocate from
-     * @param size The amount of memory to allocate
-     * @return The ByteBuffer with allocated memory
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static native ByteBuffer alloc(long p, int size);
-
-    /**
-     * Allocate a block of memory from a pool and set all of the memory to 0
-     * @param p The pool to allocate from
-     * @param size The amount of memory to allocate
-     * @return The ByteBuffer with allocated memory
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static native ByteBuffer calloc(long p, int size);
-
-    /*
-     * User data management
-     */
-
-    /**
-     * Set the data associated with the current pool
-     * @param data The user data associated with the pool.
-     * @param key The key to use for association
-     * @param pool The current pool
-     * <br><b>Warning :</b>
-     * The data to be attached to the pool should have a life span
-     * at least as long as the pool it is being attached to.
-     * Object attached to the pool will be globally referenced
-     * until the pool is cleared or dataSet is called with the null data.
-     * @return APR Status code.
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-     public static native int dataSet(long pool, String key, Object data);
-
-    /**
-     * Return the data associated with the current pool.
-     * @param key The key for the data to retrieve
-     * @param pool The current pool.
-     * @return the data
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-     public static native Object dataGet(long pool, String key);
-
-    /**
-     * Run all of the child_cleanups, so that any unnecessary files are
-     * closed because we are about to exec a new program
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static native void cleanupForExec();
-
 }
diff --git a/java/org/apache/tomcat/jni/SSL.java b/java/org/apache/tomcat/jni/SSL.java
index a66789bb6d..64a601e1fb 100644
--- a/java/org/apache/tomcat/jni/SSL.java
+++ b/java/org/apache/tomcat/jni/SSL.java
@@ -154,19 +154,6 @@ public final class SSL {
 
     public static final int SSL_OP_NO_TICKET                        = 0x00004000;
 
-    // SSL_OP_PKCS1_CHECK_1 and SSL_OP_PKCS1_CHECK_2 flags are unsupported
-    // in the current version of OpenSSL library. See ssl.h changes in commit
-    // 7409d7ad517650db332ae528915a570e4e0ab88b (30 Apr 2011) of OpenSSL.
-    /**
-     * @deprecated Unsupported in the current version of OpenSSL
-     */
-    @Deprecated
-    public static final int SSL_OP_PKCS1_CHECK_1                    = 0x08000000;
-    /**
-     * @deprecated Unsupported in the current version of OpenSSL
-     */
-    @Deprecated
-    public static final int SSL_OP_PKCS1_CHECK_2                    = 0x10000000;
     public static final int SSL_OP_NETSCAPE_CA_DN_BUG               = 0x20000000;
     public static final int SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG  = 0x40000000;
 
@@ -297,46 +284,6 @@ public final class SSL {
      */
     public static native int fipsModeSet(int mode) throws Exception;
 
-    /**
-     * Add content of the file to the PRNG
-     * @param filename Filename containing random data.
-     *        If null the default file will be tested.
-     *        The seed file is $RANDFILE if that environment variable is
-     *        set, $HOME/.rnd otherwise.
-     *        In case both files are unavailable builtin
-     *        random seed generator is used.
-     * @return <code>true</code> if the operation was successful
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static native boolean randLoad(String filename);
-
-    /**
-     * Writes a number of random bytes (currently 1024) to
-     * file <code>filename</code> which can be used to initialize the PRNG
-     * by calling randLoad in a later session.
-     * @param filename Filename to save the data
-     * @return <code>true</code> if the operation was successful
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static native boolean randSave(String filename);
-
-    /**
-     * Creates random data to filename
-     * @param filename Filename to save the data
-     * @param len The length of random sequence in bytes
-     * @param base64 Output the data in Base64 encoded format
-     * @return <code>true</code> if the operation was successful
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static native boolean randMake(String filename, int len,
-                                          boolean base64);
-
     /**
      * Sets global random filename.
      *
@@ -346,73 +293,6 @@ public final class SSL {
      */
     public static native void randSet(String filename);
 
-    /**
-     * Initialize new BIO
-     * @param pool The pool to use.
-     * @param callback BIOCallback to use
-     * @return New BIO handle
-     * @throws Exception An error occurred
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static native long newBIO(long pool, BIOCallback callback)
-            throws Exception;
-
-    /**
-     * Close BIO and dereference callback object
-     * @param bio BIO to close and destroy.
-     * @return APR Status code
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static native int closeBIO(long bio);
-
-    /**
-     * Set global Password callback for obtaining passwords.
-     * @param callback PasswordCallback implementation to use.
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static native void setPasswordCallback(PasswordCallback callback);
-
-    /**
-     * Set global Password for decrypting certificates and keys.
-     * @param password Password to use.
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static native void setPassword(String password);
-
-    /**
-     * Return last SSL error string
-     * @return the error string
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static native String getLastError();
-
-    /**
-     * Return true if all the requested SSL_OP_* are supported by OpenSSL.
-     *
-     * <i>Note that for versions of tcnative &lt; 1.1.25, this method will
-     * return <code>true</code> if and only if <code>op</code>=
-     * {@link #SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION} and tcnative
-     * supports that flag.</i>
-     *
-     * @param op Bitwise-OR of all SSL_OP_* to test.
-     *
-     * @return true if all SSL_OP_* are supported by OpenSSL library.
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static native boolean hasOp(int op);
-
     /**
      * Return the handshake completed count.
      * @param ssl SSL pointer
@@ -446,28 +326,6 @@ public final class SSL {
      */
     public static native long newSSL(long ctx, boolean server);
 
-    /**
-     * SSL_set_bio
-     * @param ssl SSL pointer (SSL *)
-     * @param rbio read BIO pointer (BIO *)
-     * @param wbio write BIO pointer (BIO *)
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static native void setBIO(long ssl, long rbio, long wbio);
-
-    /**
-     * SSL_get_error
-     * @param ssl SSL pointer (SSL *)
-     * @param ret TLS/SSL I/O return value
-     * @return the error status
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static native int getError(long ssl, int ret);
-
     /**
      * BIO_ctrl_pending.
      * @param bio BIO pointer (BIO *)
@@ -525,16 +383,6 @@ public final class SSL {
      */
     public static native int getShutdown(long ssl);
 
-    /**
-     * SSL_set_shutdown
-     * @param ssl the SSL instance (SSL *)
-     * @param mode Shutdown mode
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static native void setShutdown(long ssl, int mode);
-
     /**
      * SSL_free
      * @param ssl the SSL instance (SSL *)
diff --git a/java/org/apache/tomcat/jni/SSLContext.java b/java/org/apache/tomcat/jni/SSLContext.java
index 58e45897e7..0f047c5f95 100644
--- a/java/org/apache/tomcat/jni/SSLContext.java
+++ b/java/org/apache/tomcat/jni/SSLContext.java
@@ -65,40 +65,6 @@ public final class SSLContext {
      */
     public static native int free(long ctx);
 
-    /**
-     * Set Session context id. Usually host:port combination.
-     * @param ctx Context to use.
-     * @param id  String that uniquely identifies this context.
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static native void setContextId(long ctx, String id);
-
-    /**
-     * Associate BIOCallback for input or output data capture.
-     * <br>
-     * First word in the output string will contain error
-     * level in the form:
-     * <PRE>
-     * [ERROR]  -- Critical error messages
-     * [WARN]   -- Warning messages
-     * [INFO]   -- Informational messages
-     * [DEBUG]  -- Debugging messaged
-     * </PRE>
-     * Callback can use that word to determine application logging level
-     * by intercepting <b>write</b> call.
-     * If the <b>bio</b> is set to 0 no error messages will be displayed.
-     * Default is to use the stderr output stream.
-     * @param ctx Server or Client context to use.
-     * @param bio BIO handle to use, created with SSL.newBIO
-     * @param dir BIO direction (1 for input 0 for output).
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static native void setBIO(long ctx, long bio, int dir);
-
     /**
      * Set OpenSSL Option.
      * @param ctx Server or Client context to use.
@@ -127,30 +93,6 @@ public final class SSLContext {
      */
     public static native String[] getCiphers(long ctx);
 
-    /**
-     * Sets the "quiet shutdown" flag for <b>ctx</b> to be
-     * <b>mode</b>. SSL objects created from <b>ctx</b> inherit the
-     * <b>mode</b> valid at the time and may be 0 or 1.
-     * <br>
-     * Normally when an SSL connection is finished, the parties must send out
-     * "close notify" alert messages using L&lt;SSL_shutdown(3)|SSL_shutdown(3)&gt;
-     * for a clean shutdown.
-     * <br>
-     * When setting the "quiet shutdown" flag to 1, <b>SSL.shutdown</b>
-     * will set the internal flags to SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN.
-     * (<b>SSL_shutdown</b> then behaves like called with
-     * SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN.)
-     * The session is thus considered to be shutdown, but no "close notify" alert
-     * is sent to the peer. This behaviour violates the TLS standard.
-     * The default is normal shutdown behaviour as described by the TLS standard.
-     * @param ctx Server or Client context to use.
-     * @param mode True to set the quiet shutdown.
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static native void setQuietShutdown(long ctx, boolean mode);
-
     /**
      * Cipher Suite available for negotiation in SSL handshake.
      * <br>
@@ -348,33 +290,6 @@ public final class SSLContext {
                                                   String path)
         throws Exception;
 
-    /**
-     * Set file for randomness
-     * @param ctx Server or Client context to use.
-     * @param file random file.
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static native void setRandom(long ctx, String file);
-
-    /**
-     * Set SSL connection shutdown type
-     * <br>
-     * The following levels are available for level:
-     * <PRE>
-     * SSL_SHUTDOWN_TYPE_STANDARD
-     * SSL_SHUTDOWN_TYPE_UNCLEAN
-     * SSL_SHUTDOWN_TYPE_ACCURATE
-     * </PRE>
-     * @param ctx Server or Client context to use.
-     * @param type Shutdown type to use.
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static native void setShutdownType(long ctx, int type);
-
     /**
      * Set Type of Client Certificate verification and Maximum depth of CA Certificates
      * in Client Certificate verification.
@@ -410,9 +325,6 @@ public final class SSLContext {
      */
     public static native void setVerify(long ctx, int level, int depth);
 
-    @Deprecated
-    public static native int setALPN(long ctx, byte[] proto, int len);
-
     /**
      * When tc-native encounters a SNI extension in the TLS handshake it will
      * call this method to determine which OpenSSL SSLContext to use for the
@@ -447,43 +359,6 @@ public final class SSLContext {
      */
     private static final Map<Long,SNICallBack> sniCallBacks = new ConcurrentHashMap<>();
 
-    /**
-     * Register an OpenSSL SSLContext that will be used to initiate TLS
-     * connections that may use the SNI extension with the component that will
-     * be used to map the requested hostname to the correct OpenSSL SSLContext
-     * for the remainder of the connection.
-     *
-     * @param defaultSSLContext The Java representation of a pointer to the
-     *                          OpenSSL SSLContext that will be used to
-     *                          initiate TLS connections
-     * @param sniCallBack The component that will map SNI hosts names received
-     *                    via connections initiated using
-     *                    <code>defaultSSLContext</code> to the correct  OpenSSL
-     *                    SSLContext
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static void registerDefault(Long defaultSSLContext,
-            SNICallBack sniCallBack) {
-        sniCallBacks.put(defaultSSLContext, sniCallBack);
-    }
-
-    /**
-     * Unregister an OpenSSL SSLContext that will no longer be used to initiate
-     * TLS connections that may use the SNI extension.
-     *
-     * @param defaultSSLContext The Java representation of a pointer to the
-     *                          OpenSSL SSLContext that will no longer be used
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static void unregisterDefault(Long defaultSSLContext) {
-        sniCallBacks.remove(defaultSSLContext);
-    }
-
-
     /**
      * Interface implemented by components that will receive the call back to
      * select an OpenSSL SSLContext based on the host name requested by the
@@ -523,32 +398,6 @@ public final class SSLContext {
      */
     public static native void setAlpnProtos(long ctx, String[] alpnProtos, int selectorFailureBehavior);
 
-    /**
-     * Set DH parameters
-     * @param ctx Server context to use.
-     * @param cert DH param file (can be generated from e.g. {@code openssl dhparam -rand - 2048 > dhparam.pem} -
-     *             see the <a href="https://www.openssl.org/docs/apps/dhparam.html">OpenSSL documentation</a>).
-     * @throws Exception An error occurred
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static native void setTmpDH(long ctx, String cert)
-            throws Exception;
-
-    /**
-     * Set ECDH elliptic curve by name
-     * @param ctx Server context to use.
-     * @param curveName the name of the elliptic curve to use
-     *             (available names can be obtained from {@code openssl ecparam -list_curves}).
-     * @throws Exception An error occurred
-     *
-     * @deprecated Unused. Will be removed in Tomcat 10.1
-     */
-    @Deprecated
-    public static native void setTmpECDHByCurveName(long ctx, String curveName)
-            throws Exception;
-
     /**
      * Set the context within which session be reused (server side only)
      * http://www.openssl.org/docs/ssl/SSL_CTX_set_session_id_context.html
diff --git a/java/org/apache/tomcat/jni/Sockaddr.java b/java/org/apache/tomcat/jni/Sockaddr.java
deleted file mode 100644
index 9d138ec36e..0000000000
--- a/java/org/apache/tomcat/jni/Sockaddr.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.apache.tomcat.jni;
-
-/** Sockaddr
- *
- * @author Mladen Turk
- *
- * @deprecated  The scope of the APR/Native Library will be reduced in Tomcat
- *              10.1.x / Tomcat Native 2.x onwards to only include those
- *              components required to provide OpenSSL integration with the NIO
- *              and NIO2 connectors.
- */
-@Deprecated
-public class Sockaddr {
-
-   /** The pool to use... */
-    public long pool;
-    /** The hostname */
-    public String hostname;
-    /** Either a string of the port number or the service name for the port */
-    public String servname;
-    /** The numeric port */
-    public int port;
-    /** The family */
-    public int family;
-    /** If multiple addresses were found by apr_sockaddr_info_get(), this
-     *  points to a representation of the next address. */
-    public long next;
-
-}


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org