ws-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Colm O hEigeartaigh (JIRA)" <>
Subject [jira] [Commented] (WSS-588) Server-side signature validation on client fail with only certificate CA is in the client truststore
Date Thu, 22 Sep 2016 15:25:21 GMT


Colm O hEigeartaigh commented on WSS-588:

Hi Claude,

This is not a bug. The signing certificate is referred to by the Issuer name of the certificate,
and the serial number of the certificate (not the serial of the issuer). This uniquely identifies
the certificate, as the serial number of the certificate is unique to each issuing entity.
If it referred to the serial of the issuer instead, then we wouldn't know which certificate
to use to validate the signature...

So in your case, where you don't have the certificate of the server in the keystore of the
client, you will need to include the certificate of the server in the request instead, by
using a different way of referencing the signing certificate other than IssuerSerial.


> Server-side signature validation on client fail with only certificate CA is in the client
> ----------------------------------------------------------------------------------------------------
>                 Key: WSS-588
>                 URL:
>             Project: WSS4J
>          Issue Type: Bug
>          Components: WSS4J Core
>    Affects Versions: 2.0.4
>         Environment: Servicemix server using cxf+wss4j for WS-Security purpose
>            Reporter: Libois Claude
>            Assignee: Colm O hEigeartaigh
>              Labels: easyfix
> I have a webservices which is secured by WS-Security+Policy.
> I currently use Signature only for server response.
> However I keep having the same error on client side:
> {code}
> Exception in thread "main" The signature or decryption
was invalid
> 	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(
> 	at com.sun.proxy.$Proxy34.submit(Unknown Source)
> 	at client.OffresEmploiClientUserToken.doCall(
> 	at client.OffresEmploiClientUserToken.main(
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> 	at java.lang.reflect.Method.invoke(
> 	at com.intellij.rt.execution.application.AppMain.main(
> Caused by: org.apache.wss4j.common.ext.WSSecurityException: The signature or decryption
was invalid
> 	at org.apache.wss4j.dom.processor.SignatureProcessor.handleToken(
> 	at org.apache.wss4j.dom.WSSecurityEngine.processSecurityHeader(
> 	at
> 	at
> 	at
> 	at
> 	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
> 	at org.apache.cxf.endpoint.ClientImpl.onMessage(
> 	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(
> 	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(
> 	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(
> 	at
> 	at
> 	at org.apache.cxf.transport.AbstractConduit.close(
> 	at org.apache.cxf.transport.http.HTTPConduit.close(
> 	at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(
> 	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
> 	at org.apache.cxf.endpoint.ClientImpl.doInvoke(
> 	at org.apache.cxf.endpoint.ClientImpl.invoke(
> 	at org.apache.cxf.endpoint.ClientImpl.invoke(
> 	at org.apache.cxf.endpoint.ClientImpl.invoke(
> 	at org.apache.cxf.frontend.ClientProxy.invokeSync(
> 	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(
> 	... 8 more
> {code}
> My client truststore is set so that I only have the signer CA.
> *I have noticed that if I set the signer certificate in the client truststore, it works
> I did a wireshark snoop and found that in the response part coming from the server:
> {code}
> <ds:X509Data><ds:X509IssuerSerial><ds:X509IssuerName>1.2.840.113549.1.9.1=#16107465737473736c40666f72656d2e6265,CN=XXXXX</ds:X509IssuerName><ds:X509SerialNumber>12428414237952637822</ds:X509SerialNumber></ds:X509IssuerSerial></ds:X509Data>
> {code}
> The problem is that  12428414237952637822 isn't the CA(issuer) serial number but the
signer serial number !
> I have digged a little bit into the code I have found something that looks weird to me
in the WSSecSignature class :
> {code}
> case WSConstants.ISSUER_SERIAL:
>                 String issuer = certs[0].getIssuerX500Principal().getName();
>                 java.math.BigInteger serialNumber = certs[0].getSerialNumber();
> {code}
> i'm wondering why in the last line we don't take the issuer serial number ????  ->
> {code} java.math.BigInteger serialNumber = certs[0].getIssuerX500Principal().getSerialNumber();{code}
> I can't see how this can work since the client compare the serial number provided with
the serial number of the CA in the Merlin class:
> {code}
> if (x509cert.getSerialNumber().compareTo(serialNumber) == 0)
> {code}
> Hope I was clear enough.
> I have checked in the latest version of the WSSecSignature and I still see the same line...
> Best Regards,
> Claude

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message