Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

com.sun.xml.ws.security.impl.PasswordDerivedKey's generate160BitKey() not hardcoding use of UTF-8 #377

Open
Tomas-Kraus opened this issue Jun 2, 2022 · 0 comments

Comments

@Tomas-Kraus
Copy link
Member

Hi, we're testing interoperability between CXF and Metro w.r.t. UsernameToken password-derived keys (http://www.jroller.com/gmazza/entry/usernametoken_messagelayer_encryption). Dan Kulp of the CXF team noticed that PasswordDerivedKey's generate160BitKey() method is not hardcoding use of UTF-8 when calling password.getBytes(), it looks like it should be password.getBytes("UTF-8") instead, as getBytes() by itself is platform-dependent (http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#getBytes().

According to line 386 of the UsernameToken profile spec: http://docs.oasis-open.org/wss/v1.1/wss-v1.1-spec-os-UsernameTokenProfile.pdf, the password is always UTF-8 encoded.

Environment

JDK 7 on Ubuntu Linux.

Affected Versions

[2.2.1-1]

Source: javaee/metro-wsit#1662
Author: glassfishrobot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant