diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2013-10-18 20:59:25 -0500 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2013-10-18 20:59:25 -0500 |
commit | 3b7730cf90c6a5114391d2d5a2ccc1cdb448da9e (patch) | |
tree | f0dde11f18ffa325f1c6a6cadca433a8c30c4199 | |
parent | ba3b471e4b0f56e65acdb9d5daf64eb726d9c371 (diff) | |
download | cryptography-3b7730cf90c6a5114391d2d5a2ccc1cdb448da9e.tar.gz cryptography-3b7730cf90c6a5114391d2d5a2ccc1cdb448da9e.tar.bz2 cryptography-3b7730cf90c6a5114391d2d5a2ccc1cdb448da9e.zip |
change name to str
-rw-r--r-- | cryptography/bindings/openssl/api.py | 4 | ||||
-rw-r--r-- | cryptography/primitives/hashes.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/cryptography/bindings/openssl/api.py b/cryptography/bindings/openssl/api.py index 84458367..cf3389d2 100644 --- a/cryptography/bindings/openssl/api.py +++ b/cryptography/bindings/openssl/api.py @@ -141,12 +141,12 @@ class API(object): def supports_hash(self, hash_cls): return (self.ffi.NULL != - self.lib.EVP_get_digestbyname(hash_cls.name)) + self.lib.EVP_get_digestbyname(hash_cls.name.encode("ascii"))) def create_hash_context(self, hashobject): ctx = self.lib.EVP_MD_CTX_create() ctx = self.ffi.gc(ctx, self.lib.EVP_MD_CTX_destroy) - evp_md = self.lib.EVP_get_digestbyname(hashobject.name) + evp_md = self.lib.EVP_get_digestbyname(hashobject.name.encode("ascii")) assert evp_md != self.ffi.NULL res = self.lib.EVP_DigestInit_ex(ctx, evp_md, self.ffi.NULL) assert res != 0 diff --git a/cryptography/primitives/hashes.py b/cryptography/primitives/hashes.py index f5cf135a..d74287f9 100644 --- a/cryptography/primitives/hashes.py +++ b/cryptography/primitives/hashes.py @@ -43,6 +43,6 @@ class BaseHash(object): class SHA1(BaseHash): - name = b"sha1" + name = "sha1" digest_size = 20 block_size = 64 |