History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: XFIRE-952
Type: Bug Bug
Status: Closed Closed
Resolution: Cannot Reproduce
Priority: Major Major
Assignee: Tomasz Sztelak
Reporter: Gilles Delaby
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
XFire

Unsupported key transport encryption algorithm

Created: 17/Apr/07 03:51 AM   Updated: 22/Apr/07 11:10 AM
Component/s: None
Affects Version/s: 1.2.5
Fix Version/s: 1.2.6

Time Tracking:
Not Specified

Environment: JDK 1.5.11


 Description  « Hide
Hi,

I'm currently unable to encrypt my response messages using WS-Security.
I followed the instructions as explained here http://xfire.codehaus.org/WS-Security (installed Unlimited Strength Jurisdiction Policy Files and the Bouncy Castle security provider) but always receive the error here :

15594 [http-8080-Processor25] ERROR org.codehaus.xfire.service.binding.PostInvocationHandler - org.codehaus.xfire.fault.XFireFault: WSHandler: Encryption: error during message processingorg.apache.ws.security.WSSecurityException: An unsupported signature or encryption algorithm was used (unsupported key transport encryption algorithm: No such algorithm: http://www.w3.org/2001/04/xmlenc#rsa-1_5)
15594 [http-8080-Processor25] INFO org.codehaus.xfire.handler.DefaultFaultHandler - Fault occurred!
org.apache.ws.security.WSSecurityException: WSHandler: Encryption: error during message processingorg.apache.ws.security.WSSecurityException: An unsupported signature or encryption algorithm was used (unsupported key transport encryption algorithm: No such algorithm: http://www.w3.org/2001/04/xmlenc#rsa-1_5)
at org.apache.ws.security.action.EncryptionAction.execute(EncryptionAction.java:64)
at org.apache.ws.security.handler.WSHandler.doSenderAction(WSHandler.java:192)
at org.codehaus.xfire.security.wss4j.WSS4JOutHandler.invoke(WSS4JOutHandler.java:154)
at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
at org.codehaus.xfire.service.binding.PostInvocationHandler.invoke(PostInvocationHandler.java:36)
at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
at org.codehaus.xfire.transport.DefaultEndpoint.onReceive(DefaultEndpoint.java:64)
at org.codehaus.xfire.transport.AbstractChannel.receive(AbstractChannel.java:38)
at org.codehaus.xfire.transport.http.XFireServletController.invoke(XFireServletController.java:304)
at org.codehaus.xfire.transport.http.XFireServletController.doService(XFireServletController.java:129)
at org.codehaus.xfire.transport.http.XFireServlet.doPost(XFireServlet.java:116)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
at java.lang.Thread.run(Thread.java:595)

It really seems that the Bouncy Castle parameter into the java.security file is not taken into account.

Any idea ?
Thanks



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Tomasz Sztelak - 18/Apr/07 02:15 PM
Probably you have some problem with BC configuration, but to make sure can you post config file where you specify algorithm ?

Gilles Delaby - 19/Apr/07 02:29 AM
security properties file :
-------------------------------
org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
org.apache.ws.security.crypto.merlin.keystore.type=jks
org.apache.ws.security.crypto.merlin.keystore.password=keystorePass
org.apache.ws.security.crypto.merlin.alias.password=gilles
org.apache.ws.security.crypto.merlin.keystore.alias=gilles
org.apache.ws.security.crypto.merlin.file=serverStore.jks

java.security :
------------------
security.provider.1=sun.security.provider.Sun
security.provider.2=sun.security.rsa.SunRsaSign
security.provider.3=com.sun.net.ssl.internal.ssl.Provider
security.provider.4=com.sun.crypto.provider.SunJCE
security.provider.5=sun.security.jgss.SunProvider
security.provider.6=com.sun.security.sasl.Provider
security.provider.7=org.bouncycastle.jce.provider.BouncyCastleProvider

services.xml:
------------------
<beans xmlns="http://xfire.codehaus.org/config/1.0">
<service>
<name>AccessService</name>
<namespace>http://test.com/AccessService</namespace>
<serviceClass>com.test.services.access.IAccessService</serviceClass>
<implementationClass>com.test.services.access.AccessService</implementationClass>
<inHandlers>
<handler handlerClass="com.test.services.handler.ValidateUserTokenHandler"/>
<handler handlerClass="org.codehaus.xfire.util.dom.DOMInHandler"/>
<bean class="org.codehaus.xfire.security.wss4j.WSS4JInHandler" xmlns="">
<property name="properties">
<props>
<prop key="action">UsernameToken</prop>
<prop key="passwordCallbackClass">com.test.services.handler.ServerPasswordHandler</prop>
</props>
</property>
</bean>
</inHandlers>
<outHandlers>
<handler handlerClass="org.codehaus.xfire.util.dom.DOMOutHandler" />
<bean class="org.codehaus.xfire.security.wss4j.WSS4JOutHandler" xmlns="">
<property name="properties">
<props>
<prop key="action">Encrypt</prop>
<prop key="encryptionPropFile">server_outsecurity_enc.properties</prop>
<prop key="passwordCallbackClass">com.test.services.handler.ServerPasswordHandlerOut</prop>
</props>
</property>
</bean>
</outHandlers>
</service>
</beans>


Tomasz Sztelak - 20/Apr/07 02:48 PM
Config looks good, so you have problem with you environment :/ make sure you have BouncyCastle jar in you class path.
Try to run ws-sec example and check if will run w/o problems.

Tomasz Sztelak - 22/Apr/07 11:10 AM
If you still have problem, post it on mailing list.