You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by sa...@apache.org on 2012/03/01 14:25:54 UTC
svn commit: r1295556 - in /axis/axis2/java/sandesha/branches/1_6: ./
modules/interop/src/main/java/org/apache/sandesha2/interop/
modules/rampart-integration/src/main/java/org/apache/sandesha2/security/rampart/
Author: sagara
Date: Thu Mar 1 13:25:54 2012
New Revision: 1295556
URL: http://svn.apache.org/viewvc?rev=1295556&view=rev
Log:
Merged r1241032 to the 1.6 branch.
Modified:
axis/axis2/java/sandesha/branches/1_6/ (props changed)
axis/axis2/java/sandesha/branches/1_6/modules/interop/src/main/java/org/apache/sandesha2/interop/PWCallback.java
axis/axis2/java/sandesha/branches/1_6/modules/rampart-integration/src/main/java/org/apache/sandesha2/security/rampart/RampartBasedSecurityManager.java
Propchange: axis/axis2/java/sandesha/branches/1_6/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar 1 13:25:54 2012
@@ -1 +1 @@
-/axis/axis2/java/sandesha/trunk:1072332-1072333,1081570,1090216,1098145,1137383,1145793,1186431,1212832,1214978,1220960,1221487
+/axis/axis2/java/sandesha/trunk:1072332-1072333,1081570,1090216,1098145,1137383,1145793,1186431,1212832,1214978,1220960,1221487,1241032
Modified: axis/axis2/java/sandesha/branches/1_6/modules/interop/src/main/java/org/apache/sandesha2/interop/PWCallback.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/sandesha/branches/1_6/modules/interop/src/main/java/org/apache/sandesha2/interop/PWCallback.java?rev=1295556&r1=1295555&r2=1295556&view=diff
==============================================================================
--- axis/axis2/java/sandesha/branches/1_6/modules/interop/src/main/java/org/apache/sandesha2/interop/PWCallback.java (original)
+++ axis/axis2/java/sandesha/branches/1_6/modules/interop/src/main/java/org/apache/sandesha2/interop/PWCallback.java Thu Mar 1 13:25:54 2012
@@ -108,13 +108,13 @@ public class PWCallback implements Callb
if (pc.getUsage() == WSPasswordCallback.USERNAME_TOKEN_UNKNOWN) {
- if(pc.getIdentifer().equals("Ron") && pc.getPassword().equals("noR")) {
+ if(pc.getIdentifier().equals("Ron") && pc.getPassword().equals("noR")) {
return;
}
- if(pc.getIdentifer().equals("joe") && pc.getPassword().equals("eoj")) {
+ if(pc.getIdentifier().equals("joe") && pc.getPassword().equals("eoj")) {
return;
@@ -148,23 +148,23 @@ public class PWCallback implements Callb
pc.setKey(key);
- } else if(pc.getIdentifer().equals("alice")) {
+ } else if(pc.getIdentifier().equals("alice")) {
pc.setPassword("password");
- } else if(pc.getIdentifer().equals("bob")) {
+ } else if(pc.getIdentifier().equals("bob")) {
pc.setPassword("password");
- } else if(pc.getIdentifer().equals("Ron")) {
+ } else if(pc.getIdentifier().equals("Ron")) {
pc.setPassword("noR");
- } else if(pc.getIdentifer().equals("joe")) {
+ } else if(pc.getIdentifier().equals("joe")) {
pc.setPassword("eoj");
- } else if(pc.getIdentifer().equals("ip")) {
+ } else if(pc.getIdentifier().equals("ip")) {
pc.setPassword("password");
Modified: axis/axis2/java/sandesha/branches/1_6/modules/rampart-integration/src/main/java/org/apache/sandesha2/security/rampart/RampartBasedSecurityManager.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/sandesha/branches/1_6/modules/rampart-integration/src/main/java/org/apache/sandesha2/security/rampart/RampartBasedSecurityManager.java?rev=1295556&r1=1295555&r2=1295556&view=diff
==============================================================================
--- axis/axis2/java/sandesha/branches/1_6/modules/rampart-integration/src/main/java/org/apache/sandesha2/security/rampart/RampartBasedSecurityManager.java (original)
+++ axis/axis2/java/sandesha/branches/1_6/modules/rampart-integration/src/main/java/org/apache/sandesha2/security/rampart/RampartBasedSecurityManager.java Thu Mar 1 13:25:54 2012
@@ -91,8 +91,8 @@ public class RampartBasedSecurityManager
OMElement messagePart, MessageContext message)
throws SandeshaException {
- Vector results = null;
- if ((results = (Vector) message
+ List<WSHandlerResult> results = null;
+ if ((results = (List<WSHandlerResult>) message
.getProperty(WSHandlerConstants.RECV_RESULTS)) == null) {
String msg = SandeshaMessageHelper
.getMessage(SandeshaMessageKeys.noSecurityResults);
@@ -100,17 +100,17 @@ public class RampartBasedSecurityManager
} else {
boolean verified = false;
for (int i = 0; i < results.size() && !verified; i++) {
- WSHandlerResult rResult = (WSHandlerResult) results.get(i);
- Vector wsSecEngineResults = rResult.getResults();
+ WSHandlerResult rResult = results.get(i);
+ List<WSSecurityEngineResult> wsSecEngineResults = rResult.getResults();
for (int j = 0; j < wsSecEngineResults.size() && !verified; j++) {
- WSSecurityEngineResult wser = (WSSecurityEngineResult) wsSecEngineResults
+ WSSecurityEngineResult wser = wsSecEngineResults
.get(j);
- if (wser.getAction() == WSConstants.SIGN
- && wser.getPrincipal() != null) {
+ if ((Integer)wser.get(WSSecurityEngineResult.TAG_ACTION) == WSConstants.SIGN
+ && wser.get(WSSecurityEngineResult.TAG_PRINCIPAL) != null) {
// first verify the base token
- Principal principal = wser.getPrincipal();
+ Principal principal = (Principal)wser.get(WSSecurityEngineResult.TAG_PRINCIPAL);
if (principal instanceof WSDerivedKeyTokenPrincipal) {
//Get the id of the SCT that was used to create the DKT
String baseTokenId = ((WSDerivedKeyTokenPrincipal) principal)
@@ -145,9 +145,13 @@ public class RampartBasedSecurityManager
OMAttribute idattr = messagePart
.getAttribute(new QName(
WSConstants.WSU_NS, "Id"));
- verified = wser.getSignedElements()
+ String processedId = (String)wser.get(WSSecurityEngineResult.TAG_ID);
+
+ // Please review following code
+ verified = processedId.equals(idattr.getAttributeValue());
+ /*verified = wser.getSignedElements()
.contains(
- idattr.getAttributeValue());
+ idattr.getAttributeValue());*/
if (verified) {
break;
}