You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wss4j-dev@ws.apache.org by "Colm O hEigeartaigh (JIRA)" <ji...@apache.org> on 2008/04/11 12:59:16 UTC

[jira] Commented: (WSS-49) Allow digested password when using SIGN_WITH_UT_KEY

    [ https://issues.apache.org/jira/browse/WSS-49?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12587923#action_12587923 ] 

Colm O hEigeartaigh commented on WSS-49:
----------------------------------------


This issue is a duplicate of:

https://issues.apache.org/jira/browse/WSS-83

Since a patch for WSS-83 has already been applied, this issue can be marked fixed and closed.

> Allow digested password when using SIGN_WITH_UT_KEY
> ---------------------------------------------------
>
>                 Key: WSS-49
>                 URL: https://issues.apache.org/jira/browse/WSS-49
>             Project: WSS4J
>          Issue Type: Improvement
>         Environment: Java client vs .NET WSE 2.0 SP3 server
>            Reporter: Nelis Bijl
>
> Signing with UsernameToken (.NET feature supported through the SIGN_WITH_UT_KEY flag) hardcodes the password to be 'plain text'.
> org.apache.ws.security.action.UsernameTokenSignedAction.java :
> ...
>         WSSecUsernameToken builder = new WSSecUsernameToken();
>         builder.setWsConfig(reqData.getWssConfig());
>         /* proposal: allow digested passwords when using UsernameToken signing
>          * 
>          * replace:
>          * 
>          * builder.setPasswordType(WSConstants.PASSWORD_TEXT);
>          * 
>          * with:
>          */
>         builder.setPasswordType(reqData.getPwType());
>         builder.setUserInfo(reqData.getUsername(), password);
>         builder.addCreated();
> ...
> In case of a digested password however the signing is not recognized as valid by .NET WSE 2.0. This is caused by the fact that 'org.apache.ws.security.message.token.UsernameToken.getSecretKey(int keylen, String labelString)' uses the digested password for hashing whereas the 'plain text' password should be used to satisfy .NET.
>     public byte[] getSecretKey(int keylen, String labelString) {
>         byte[] key = null;
>         try {
>             Mac mac = Mac.getInstance("HMACSHA1");
>             /* proposal: use 'plain text' password for hashing
>              * 
>              * replace:
>              *	
>              * byte[] password = getPassword().getBytes("UTF-8");
>              * 
>              * with:
>              */
>             byte[] password = plainTextPwd.getBytes("UTF-8");
> ...
> where plainTextPwd is a private String member that is set in 'setPassword'.
> These changes work for me. However I can not oversee the full impact. I hope this feature will be implemented because customers won't like to be needing customized JARs to call our webservice.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org