commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xianda Ke (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CRYPTO-108) OpenSSL does not handle Native code loading failure
Date Wed, 06 Jul 2016 07:31:11 GMT

    [ https://issues.apache.org/jira/browse/CRYPTO-108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15363906#comment-15363906
] 

Xianda Ke commented on CRYPTO-108:
----------------------------------

[~sebb@apache.org], 
Currently, OpenSSL doesn't throw exception. the native is loaded in a static block.
Class initializers are executed in the order they are defined, if we throw exception when
loading native in the static block. we are trying to use a class that is in an erroneous state.

if any loading failure, OpenSslCipher.java will handle it and throw an exception.
{code}
OpenSslCipher(Properties props, String transformation) {
        //...
        String loadingFailureReason = OpenSsl.getLoadingFailureReason();
        if (loadingFailureReason != null) {
            throw new RuntimeException(loadingFailureReason);
        }
}
{code}



> OpenSSL does not handle Native code loading failure
> ---------------------------------------------------
>
>                 Key: CRYPTO-108
>                 URL: https://issues.apache.org/jira/browse/CRYPTO-108
>             Project: Commons Crypto
>          Issue Type: Bug
>            Reporter: Sebb
>
> OpenSSL fails to check if the Native code was loaded successfully before creating an
instance.
> This just defers the inevitable failure; it would be better to throw an error immediately.
> Also the code should provide the details of the load faiure



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message