geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r548493 - /geronimo/server/trunk/modules/geronimo-corba/src/main/java/org/apache/geronimo/corba/security/ServerSecurityInterceptor.java
Date Mon, 18 Jun 2007 21:09:59 GMT
Author: djencks
Date: Mon Jun 18 14:09:58 2007
New Revision: 548493

URL: http://svn.apache.org/viewvc?view=rev&rev=548493
Log:
GERONIMO-2687 Always send back a SAS component, but don't expose a default subject

Modified:
    geronimo/server/trunk/modules/geronimo-corba/src/main/java/org/apache/geronimo/corba/security/ServerSecurityInterceptor.java

Modified: geronimo/server/trunk/modules/geronimo-corba/src/main/java/org/apache/geronimo/corba/security/ServerSecurityInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-corba/src/main/java/org/apache/geronimo/corba/security/ServerSecurityInterceptor.java?view=diff&rev=548493&r1=548492&r2=548493
==============================================================================
--- geronimo/server/trunk/modules/geronimo-corba/src/main/java/org/apache/geronimo/corba/security/ServerSecurityInterceptor.java
(original)
+++ geronimo/server/trunk/modules/geronimo-corba/src/main/java/org/apache/geronimo/corba/security/ServerSecurityInterceptor.java
Mon Jun 18 14:09:58 2007
@@ -208,22 +208,25 @@
     }
 
     protected SASContextBody generateContextEstablished(Subject identity, long contextId,
boolean stateful) {
-        SASContextBody reply = new SASContextBody();
-
         byte[] finalContextToken = null;
-        Set credentials = identity.getPrivateCredentials(FinalContextToken.class);
-        if (!credentials.isEmpty()) {
-            try {
-                FinalContextToken token = (FinalContextToken) credentials.iterator().next();
-                finalContextToken = token.getToken();
-                token.destroy();
-            } catch (DestroyFailedException e) {
-                // do nothing
+        if (identity != null) {
+            Set credentials = identity.getPrivateCredentials(FinalContextToken.class);
+            if (!credentials.isEmpty()) {
+                try {
+                    FinalContextToken token = (FinalContextToken) credentials.iterator().next();
+                    finalContextToken = token.getToken();
+                    token.destroy();
+                } catch (DestroyFailedException e) {
+                    // do nothing
+                }
             }
         }
-        if (finalContextToken == null) finalContextToken = new byte[0];
-        reply.complete_msg(new CompleteEstablishContext(contextId, stateful, finalContextToken));
+        if (finalContextToken == null) {
+            finalContextToken = new byte[0];
+        }
 
+        SASContextBody reply = new SASContextBody();
+        reply.complete_msg(new CompleteEstablishContext(contextId, stateful, finalContextToken));
         return reply;
     }
 



Mime
View raw message