incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From muralire...@apache.org
Subject [2/50] [abbrv] git commit: refs/heads/gslb - [EC2 Query API] AttachVolume fails with 'Permission Denied: Invalid Signature' error.
Date Thu, 07 Feb 2013 07:44:02 GMT
[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/gslb
Commit: f18828d7d81901452f309b684fcd06ae054e13a0
Parents: 61f24d8
Author: Likitha Shetty <Likitha.Shetty@citrix.com>
Authored: Thu Jan 31 11:52:42 2013 -0800
Committer: Prachi Damle <prachi@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"); 
                 }


Mime
View raw message