diff options
| author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-01-19 22:13:26 -0800 |
|---|---|---|
| committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-01-19 22:13:26 -0800 |
| commit | 580e992dc0d95618d3e667e471dd1d6a7eb6e323 (patch) | |
| tree | c1ac99f2b6a33c89b19d44cc759ba26f52645f5f /cryptography | |
| parent | 5f60acba1ed893cc746aab3b8a653abfcef92b41 (diff) | |
| parent | defc7f0534914db1b72ad5dfa0250f4fabc3184a (diff) | |
| download | cryptography-580e992dc0d95618d3e667e471dd1d6a7eb6e323.tar.gz cryptography-580e992dc0d95618d3e667e471dd1d6a7eb6e323.tar.bz2 cryptography-580e992dc0d95618d3e667e471dd1d6a7eb6e323.zip | |
Merge pull request #487 from alex/install-cc-bindings-osx
On OS X at build time compile the CC bindings (+ style fixes for dh/dsa OpenSSL 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; """ |
