You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by co...@apache.org on 2015/09/09 12:09:10 UTC
svn commit: r1701970 - in
/webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token:
KerberosClientExceptionAction.java KerberosServiceExceptionAction.java
Author: coheigea
Date: Wed Sep 9 10:09:10 2015
New Revision: 1701970
URL: http://svn.apache.org/r1701970
Log:
[WSS-552] - The KerberosServiceExceptionAction and KerberosClientExceptionAction do not support HP JDK. Thanks to Esin Yakub for the patch.
Modified:
webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/KerberosClientExceptionAction.java
webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/KerberosServiceExceptionAction.java
Modified: webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/KerberosClientExceptionAction.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/KerberosClientExceptionAction.java?rev=1701970&r1=1701969&r2=1701970&view=diff
==============================================================================
--- webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/KerberosClientExceptionAction.java (original)
+++ webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/KerberosClientExceptionAction.java Wed Sep 9 10:09:10 2015
@@ -42,7 +42,8 @@ public class KerberosClientExceptionActi
private static final boolean isJava5Or6 = javaVersion.startsWith("1.5") || javaVersion.startsWith("1.6");
private static final boolean isOracleJavaVendor = System.getProperty("java.vendor").startsWith("Oracle");
private static final boolean isIBMJavaVendor = System.getProperty("java.vendor").startsWith("IBM");
-
+ private static final boolean isHPJavaVendor = System.getProperty("java.vendor").startsWith("Hewlett-Packard");
+
private static final String SUN_JGSS_INQUIRE_TYPE_CLASS = "com.sun.security.jgss.InquireType";
private static final String SUN_JGSS_EXT_GSSCTX_CLASS = "com.sun.security.jgss.ExtendedGSSContext";
@@ -115,13 +116,13 @@ public class KerberosClientExceptionActi
krbCtx.setGssContext(secContext);
krbCtx.setKerberosToken(returnedToken);
- if (!isJava5Or6 && (isOracleJavaVendor || isIBMJavaVendor)) {
+ if (!isJava5Or6 && (isOracleJavaVendor || isIBMJavaVendor || isHPJavaVendor)) {
try {
@SuppressWarnings("rawtypes")
- Class inquireType = Class.forName(isOracleJavaVendor ? SUN_JGSS_INQUIRE_TYPE_CLASS : IBM_JGSS_INQUIRE_TYPE_CLASS);
+ Class inquireType = Class.forName(isIBMJavaVendor ? IBM_JGSS_INQUIRE_TYPE_CLASS : SUN_JGSS_INQUIRE_TYPE_CLASS);
@SuppressWarnings("rawtypes")
- Class extendedGSSContext = Class.forName(isOracleJavaVendor ? SUN_JGSS_EXT_GSSCTX_CLASS : IBM_JGSS_EXT_GSSCTX_CLASS);
+ Class extendedGSSContext = Class.forName(isIBMJavaVendor ? IBM_JGSS_EXT_GSSCTX_CLASS : SUN_JGSS_EXT_GSSCTX_CLASS);
@SuppressWarnings("unchecked")
Method inquireSecContext = extendedGSSContext.getMethod("inquireSecContext", inquireType);
Modified: webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/KerberosServiceExceptionAction.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/KerberosServiceExceptionAction.java?rev=1701970&r1=1701969&r2=1701970&view=diff
==============================================================================
--- webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/KerberosServiceExceptionAction.java (original)
+++ webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/KerberosServiceExceptionAction.java Wed Sep 9 10:09:10 2015
@@ -40,6 +40,7 @@ public class KerberosServiceExceptionAct
private static final boolean isJava5Or6 = javaVersion.startsWith("1.5") || javaVersion.startsWith("1.6");
private static final boolean isOracleJavaVendor = System.getProperty("java.vendor").startsWith("Oracle");
private static final boolean isIBMJavaVendor = System.getProperty("java.vendor").startsWith("IBM");
+ private static final boolean isHPJavaVendor = System.getProperty("java.vendor").startsWith("Hewlett-Packard");
private static final String SUN_JGSS_INQUIRE_TYPE_CLASS = "com.sun.security.jgss.InquireType";
private static final String SUN_JGSS_EXT_GSSCTX_CLASS = "com.sun.security.jgss.ExtendedGSSContext";
@@ -107,13 +108,13 @@ public class KerberosServiceExceptionAct
krbServiceCtx.setGssContext(secContext);
krbServiceCtx.setKerberosToken(returnedToken);
- if (!isJava5Or6 && (isOracleJavaVendor || isIBMJavaVendor)) {
+ if (!isJava5Or6 && (isOracleJavaVendor || isIBMJavaVendor || isHPJavaVendor)) {
try {
@SuppressWarnings("rawtypes")
- Class inquireType = Class.forName(isOracleJavaVendor ? SUN_JGSS_INQUIRE_TYPE_CLASS : IBM_JGSS_INQUIRE_TYPE_CLASS);
+ Class inquireType = Class.forName(isIBMJavaVendor ? IBM_JGSS_INQUIRE_TYPE_CLASS : SUN_JGSS_INQUIRE_TYPE_CLASS);
@SuppressWarnings("rawtypes")
- Class extendedGSSContext = Class.forName(isOracleJavaVendor ? SUN_JGSS_EXT_GSSCTX_CLASS : IBM_JGSS_EXT_GSSCTX_CLASS);
+ Class extendedGSSContext = Class.forName(isIBMJavaVendor ? IBM_JGSS_EXT_GSSCTX_CLASS : SUN_JGSS_EXT_GSSCTX_CLASS);
@SuppressWarnings("unchecked")
Method inquireSecContext = extendedGSSContext.getMethod(EXTENDED_JGSS_CONTEXT_INQUIRE_SEC_CONTEXT_METHOD_NAME, inquireType);