[JBoss JIRA] (WFWIP-162) IllegalStateException when TrustManager with SunX509 algorithm and with OCSP
by Jan Stourac (Jira)
Jan Stourac created WFWIP-162:
---------------------------------
Summary: IllegalStateException when TrustManager with SunX509 algorithm and with OCSP
Key: WFWIP-162
URL: https://issues.jboss.org/browse/WFWIP-162
Project: WildFly WIP
Issue Type: Bug
Components: Security
Environment: WildFly built with following branches in use:
{code}
https://github.com/nekdozjam/wildfly-elytron/tree/ELY-1617
https://github.com/nekdozjam/wildfly-core/tree/WFCORE-3947
{code}
Reporter: Jan Stourac
Assignee: Martin Mazanek
Attachments: ocsp-truststore.jks
I can see an error when I try to create 'trust-manager' with OCSP enabled and SunX509 algorithm specified. When I don't specify SunX509 algorithm, operation succeeds.
Here are noticed error messages:
{code}
{
"outcome" => "failed",
"failure-description" => {"WFLYCTL0080: Failed services" => {"org.wildfly.security.trust-manager.tm" => "Failed to start service
Caused by: java.lang.IllegalStateException: ELY04026: Could not create trust manager [org.wildfly.security.ssl.X509RevocationTrustManager]
Caused by: java.security.InvalidAlgorithmParameterException: SunX509 TrustManagerFactory does not use ManagerFactoryParameters"}},
"rolled-back" => true
}
{code}
In server.log, there is following text:
{code}
17:14:48,560 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC000001: Failed to start service org.wildfly.security.trust-manager.tm: org.jboss.msc.service.StartException in service org.wildfly.security.trust-manager.tm: Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1730)
at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1558)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: ELY04026: Could not create trust manager [org.wildfly.security.ssl.X509RevocationTrustManager]
at org.wildfly.security.ssl.X509RevocationTrustManager.<init>(X509RevocationTrustManager.java:108)
at org.wildfly.security.ssl.X509RevocationTrustManager.<init>(X509RevocationTrustManager.java:56)
at org.wildfly.security.ssl.X509RevocationTrustManager$Builder.build(X509RevocationTrustManager.java:293)
at org.wildfly.extension.elytron.SSLDefinitions$2.lambda$createX509RevocationExtendedTrustManager$1(SSLDefinitions.java:732)
at org.wildfly.extension.elytron.TrivialService.start(TrivialService.java:53)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1738)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1700)
... 6 more
Caused by: java.security.InvalidAlgorithmParameterException: SunX509 TrustManagerFactory does not use ManagerFactoryParameters
at sun.security.ssl.TrustManagerFactoryImpl$SimpleFactory.getInstance(TrustManagerFactoryImpl.java:257)
at sun.security.ssl.TrustManagerFactoryImpl.engineInit(TrustManagerFactoryImpl.java:90)
at javax.net.ssl.TrustManagerFactory.init(TrustManagerFactory.java:273)
at org.wildfly.security.ssl.X509RevocationTrustManager.<init>(X509RevocationTrustManager.java:98)
... 12 more
17:14:48,562 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 1) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "elytron"),
("trust-manager" => "tm")
]) - failure description: {"WFLYCTL0080: Failed services" => {"org.wildfly.security.trust-manager.tm" => "Failed to start service
Caused by: java.lang.IllegalStateException: ELY04026: Could not create trust manager [org.wildfly.security.ssl.X509RevocationTrustManager]
Caused by: java.security.InvalidAlgorithmParameterException: SunX509 TrustManagerFactory does not use ManagerFactoryParameters"}}
{code}
I'm attaching kestore file that I used for this. Password is 'weneedthatforjava'.
Note that when I try 'certificate-revocation-list' instead or if I omit 'algorithm' attribute at all, the operation succeeds.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 2 months
[JBoss JIRA] (WFLY-11994) Hibernate ORM transformer method signature parameter comparison to treat Ljava/lang/Object as wildcard parameter
by Scott Marlow (Jira)
[ https://issues.jboss.org/browse/WFLY-11994?page=com.atlassian.jira.plugin... ]
Scott Marlow commented on WFLY-11994:
-------------------------------------
we don't need this change any more, but in case we are interested in it in the future, below is some key parts from https://github.com/scottmarlow/wildfly/commit/ba6b2918e65be46104fbc90b676...
if (parentClassesAndInterfaces.contains("org/hibernate/usertype/CompositeUserType")) {
if (name.equals("nullSafeGet") &&
match(desc,"(Ljava/sql/ResultSet;[Ljava/lang/String;Lorg/hibernate/engine/spi/SessionImplementor;Ljava/lang/Object;)Ljava/lang/Object;")) {
desc = replaceSessionImplementor(desc);
} else if (name.equals("nullSafeSet") &&
match(desc,"(Ljava/sql/PreparedStatement;Ljava/lang/Object;ILorg/hibernate/engine/spi/SessionImplementor;)V")) {
desc = replaceSessionImplementor(desc);
} else if (name.equals("assemble") &&
match(desc,"(Ljava/io/Serializable;Lorg/hibernate/engine/spi/SessionImplementor;Ljava/lang/Object;)Ljava/lang/Object;")) {
desc = replaceSessionImplementor(desc);
} else if (name.equals("disassemble") &&
match(desc,"(Ljava/lang/Object;Lorg/hibernate/engine/spi/SessionImplementor;)Ljava/io/Serializable;")) {
desc = replaceSessionImplementor(desc);
} else if (name.equals("replace") &&
match(desc,"(Ljava/lang/Object;Ljava/lang/Object;Lorg/hibernate/engine/spi/SessionImplementor;Ljava/lang/Object;)Ljava/lang/Object;")) {
desc = replaceSessionImplementor(desc);
}
rewriteSessionImplementor = true;
}
private static boolean match(String desc, String check) {
Type[] descType = Type.getArgumentTypes(desc);
Type[] checkType = Type.getArgumentTypes(check);
if(checkType.length != descType.length) {
return false;
}
for(int looper=0; looper < checkType.length; looper++) {
if ( ! matchWildcard(descType[looper], checkType[looper]) &&
! checkType[looper].equals(descType[looper])) {
return false;
}
}
return true;
}
// return true if both parameter types are Objects and checkType is java.lang.Object (treat as match any object)
private static boolean matchWildcard(Type descType, Type checkType) {
return checkType.getDescriptor().startsWith("L") &&
descType.getDescriptor().startsWith("L") &&
checkType.getInternalName().equals("java/lang/Object");
}
> Hibernate ORM transformer method signature parameter comparison to treat Ljava/lang/Object as wildcard parameter
> ----------------------------------------------------------------------------------------------------------------
>
> Key: WFLY-11994
> URL: https://issues.jboss.org/browse/WFLY-11994
> Project: WildFly
> Issue Type: Enhancement
> Components: JPA / Hibernate
> Reporter: Scott Marlow
> Assignee: Scott Marlow
> Priority: Major
> Attachments: statetype.zip
>
>
> Replace the org.jboss.as.hibernate.Hibernate51CompatibilityTransformer check for Ljava/lang/Object, to instead match any object type (via custom code). Do the same for the MethodAdapter class.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 2 months
[JBoss JIRA] (WFLY-11991) Add Hibernate ORM transformer option to transform any method parameter of type org.hibernate.engine.spi.SessionImplementor
by Scott Marlow (Jira)
[ https://issues.jboss.org/browse/WFLY-11991?page=com.atlassian.jira.plugin... ]
Scott Marlow updated WFLY-11991:
--------------------------------
Comment: was deleted
(was: we don't need this change any more, but in case we are interested in it in the future, below is some key parts from [https://github.com/scottmarlow/wildfly/commit/ba6b2918e65be46104fbc90b676...]
{code}
if (parentClassesAndInterfaces.contains("org/hibernate/usertype/CompositeUserType")) {
if (name.equals("nullSafeGet") &&
match(desc,"(Ljava/sql/ResultSet;[Ljava/lang/String;Lorg/hibernate/engine/spi/SessionImplementor;Ljava/lang/Object;)Ljava/lang/Object;")) {
desc = replaceSessionImplementor(desc);
} else if (name.equals("nullSafeSet") &&
match(desc,"(Ljava/sql/PreparedStatement;Ljava/lang/Object;ILorg/hibernate/engine/spi/SessionImplementor;)V")) {
desc = replaceSessionImplementor(desc);
} else if (name.equals("assemble") &&
match(desc,"(Ljava/io/Serializable;Lorg/hibernate/engine/spi/SessionImplementor;Ljava/lang/Object;)Ljava/lang/Object;")) {
desc = replaceSessionImplementor(desc);
} else if (name.equals("disassemble") &&
match(desc,"(Ljava/lang/Object;Lorg/hibernate/engine/spi/SessionImplementor;)Ljava/io/Serializable;")) {
desc = replaceSessionImplementor(desc);
} else if (name.equals("replace") &&
match(desc,"(Ljava/lang/Object;Ljava/lang/Object;Lorg/hibernate/engine/spi/SessionImplementor;Ljava/lang/Object;)Ljava/lang/Object;")) {
desc = replaceSessionImplementor(desc);
}
rewriteSessionImplementor = true;
}
{code}
{code}
private static boolean match(String desc, String check) {
Type[] descType = Type.getArgumentTypes(desc);
Type[] checkType = Type.getArgumentTypes(check);
if(checkType.length != descType.length) {
return false;
}
for(int looper=0; looper < checkType.length; looper++) {
if ( ! matchWildcard(descType[looper], checkType[looper]) &&
! checkType[looper].equals(descType[looper])) {
return false;
}
}
return true;
}
// return true if both parameter types are Objects and checkType is java.lang.Object (treat as match any object)
private static boolean matchWildcard(Type descType, Type checkType) {
return checkType.getDescriptor().startsWith("L") &&
descType.getDescriptor().startsWith("L") &&
checkType.getInternalName().equals("java/lang/Object");
}
{code})
> Add Hibernate ORM transformer option to transform any method parameter of type org.hibernate.engine.spi.SessionImplementor
> --------------------------------------------------------------------------------------------------------------------------
>
> Key: WFLY-11991
> URL: https://issues.jboss.org/browse/WFLY-11991
> Project: WildFly
> Issue Type: Bug
> Components: JPA / Hibernate
> Reporter: Scott Marlow
> Assignee: Scott Marlow
> Priority: Major
> Fix For: 17.0.0.Beta1
>
> Attachments: afterchange.zip, beforechange.zip
>
>
> The idea is to transform any class method parameter of type org.hibernate.engine.spi.SessionImplementor, in user application, to instead use type org.hibernate.engine.spi.SharedSessionContractImplementor.
> The test case (change) is for this enhancement is [https://github.com/simkam/wildfly/compare/hibernate_transformer].
> The test case change is adding an internalNullSafeGet method that should also be transformed to use the SharedSessionContractImplementor type but was not, which led to an application failure with code:
> {code}
> public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException {
> return internalNullSafeGet(rs, names, session, owner);
> }
> private Object internalNullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException {
> internalSessionImplementorUsingMethod(session);
> session.isTransactionInProgress();
> int result = rs.getInt( names[0] );
> if ( rs.wasNull() ) return null;
> return State.values()[result];
> }
> }
> {code}
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 2 months
[JBoss JIRA] (WFLY-11991) Add Hibernate ORM transformer option to transform any method parameter of type org.hibernate.engine.spi.SessionImplementor
by Scott Marlow (Jira)
[ https://issues.jboss.org/browse/WFLY-11991?page=com.atlassian.jira.plugin... ]
Scott Marlow updated WFLY-11991:
--------------------------------
Comment: was deleted
(was: We eliminated the checking of method name/ parameter types, that needed this change.
[https://github.com/wildfly/wildfly/pull/12231] is the pull request that contains changes that eliminate the need for WFLY-11991.)
> Add Hibernate ORM transformer option to transform any method parameter of type org.hibernate.engine.spi.SessionImplementor
> --------------------------------------------------------------------------------------------------------------------------
>
> Key: WFLY-11991
> URL: https://issues.jboss.org/browse/WFLY-11991
> Project: WildFly
> Issue Type: Bug
> Components: JPA / Hibernate
> Reporter: Scott Marlow
> Assignee: Scott Marlow
> Priority: Major
> Fix For: 17.0.0.Beta1
>
> Attachments: afterchange.zip, beforechange.zip
>
>
> The idea is to transform any class method parameter of type org.hibernate.engine.spi.SessionImplementor, in user application, to instead use type org.hibernate.engine.spi.SharedSessionContractImplementor.
> The test case (change) is for this enhancement is [https://github.com/simkam/wildfly/compare/hibernate_transformer].
> The test case change is adding an internalNullSafeGet method that should also be transformed to use the SharedSessionContractImplementor type but was not, which led to an application failure with code:
> {code}
> public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException {
> return internalNullSafeGet(rs, names, session, owner);
> }
> private Object internalNullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException {
> internalSessionImplementorUsingMethod(session);
> session.isTransactionInProgress();
> int result = rs.getInt( names[0] );
> if ( rs.wasNull() ) return null;
> return State.values()[result];
> }
> }
> {code}
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 2 months
[JBoss JIRA] (WFLY-11991) Add Hibernate ORM transformer option to transform any method parameter of type org.hibernate.engine.spi.SessionImplementor
by Scott Marlow (Jira)
[ https://issues.jboss.org/browse/WFLY-11991?page=com.atlassian.jira.plugin... ]
Scott Marlow reopened WFLY-11991:
---------------------------------
> Add Hibernate ORM transformer option to transform any method parameter of type org.hibernate.engine.spi.SessionImplementor
> --------------------------------------------------------------------------------------------------------------------------
>
> Key: WFLY-11991
> URL: https://issues.jboss.org/browse/WFLY-11991
> Project: WildFly
> Issue Type: Bug
> Components: JPA / Hibernate
> Reporter: Scott Marlow
> Assignee: Scott Marlow
> Priority: Major
> Fix For: 17.0.0.Beta1
>
> Attachments: afterchange.zip, beforechange.zip
>
>
> The idea is to transform any class method parameter of type org.hibernate.engine.spi.SessionImplementor, in user application, to instead use type org.hibernate.engine.spi.SharedSessionContractImplementor.
> The test case (change) is for this enhancement is [https://github.com/simkam/wildfly/compare/hibernate_transformer].
> The test case change is adding an internalNullSafeGet method that should also be transformed to use the SharedSessionContractImplementor type but was not, which led to an application failure with code:
> {code}
> public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException {
> return internalNullSafeGet(rs, names, session, owner);
> }
> private Object internalNullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException {
> internalSessionImplementorUsingMethod(session);
> session.isTransactionInProgress();
> int result = rs.getInt( names[0] );
> if ( rs.wasNull() ) return null;
> return State.values()[result];
> }
> }
> {code}
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 2 months
[JBoss JIRA] (WFLY-11991) Add Hibernate ORM transformer option to transform any method parameter of type org.hibernate.engine.spi.SessionImplementor
by Scott Marlow (Jira)
[ https://issues.jboss.org/browse/WFLY-11991?page=com.atlassian.jira.plugin... ]
Scott Marlow closed WFLY-11991.
-------------------------------
Resolution: Rejected
We eliminated the checking of method name/ parameter types, that needed this change.
[https://github.com/wildfly/wildfly/pull/12231] is the pull request that contains changes that eliminate the need for WFLY-11991.
> Add Hibernate ORM transformer option to transform any method parameter of type org.hibernate.engine.spi.SessionImplementor
> --------------------------------------------------------------------------------------------------------------------------
>
> Key: WFLY-11991
> URL: https://issues.jboss.org/browse/WFLY-11991
> Project: WildFly
> Issue Type: Bug
> Components: JPA / Hibernate
> Reporter: Scott Marlow
> Assignee: Scott Marlow
> Priority: Major
> Fix For: 17.0.0.Beta1
>
> Attachments: afterchange.zip, beforechange.zip
>
>
> The idea is to transform any class method parameter of type org.hibernate.engine.spi.SessionImplementor, in user application, to instead use type org.hibernate.engine.spi.SharedSessionContractImplementor.
> The test case (change) is for this enhancement is [https://github.com/simkam/wildfly/compare/hibernate_transformer].
> The test case change is adding an internalNullSafeGet method that should also be transformed to use the SharedSessionContractImplementor type but was not, which led to an application failure with code:
> {code}
> public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException {
> return internalNullSafeGet(rs, names, session, owner);
> }
> private Object internalNullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException {
> internalSessionImplementorUsingMethod(session);
> session.isTransactionInProgress();
> int result = rs.getInt( names[0] );
> if ( rs.wasNull() ) return null;
> return State.values()[result];
> }
> }
> {code}
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 2 months
[JBoss JIRA] (WFLY-11991) Add Hibernate ORM transformer option to transform any method parameter of type org.hibernate.engine.spi.SessionImplementor
by Scott Marlow (Jira)
[ https://issues.jboss.org/browse/WFLY-11991?page=com.atlassian.jira.plugin... ]
Scott Marlow commented on WFLY-11991:
-------------------------------------
we don't need this change any more, but in case we are interested in it in the future, below is some key parts from [https://github.com/scottmarlow/wildfly/commit/ba6b2918e65be46104fbc90b676...]
{code}
if (parentClassesAndInterfaces.contains("org/hibernate/usertype/CompositeUserType")) {
if (name.equals("nullSafeGet") &&
match(desc,"(Ljava/sql/ResultSet;[Ljava/lang/String;Lorg/hibernate/engine/spi/SessionImplementor;Ljava/lang/Object;)Ljava/lang/Object;")) {
desc = replaceSessionImplementor(desc);
} else if (name.equals("nullSafeSet") &&
match(desc,"(Ljava/sql/PreparedStatement;Ljava/lang/Object;ILorg/hibernate/engine/spi/SessionImplementor;)V")) {
desc = replaceSessionImplementor(desc);
} else if (name.equals("assemble") &&
match(desc,"(Ljava/io/Serializable;Lorg/hibernate/engine/spi/SessionImplementor;Ljava/lang/Object;)Ljava/lang/Object;")) {
desc = replaceSessionImplementor(desc);
} else if (name.equals("disassemble") &&
match(desc,"(Ljava/lang/Object;Lorg/hibernate/engine/spi/SessionImplementor;)Ljava/io/Serializable;")) {
desc = replaceSessionImplementor(desc);
} else if (name.equals("replace") &&
match(desc,"(Ljava/lang/Object;Ljava/lang/Object;Lorg/hibernate/engine/spi/SessionImplementor;Ljava/lang/Object;)Ljava/lang/Object;")) {
desc = replaceSessionImplementor(desc);
}
rewriteSessionImplementor = true;
}
{code}
{code}
private static boolean match(String desc, String check) {
Type[] descType = Type.getArgumentTypes(desc);
Type[] checkType = Type.getArgumentTypes(check);
if(checkType.length != descType.length) {
return false;
}
for(int looper=0; looper < checkType.length; looper++) {
if ( ! matchWildcard(descType[looper], checkType[looper]) &&
! checkType[looper].equals(descType[looper])) {
return false;
}
}
return true;
}
// return true if both parameter types are Objects and checkType is java.lang.Object (treat as match any object)
private static boolean matchWildcard(Type descType, Type checkType) {
return checkType.getDescriptor().startsWith("L") &&
descType.getDescriptor().startsWith("L") &&
checkType.getInternalName().equals("java/lang/Object");
}
{code}
> Add Hibernate ORM transformer option to transform any method parameter of type org.hibernate.engine.spi.SessionImplementor
> --------------------------------------------------------------------------------------------------------------------------
>
> Key: WFLY-11991
> URL: https://issues.jboss.org/browse/WFLY-11991
> Project: WildFly
> Issue Type: Bug
> Components: JPA / Hibernate
> Reporter: Scott Marlow
> Assignee: Scott Marlow
> Priority: Major
> Fix For: 17.0.0.Beta1
>
> Attachments: afterchange.zip, beforechange.zip
>
>
> The idea is to transform any class method parameter of type org.hibernate.engine.spi.SessionImplementor, in user application, to instead use type org.hibernate.engine.spi.SharedSessionContractImplementor.
> The test case (change) is for this enhancement is [https://github.com/simkam/wildfly/compare/hibernate_transformer].
> The test case change is adding an internalNullSafeGet method that should also be transformed to use the SharedSessionContractImplementor type but was not, which led to an application failure with code:
> {code}
> public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException {
> return internalNullSafeGet(rs, names, session, owner);
> }
> private Object internalNullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException {
> internalSessionImplementorUsingMethod(session);
> session.isTransactionInProgress();
> int result = rs.getInt( names[0] );
> if ( rs.wasNull() ) return null;
> return State.values()[result];
> }
> }
> {code}
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 2 months
[JBoss JIRA] (DROOLS-4064) Improve keyboard usability in Test Scenario
by Jozef Marko (Jira)
[ https://issues.jboss.org/browse/DROOLS-4064?page=com.atlassian.jira.plugi... ]
Jozef Marko commented on DROOLS-4064:
-------------------------------------
I expect the implementation will affect drools-tools team. please ask for review also drools-tools team.
> Improve keyboard usability in Test Scenario
> -------------------------------------------
>
> Key: DROOLS-4064
> URL: https://issues.jboss.org/browse/DROOLS-4064
> Project: Drools
> Issue Type: Enhancement
> Components: Scenario Simulation and Testing
> Reporter: Daniele Zonca
> Assignee: Daniele Zonca
> Priority: Major
> Labels: ScenarioSimulation, drools-tools
>
> Implement additional keyboard navigation's path to cover this use case:
> "When I use TAB the next cell is highlighted but it's not in edit mode, so I have to press enter to enter in edit mode. If I press TAB twice, I lose the cell focus (my browser bring the focus on the address bar!) I expect the same behavior of google sheet." ([~dmarrazzo])
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 2 months