Browse files

Bugfix: @hp_secret_key instead of @hp_account_meta_key required in st…

…orage.rb:186
  • Loading branch information...
1 parent 1496041 commit 99b1ae031d7a4b3ab42a068b84f1af0290925e7a @enterprise-rails enterprise-rails committed Jun 26, 2013
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/fog/hp/storage.rb
View
5 lib/fog/hp/storage.rb
@@ -180,9 +180,10 @@ def generate_object_temp_url(container, object, expires_secs, method)
signature = Digest::HMAC.hexdigest(hmac_body, @hp_account_meta_key, Digest::SHA1)
else
# Only works with 1.9+ Not compatible with 1.8.7
- # signed_string = Digest::HMAC.hexdigest(string_to_sign, @hp_secret_key, Digest::SHA1)
+ #signed_string = Digest::HMAC.hexdigest(string_to_sign, @hp_secret_key, Digest::SHA1)
+
# Compatible with 1.8.7 onwards
- hmac = OpenSSL::HMAC.new(@hp_account_meta_key, OpenSSL::Digest::SHA1.new)
+ hmac = OpenSSL::HMAC.new(@hp_secret_key, OpenSSL::Digest::SHA1.new)
signed_string = hmac.update(string_to_sign).hexdigest
signature = @hp_tenant_id.to_s + ":" + @hp_access_key.to_s + ":" + signed_string
signature = Fog::HP.escape(signature)

1 comment on commit 99b1ae0

@rupakg

@enterprise-rails The Digest::HMAC.hexdigest method is not compatible with 1.8.7, so please use the other variant as I did in HP's case below. Also, please run your tests against 1.8.7 as well.

Please sign in to comment.