[ 
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:
----------------------------------

[[email protected]], 
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)

Reply via email to