Nova returns HTTP 400 for SignatureVersion=1 requests

Bug #720157 reported by Masanori Itoh
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Todd Willey

Bug Description

Some Amazon EC2 clients like HybridFox and tAWS (http://sourceforge.jp/projects/eclipse-aws/) useSignatureVersion=1, and
nova checks (implicitly?) assuming all requests are signed using SignatureVersion=2. The essential difference of version 1 and 2 is that version 1 requests do not contain SignatureMethod.

Thus, __call__ of class Requestify defined in NOVA_SRC/nova/api/ec2/__init__.py generates HTTP 400 for every SignatureVersion=1 request.

I would suggest the following fix, but maybe it's better checking SignatureVersion and pop SignatureMethod from only version2 request string.

I checked the attached patch for nova 645, but the issue is alive in also trunk HEAD.

Signed-off-by: Masanori Itoh <email address hidden>

=== modified file 'nova/api/ec2/__init__.py'
--- nova/api/ec2/__init__.py 2011-02-13 18:45:20 +0000
+++ nova/api/ec2/__init__.py 2011-02-16 15:46:34 +0000
@@ -204,7 +204,8 @@
             action = req.params['Action']
             for non_arg in non_args:
                 # Remove, but raise KeyError if omitted
- args.pop(non_arg)
+ if non_arg in args:
+ args.pop(non_arg)
         except:
             raise webob.exc.HTTPBadRequest()

Related branches

Revision history for this message
Masanori Itoh (itohm) wrote :
Revision history for this message
Todd Willey (xtoddx) wrote :

I've linked a branch that fixes this now. I decided to be more explicit and only ignore the SignatureMethod if we are on SignatureVersion=1. This lets other keys still raise exceptions, so we can continue to catch bad requests early. Please let me know if this doesn't fix your issue.

Thierry Carrez (ttx)
Changed in nova:
assignee: nobody → Todd Willey (xtoddx)
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
Masanori Itoh (itohm) wrote :

Hi Todd, Thierry,

Sorry for my very late response.
I checked Todd's code, and I completely agree with Todd's fix.
I ported Todd's fix to the current trunk (rev 752) and checked that the fix resolves my SignatureVersion issue.

lp:~itoumsn/nova/lp720157 is the ported fix branch to rev 752.

What should I do next?
Make a merge proposal?

Thanks in advance,
Masanori

Revision history for this message
Thierry Carrez (ttx) wrote :

The next step is to "propose the branch for merging" into lp:nova.

Masanori Itoh (itohm)
Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → 2011.2
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.