ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1489830 - /webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/kerberos/KerberosTokenDecoderImpl.java
Date Wed, 05 Jun 2013 12:07:07 GMT
Author: coheigea
Date: Wed Jun  5 12:07:07 2013
New Revision: 1489830

URL: http://svn.apache.org/r1489830
Log:
Don't throw an exception on an error decoding a secret key

Modified:
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/kerberos/KerberosTokenDecoderImpl.java

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/kerberos/KerberosTokenDecoderImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/kerberos/KerberosTokenDecoderImpl.java?rev=1489830&r1=1489829&r2=1489830&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/kerberos/KerberosTokenDecoderImpl.java
(original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/kerberos/KerberosTokenDecoderImpl.java
Wed Jun  5 12:07:07 2013
@@ -18,6 +18,9 @@ import java.util.Iterator;
 import java.util.Set;
 
 public class KerberosTokenDecoderImpl implements KerberosTokenDecoder {
+    
+    private static org.slf4j.Logger log =
+        org.slf4j.LoggerFactory.getLogger(KerberosTokenDecoderImpl.class);
 
     private static final String KERBEROS_OID = "1.2.840.113554.1.2.2";
 
@@ -64,7 +67,10 @@ public class KerberosTokenDecoderImpl im
         if (!decoded) {
             decodeServiceTicket();
         }
-        return encTicketPart.getSessionKey().getKeyValue();
+        if (encTicketPart != null && encTicketPart.getSessionKey() != null) {
+            return encTicketPart.getSessionKey().getKeyValue();
+        }
+        return null;
     }
 
     /**
@@ -85,7 +91,7 @@ public class KerberosTokenDecoderImpl im
             parseServiceTicket(serviceTicket);
             decoded = true;
         } catch (Exception e) {
-            throw new RuntimeException(e);
+            log.debug("Error retrieving a service ticket", e);
         }
     }
 



Mime
View raw message