~tribaal/txaws/xss-hardening

« back to all changes in this revision

Viewing changes to txaws/credentials.py

  • Committer: Thomas Hervé
  • Date: 2009-10-21 19:40:18 UTC
  • Revision ID: thomas@canonical.com-20091021194018-nbcgy745732s00xs
Default to HmacSHA256 instead of HmacSHA1: it's more secure and provides
compatibility with Eucalyptus [r=oubiwann]

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 
6
6
import os
7
7
 
8
 
from txaws.util import hmac_sha1
 
8
from txaws.util import hmac_sha256
9
9
 
10
10
 
11
11
__all__ = ["AWSCredentials"]
23
23
    @param secret_key: The secret key to use. If None the environment variable
24
24
        AWS_SECRET_ACCESS_KEY is consulted.
25
25
    """
26
 
 
 
26
 
27
27
    def __init__(self, access_key="", secret_key=""):
28
28
        self.access_key = access_key
29
29
        self.secret_key = secret_key
40
40
 
41
41
    def sign(self, bytes):
42
42
        """Sign some bytes."""
43
 
        return hmac_sha1(self.secret_key, bytes)
 
43
        return hmac_sha256(self.secret_key, bytes)