[java-shib-idp2 COMMIT] /branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml2/SAML2ECPP...

noreply at shibboleth.net noreply at shibboleth.net
Tue Feb 19 14:42:36 EST 2013


Author: scantor
Date: Tue Feb 19 14:42:35 2013
New Revision: 3138

URL: http://svn.shibboleth.net/view/java-shib-idp2?rev=3138&view=rev
Log:
SIDP-558: forgot to add GeneratedKey to response envelope

Modified:
    branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml2/SAML2ECPProfileHandler.java

Modified: branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml2/SAML2ECPProfileHandler.java
URL: http://svn.shibboleth.net/view/java-shib-idp2/branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml2/SAML2ECPProfileHandler.java?rev=3138&r1=3137&r2=3138&view=diff
==============================================================================
--- branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml2/SAML2ECPProfileHandler.java (original)
+++ branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml2/SAML2ECPProfileHandler.java Tue Feb 19 14:42:35 2013
@@ -66,7 +66,6 @@
 import edu.internet2.middleware.shibboleth.common.relyingparty.ProfileConfiguration;
 import edu.internet2.middleware.shibboleth.common.relyingparty.RelyingPartyConfiguration;
 import edu.internet2.middleware.shibboleth.common.relyingparty.provider.saml2.ECPConfiguration;
-import edu.internet2.middleware.shibboleth.idp.profile.saml2.SSOProfileHandler.SSORequestContext;
 
 import org.opensaml.ws.message.handler.BasicHandlerChain;
 import org.opensaml.ws.message.handler.Handler;
@@ -473,9 +472,7 @@
             advice.getChildren().add(cbOut);
         }
         GeneratedKey key = keyBuilder.buildObject();
-        byte[] buf = new byte[32];
-        prng.nextBytes(buf);
-        key.setValue(Base64.encode(buf));
+        key.setValue(((ECPRequestContext) requestContext).getGeneratedKey());
         advice.getChildren().add(key);
     }
     
@@ -490,11 +487,17 @@
         
         /** A channel bindings structure that matched. */
         private ChannelBindings matchedChannelBindings;
+        
+        /** Session key for GSS-API generated by IdP. */
+        private final String generatedKey;
         
         /** Constructor. */
         public ECPRequestContext() {
             spChannelBindings = new ArrayList<ChannelBindings>();
             clientChannelBindings = new ArrayList<ChannelBindings>();
+            byte[] buf = new byte[32];
+            prng.nextBytes(buf);
+            generatedKey = Base64.encode(buf);
         }
         
         /**
@@ -527,10 +530,18 @@
         /**
          * Set the verified channel bindings, if any.
          * 
-         * @cb a ChannelBindings element that matched
+         * @param cb a ChannelBindings element that matched
          */
         public void setMatchedChannelBindings(ChannelBindings cb) {
             matchedChannelBindings = cb;
+        }
+        
+        /**
+         * Get the session key generated by the IdP.
+         * @return the generated session key
+         */
+        public String getGeneratedKey() {
+            return generatedKey;
         }
     }
     
@@ -648,6 +659,11 @@
                     SOAPHelper.addSOAP11ActorAttribute(cbOut, ActorBearing.SOAP11_ACTOR_NEXT);
                     SOAPHelper.addHeaderBlock(msgContext, cbOut);
                 }
+                
+                GeneratedKey key = keyBuilder.buildObject();
+                key.setValue(((ECPRequestContext) msgContext).getGeneratedKey());
+                SOAPHelper.addSOAP11ActorAttribute(key, ActorBearing.SOAP11_ACTOR_NEXT);
+                SOAPHelper.addHeaderBlock(msgContext, key);
             }
         });
 



More information about the commits mailing list