You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2023/06/22 09:18:11 UTC

[Bug 66666] New: Remove non-reachable functions from ssl.c

https://bz.apache.org/bugzilla/show_bug.cgi?id=66666

            Bug ID: 66666
           Summary: Remove non-reachable functions from ssl.c
           Product: Tomcat Native
           Version: 2.0.2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Library
          Assignee: dev@tomcat.apache.org
          Reporter: michaelo@apache.org
  Target Milestone: ---

The following methods have been deprecated from its Java counterpart SSL.java,
but have never been removed from ssl.c:

    @Deprecated
    public static native boolean randLoad(String filename);
    @Deprecated
    public static native boolean randSave(String filename);
    @Deprecated
    public static native boolean randMake(String filename, int len,
                                          boolean base64);
    @Deprecated
    public static native long newBIO(long pool, BIOCallback callback)
            throws Exception;
    @Deprecated
    public static native int closeBIO(long bio);
    @Deprecated
    public static native void setPasswordCallback(PasswordCallback callback);
    @Deprecated
    public static native void setPassword(String password);
    @Deprecated
    public static native String getLastError();
    @Deprecated
    public static native boolean hasOp(int op);
    @Deprecated
    public static native void setBIO(long ssl, long rbio, long wbio);
    @Deprecated
    public static native int getError(long ssl, int ret);
    @Deprecated
    public static native void setShutdown(long ssl, int mode);
    @Deprecated
    public static native String getNextProtoNegotiated(long ssl);

I believe we can safely remove the C code from ssl.c

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 66666] Remove non-reachable functions from ssl.c

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66666

--- Comment #8 from Michael Osipov <mi...@apache.org> ---
PR provided.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 66666] Remove non-reachable functions from ssl.c

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66666

Michael Osipov <mi...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

--- Comment #7 from Michael Osipov <mi...@apache.org> ---
Moving back to new...

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 66666] Remove non-reachable functions from ssl.c

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66666

Michael Osipov <mi...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #9 from Michael Osipov <mi...@apache.org> ---
Fixed in:
- main for 2.0.5 and onwards

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 66666] Remove non-reachable functions from ssl.c

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66666

--- Comment #1 from Michael Osipov <mi...@apache.org> ---
As far as I can see, when setPasswordCallback() is gone

typedef struct {
    char            password[SSL_MAX_PASSWORD_LEN];
    const char     *prompt;
    tcn_callback_t cb;
} tcn_pass_cb_t;

can be reduced to
typedef struct {
    char            password[SSL_MAX_PASSWORD_LEN];
    const char     *prompt;
} tcn_pass_cb_t;

and the code associated with since no callback can be passed anymore from Java,
the tcnative builtin callback will be used.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 66666] Remove non-reachable functions from ssl.c

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66666

Christopher Schultz <ch...@christopherschultz.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #2 from Christopher Schultz <ch...@christopherschultz.net> ---
We have been hesitant to remove things from tcnative even if they are not used
by the Java components.

Some (unspecified) downstream users may be relying on these "extraneous"
functions.

Are you proposing that these be removed from tcnative 2.x or also from 1.2.x?

I would support removing them from 2.x but maybe not 1.2.x.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 66666] Remove non-reachable functions from ssl.c

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66666

--- Comment #5 from Mark Thomas <ma...@apache.org> ---
I can't see any reason I kept those other than oversight. No objections to
removal in 2.0.x.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 66666] Remove non-reachable functions from ssl.c

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66666

--- Comment #3 from Michael Osipov <mi...@apache.org> ---
(In reply to Christopher Schultz from comment #2)
> We have been hesitant to remove things from tcnative even if they are not
> used by the Java components.
> 
> Some (unspecified) downstream users may be relying on these "extraneous"
> functions.
> 
> Are you proposing that these be removed from tcnative 2.x or also from 1.2.x?
> 
> I would support removing them from 2.x but maybe not 1.2.x.

Hi Chris,

I do not intend to touch 1.2.x in this regard. Only 2.x. The functions to be
removed aren't part of a public API, we do not install any header files either.
It should have been done with
https://github.com/apache/tomcat-native/commit/e7db81bf5a493b44fbc1772c49fbc063c250b05a#diff-610e4592fa703b3c32818bf4baec54fdb8092d1b54819a1d86643fed3920f8e1.
If someone has truly relied on the C code only, he's done a serious mistake.
Our C code is meant to be accessed through Java only.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 66666] Remove non-reachable functions from ssl.c

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66666

Michael Osipov <mi...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |michaelo@apache.org

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 66666] Remove non-reachable functions from ssl.c

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66666

--- Comment #4 from Mark Thomas <ma...@apache.org> ---
Let me check and see if there is a reason I didn't remove this code or if I
just missed it.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 66666] Remove non-reachable functions from ssl.c

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66666

--- Comment #6 from Michael Osipov <mi...@apache.org> ---
(In reply to Mark Thomas from comment #5)
> I can't see any reason I kept those other than oversight. No objections to
> removal in 2.0.x.

Great, will work on a PR.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org