You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ki...@apache.org on 2013/02/01 07:11:33 UTC

[35/48] git commit: refs/heads/regions - [EC2 Query API] AttachVolume fails with 'Permission Denied: Invalid Signature' error.

[EC2 Query API] AttachVolume fails with 'Permission Denied: Invalid Signature' error.

https://reviews.apache.org/r/8480/

In AWSAPI while forming the signature to validate an API, url-encode every parameter name with UTF-8 encoding scheme.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/f18828d7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/f18828d7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/f18828d7

Branch: refs/heads/regions
Commit: f18828d7d81901452f309b684fcd06ae054e13a0
Parents: 61f24d8
Author: Likitha Shetty <Li...@citrix.com>
Authored: Thu Jan 31 11:52:42 2013 -0800
Committer: Prachi Damle <pr...@cloud.com>
Committed: Thu Jan 31 12:00:37 2013 -0800

----------------------------------------------------------------------
 .../com/cloud/bridge/service/EC2RestServlet.java   |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/f18828d7/awsapi/src/com/cloud/bridge/service/EC2RestServlet.java
----------------------------------------------------------------------
diff --git a/awsapi/src/com/cloud/bridge/service/EC2RestServlet.java b/awsapi/src/com/cloud/bridge/service/EC2RestServlet.java
index 91e08be..78e736f 100644
--- a/awsapi/src/com/cloud/bridge/service/EC2RestServlet.java
+++ b/awsapi/src/com/cloud/bridge/service/EC2RestServlet.java
@@ -1770,8 +1770,8 @@ public class EC2RestServlet extends HttpServlet {
                     String paramName = (String) params.nextElement();
                     // exclude the signature string obviously. ;)
                     if (paramName.equalsIgnoreCase("Signature")) continue;
-                    if (queryString == null) 
-                        queryString = paramName + "=" + request.getParameter(paramName);
+                    if (queryString == null)
+                        queryString = paramName + "=" + URLEncoder.encode(request.getParameter(paramName), "UTF-8"); 
                     else 
                         queryString = queryString + "&" + paramName + "=" + URLEncoder.encode(request.getParameter(paramName), "UTF-8"); 
                 }