e' un errore di configurazione in
<porta-applicativa nome="PA_WSS">
....
<response-flow>
devi disabilitare questa riga:
<parameter nome="encryptionKeyIdentifier" valore="X509KeyIdentifier" />
<!-- <parameter nome="encryptionKeyIdentifier" valore="X509KeyIdentifier" /> -->
altrimenti come vedi nel log non viene generata correttamente
la coppia issuer e numero seriale del certificato utilizzato per
criptare la chiave simmetrica di crittografia dei dati.
"Issuer/Serial data element missing"
la porta delegata genera correttamente
<wsse:SecurityTokenReference><ds:X509Data>
<ds:X509IssuerSerial>
<ds:X509IssuerName>CN=Andrea Manca,OU=Dev
Lab,O=Link.it,L=Pisa,C=IT,EMAILADDRESS=manca@link.it</ds:X509IssuerName>
<ds:X509SerialNumber>1174408419</ds:X509SerialNumber>
</ds:X509IssuerSerial>
</ds:X509Data></wsse:SecurityTokenReference>
ma la porta applicativa usa una modalità che la porta delegata non si aspetta:
<wsse:SecurityTokenReference><wsse:KeyIdentifier
EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"
ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3">MIICgjCCAesCBEYADGgwDQYJKoZIhvcNAQEFBQAwgYcxHDAaBgkqhkiG9w0BCQEWDW1hbmNhQGxpbmsuaXQxCzAJBgNVBAYTAklUMRAwDgYDVQQIEwdUb3NjYW5hMQ0wCwYDVQQHEwRQaXNhMRAwDgYDVQQKEwdMaW5rLml0MRAwDgYDVQQLEwdEZXYgTGFiMRUwEwYDVQQDEwxBbmRyZWEgTWFuY2EwHhcNMDcwMzIwMTYzMTM2WhcNMDgwMzE0MTYzMTM2WjCBhzEcMBoGCSqGSIb3DQEJARYNbWFuY2FAbGluay5pdDELMAkGA1UEBhMCSVQxEDAOBgNVBAgTB1Rvc2NhbmExDTALBgNVBAcTBFBpc2ExEDAOBgNVBAoTB0xpbmsuaXQxEDAOBgNVBAsTB0RldiBMYWIxFTATBgNVBAMTDEFuZHJlYSBNYW5jYTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAh2lxg8kprdhSSD4z4nHU732CH9hTGOzaglDRxsn3xRZt9g48ymAV13eUD8xnWZL5o27oymS6JgfHGhcXMVuMiGSSE7ifRO2m6tVPsww4oOo91F+EqZKMPrKwULvjRpPhITjub3LCPGDOw7yRJg66+JfcQILaa7F7ZbSRlI2kweMCAwEAATANBgkqhkiG9w0BAQUFAAOBgQAb12JeeLixsvFOwhthr3IhH2uHMGOXcJeu+2RqKAhRXdbYke/NL2oeoCayF09E+cfvO9VCbW0u+/A2HW1/zvqLS2E9oGGAdFeQQQHl+ICfKGxDGUzRLqTROYYWZLU3JjsiyGFk8ffvsfGK/axOc0AEyk3kevQK/8oDIJgBzT2jDA==</wsse:KeyIdentifier></wsse!
:SecurityTokenReference>
Non capisco perchè ti funzionasse prima, ma era sbagliato comunque.
Ho visto che ho lasciato delle System.out che avevo messo per prova nel codice
di wss4j,
domani ti mando un build pulito.
Ciao
Luciano
-----Messaggio originale-----
Da: sviluppatori-bounces@openspcoop.org per conto di Andrea Poli
Inviato: ven 08/02/2008 18.28
A: sviluppatori@openspcoop.org
Oggetto: Re: [OpenSPCoop-Dev] identifcato e risolto bug nella gestione diWSS4J
dei certificati con "key usage extensions" cheimpediva Encryption con
certificato standard
Montebove Luciano wrote:
> In vista della qualificazione della porta OpenSPCoop 1.0 ho ripreso i
> test della WS-Security utilizzando invece di quelli self-signed
> distribuiti nella 1.0RC2.0 dei certificati simili a quelli rilasciati
> da una authority ufficiale che includono anche le estensioni
> sull'utilizzo delle chiavi.
> A questo punto la Encrytion di WSS4J 1.5.0 ha smesso di funzionare
> perché sono incappato in questo problema:
>
> http://markmail.org/message/gicfqxxjxrvu3io6
>
> che purtroppo non è risolto nemmeno nell'ultima release 1.5.3 di WSS4J.
>
> Rovistando in Google ho poi trovato che nell'SVN di WSS4J qualcuno
> aveva fornito una soluzione per la release 1.5.3 anche se non ancora
> rilasciata in un build ufficiale:
>
> http://www.nabble.com/svn-commit:-r587074----webservices-wss4j-trunk-src-org-apache-ws-security-message-WSSecEncryptedKey.java-td13343367.html
>
>
>
> che si può vedere qui:
>
> http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecEncryptedKey.java?rev=587074&r1=587073&r2=587074&view=diff
>
>
>
> Questa modifica l'ho quindi applicata alla versione sorgente 1.5.3
> ufficiale e ricompilato il tutto e sostituito la libreria wss4j in
> openspcoop con questa versione.
>
> Dai test condotti sembra ora funzionare sia con i certificati
> self-signed che con quelli della mia authority contenenti estensioni
> sull'uso delle chiavi.
>
> Nello zip allegato la libreria wss4j 1.5.3 patchata ed il build.xml di
> openspcoop con i riferimenti aggiornati.
>
>
Ho provato ad apportare la modifica che hai suggerito alla
distribuzione, e ho lanciato una batteria di test, tra cui quelli
richiamabili dalle porte delegate 'WSSTimestamp', 'WSSEncrypt',
'WSSSignature' e 'WSS'
presenti con le configurazioni di esempio di OpenSPCoop disponibili in
deploy/pdd/config_file/config.xml e
deploy/pdd/config_file/registroServizi.xml
Putroppo il test con la porta delegata WSS, che raggruppa tutte e 3 le
funzionalita' non e' andato a buon fine.
Puoi verificarne il motivo?
Ti riporto di seguito gli errori riscontrati.
openspcoop.log, modulo sbustamento risposte (risposta sincrona ritornata
alla porta delegata):
Eccezione con codice [EGOV_IT_200] - ErroreIntestazioneMessaggioSPCoop,
descrizione errore : Generatosi errore durante il processamento
WS-Security(Sender) [code:
{http://schemas.xmlsoap.org/soap/envelope/}Server.generalException]
WSDoAllReceiverNoActionOrderCheck: security processing failed; nested
exception is:
org.apache.ws.security.WSSecurityException: Referenced security
token could not be retrieved. (Reference "Issuer/Serial data element
missing")
server.log:
18:26:26,265 INFO [STDOUT] Alias [pd]
18:26:26,456 INFO [Reference] Verification successful for URI
"#id-32437185"
18:26:26,458 INFO [Reference] Verification successful for URI
"#id-25877848"
18:26:26,474 INFO [STDOUT] In EncryptedKeyProcessor secRef=
<wsse:SecurityTokenReference><ds:X509Data>
<ds:X509IssuerSerial>
<ds:X509IssuerName>CN=Andrea Manca,OU=Dev
Lab,O=Link.it,L=Pisa,C=IT,EMAILADDRESS=manca@link.it</ds:X509IssuerName>
<ds:X509SerialNumber>1174408419</ds:X509SerialNumber>
</ds:X509IssuerSerial>
</ds:X509Data></wsse:SecurityTokenReference>
18:26:26,474 INFO [STDOUT] In EncryptedKeyProcessor crypto=
org.apache.ws.security.components.crypto.Merlin@1e79b10
18:26:26,475 INFO [STDOUT] In EncryptedKeyProcessor
getX509IssuerSerialAlias= pa
18:26:26,476 INFO [STDOUT] In EncryptedKeyProcessor alias = pa
18:26:26,476 INFO [STDOUT] Alias [pa]
18:26:26,515 INFO [STDOUT] Autorizzo servizio per: CN=Andrea Manca,
OU=Dev Lab, O=Link.it, L=Pisa, ST=Toscana, C=IT,
EMAILADDRESS=manca@link.it|MinisteroFruitore|RichiestaStatoAvanzamento|WSS|
18:26:26,855 INFO [STDOUT] Alias [pa]
18:26:26,942 INFO [Reference] Verification successful for URI "#id-3908274"
18:26:26,943 INFO [Reference] Verification successful for URI
"#id-13327842"
18:26:26,944 INFO [Reference] Verification successful for URI
"#Timestamp-10094378"
18:26:26,950 INFO [STDOUT] In EncryptedKeyProcessor secRef=
<wsse:SecurityTokenReference><wsse:KeyIdentifier
EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"
ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3">MIICgjCCAesCBEYADGgwDQYJKoZIhvcNAQEFBQAwgYcxHDAaBgkqhkiG9w0BCQEWDW1hbmNhQGxpbmsuaXQxCzAJBgNVBAYTAklUMRAwDgYDVQQIEwdUb3NjYW5hMQ0wCwYDVQQHEwRQaXNhMRAwDgYDVQQKEwdMaW5rLml0MRAwDgYDVQQLEwdEZXYgTGFiMRUwEwYDVQQDEwxBbmRyZWEgTWFuY2EwHhcNMDcwMzIwMTYzMTM2WhcNMDgwMzE0MTYzMTM2WjCBhzEcMBoGCSqGSIb3DQEJARYNbWFuY2FAbGluay5pdDELMAkGA1UEBhMCSVQxEDAOBgNVBAgTB1Rvc2NhbmExDTALBgNVBAcTBFBpc2ExEDAOBgNVBAoTB0xpbmsuaXQxEDAOBgNVBAsTB0RldiBMYWIxFTATBgNVBAMTDEFuZHJlYSBNYW5jYTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAh2lxg8kprdhSSD4z4nHU732CH9hTGOzaglDRxsn3xRZt9g48ymAV13eUD8xnWZL5o27oymS6JgfHGhcXMVuMiGSSE7ifRO2m6tVPsww4oOo91F+EqZKMPrKwULvjRpPhITjub3LCPGDOw7yRJg66+JfcQILaa7F7ZbSRlI2kweMCAwEAATANBgkqhkiG9w0BAQUFAAOBgQAb12JeeLixsvFOwhthr3IhH2uHMGOXcJeu+2RqKAhRXdbYke/NL2oeoCayF09E+cfvO9VCbW0u+/A2HW1/zvqLS2E9oGGAdFeQQQHl+ICfKGxDGUzRLqTROYYWZLU3JjsiyGFk8ffvsfGK/axOc0AEyk3kevQK/8oDIJgBzT2jDA==</wsse:KeyIdentifier></wsse!
:SecurityTokenReference>
18:26:26,950 INFO [STDOUT] In EncryptedKeyProcessor crypto=
org.apache.ws.security.components.crypto.Merlin@15e236a
18:26:26,981 ERROR [STDERR] org.apache.ws.security.WSSecurityException:
Referenced security token could not be retrieved. (Reference
"Issuer/Serial data element missing")
18:26:26,982 ERROR [STDERR] at
org.apache.ws.security.message.token.SecurityTokenReference.getIssuerSerial(SecurityTokenReference.java:461)
18:26:26,982 ERROR [STDERR] at
org.apache.ws.security.message.token.SecurityTokenReference.getX509IssuerSerialAlias(SecurityTokenReference.java:432)
18:26:26,982 ERROR [STDERR] at
org.apache.ws.security.processor.EncryptedKeyProcessor.handleEncryptedKey(EncryptedKeyProcessor.java:171)
18:26:26,982 ERROR [STDERR] at
org.apache.ws.security.processor.EncryptedKeyProcessor.handleEncryptedKey(EncryptedKeyProcessor.java:87)
18:26:26,982 ERROR [STDERR] at
org.apache.ws.security.processor.EncryptedKeyProcessor.handleToken(EncryptedKeyProcessor.java:76)
18:26:26,982 ERROR [STDERR] at
org.apache.ws.security.WSSecurityEngine.processSecurityHeader(WSSecurityEngine.java:284)
18:26:26,982 ERROR [STDERR] at
org.apache.ws.security.WSSecurityEngine.processSecurityHeader(WSSecurityEngine.java:206)
18:26:26,982 ERROR [STDERR] at
org.openspcoop.wssecurity.WSDoAllReceiverNoActionOrderCheck.invoke(WSDoAllReceiverNoActionOrderCheck.java:176)
18:26:26,982 ERROR [STDERR] at
org.openspcoop.wssecurity.WSSReceiver.process(WSSReceiver.java:100)
18:26:26,982 ERROR [STDERR] at
org.openspcoop.egov.ValidatoreSPCoop.validazioneSemantica(ValidatoreSPCoop.java:224)
18:26:26,982 ERROR [STDERR] at
org.openspcoop.pdd.mdb.InoltroBusteEGov.onMessage(InoltroBusteEGov.java:1057)
18:26:26,982 ERROR [STDERR] at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
18:26:26,982 ERROR [STDERR] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
18:26:26,982 ERROR [STDERR] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
18:26:26,982 ERROR [STDERR] at
java.lang.reflect.Method.invoke(Method.java:585)
18:26:26,982 ERROR [STDERR] at
org.jboss.invocation.Invocation.performCall(Invocation.java:359)
18:26:26,982 ERROR [STDERR] at
org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.java:495)
18:26:26,982 ERROR [STDERR] at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
18:26:26,983 ERROR [STDERR] at
org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:116)
18:26:26,983 ERROR [STDERR] at
org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
18:26:26,983 ERROR [STDERR] at
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
18:26:26,983 ERROR [STDERR] at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
18:26:26,983 ERROR [STDERR] at
org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
18:26:26,983 ERROR [STDERR] at
org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:109)
18:26:26,983 ERROR [STDERR] at
org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
18:26:26,983 ERROR [STDERR] at
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
18:26:26,983 ERROR [STDERR] at
org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:402)
18:26:26,983 ERROR [STDERR] at
org.jboss.ejb.Container.invoke(Container.java:960)
18:26:26,983 ERROR [STDERR] at
org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:987)
18:26:26,983 ERROR [STDERR] at
org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1287)
18:26:26,983 ERROR [STDERR] at
org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:266)
18:26:26,983 ERROR [STDERR] at
org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:891)
18:26:26,983 ERROR [STDERR] at
org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:170)
18:26:26,983 ERROR [STDERR] at
org.jboss.mq.SpySession.run(SpySession.java:323)
18:26:26,983 ERROR [STDERR] at
org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:194)
18:26:26,983 ERROR [STDERR] at
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
18:26:26,984 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
Andrea.
_______________________________________________
Sviluppatori mailing list
Sviluppatori@openspcoop.org
http://www.openspcoop.org/mailman/listinfo/sviluppatori
<<winmail.dat>>
|