diff options
| author | Alex Gaynor <alex.gaynor@gmail.com> | 2014-01-19 23:44:31 -0600 |
|---|---|---|
| committer | Alex Gaynor <alex.gaynor@gmail.com> | 2014-01-19 23:44:31 -0600 |
| commit | defc7f0534914db1b72ad5dfa0250f4fabc3184a (patch) | |
| tree | c1ac99f2b6a33c89b19d44cc759ba26f52645f5f /cryptography | |
| parent | 5f60acba1ed893cc746aab3b8a653abfcef92b41 (diff) | |
| download | cryptography-defc7f0534914db1b72ad5dfa0250f4fabc3184a.tar.gz cryptography-defc7f0534914db1b72ad5dfa0250f4fabc3184a.tar.bz2 cryptography-defc7f0534914db1b72ad5dfa0250f4fabc3184a.zip | |
On OS X at build time compile the CC bindings
Diffstat (limited to 'cryptography')
| -rw-r--r-- | cryptography/hazmat/backends/commoncrypto/backend.py | 6 | ||||
| -rw-r--r-- | cryptography/hazmat/bindings/openssl/dh.py | 12 | ||||
| -rw-r--r-- | cryptography/hazmat/bindings/openssl/dsa.py | 15 |
3 files changed, 22 insertions, 11 deletions
diff --git a/cryptography/hazmat/backends/commoncrypto/backend.py b/cryptography/hazmat/backends/commoncrypto/backend.py index 58e57efb..603edc40 100644 --- a/cryptography/hazmat/backends/commoncrypto/backend.py +++ b/cryptography/hazmat/backends/commoncrypto/backend.py @@ -81,16 +81,18 @@ class Backend(object): def hash_supported(self, algorithm): try: self._hash_mapping[algorithm.name] - return True except KeyError: return False + else: + return True def hmac_supported(self, algorithm): try: self._supported_hmac_algorithms[algorithm.name] - return True except KeyError: return False + else: + return True def create_hash_ctx(self, algorithm): return _HashContext(self, algorithm) diff --git a/cryptography/hazmat/bindings/openssl/dh.py b/cryptography/hazmat/bindings/openssl/dh.py index edbe0e39..ecc62e98 100644 --- a/cryptography/hazmat/bindings/openssl/dh.py +++ b/cryptography/hazmat/bindings/openssl/dh.py @@ -17,10 +17,14 @@ INCLUDES = """ TYPES = """ typedef struct dh_st { - BIGNUM *p; // prime number (shared) - BIGNUM *g; // generator of Z_p (shared) - BIGNUM *priv_key; // private DH value x - BIGNUM *pub_key; // public DH value g^x + // prime number (shared) + BIGNUM *p; + // generator of Z_p (shared) + BIGNUM *g; + // private DH value x + BIGNUM *priv_key; + // public DH value g^x + BIGNUM *pub_key; ...; } DH; """ diff --git a/cryptography/hazmat/bindings/openssl/dsa.py b/cryptography/hazmat/bindings/openssl/dsa.py index 9068e057..609a33bf 100644 --- a/cryptography/hazmat/bindings/openssl/dsa.py +++ b/cryptography/hazmat/bindings/openssl/dsa.py @@ -17,11 +17,16 @@ INCLUDES = """ TYPES = """ typedef struct dsa_st { - BIGNUM *p; // prime number (public) - BIGNUM *q; // 160-bit subprime, q | p-1 (public) - BIGNUM *g; // generator of subgroup (public) - BIGNUM *priv_key; // private key x - BIGNUM *pub_key; // public key y = g^x + // prime number (public) + BIGNUM *p; + // 160-bit subprime, q | p-1 (public) + BIGNUM *q; + // generator of subgroup (public) + BIGNUM *g; + // private key x + BIGNUM *priv_key; + // public key y = g^x + BIGNUM *pub_key; ...; } DSA; """ |
