diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2016-09-17 21:41:20 -0500 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2016-09-17 22:41:20 -0400 |
commit | 8825f7fb639a8beadeb9d91e290eabd6a9e1f02c (patch) | |
tree | 98dead72eedfd6aa45212f97797949b4c8bce8b8 | |
parent | ecc3d9642a7f6d862b4cac77e73d67266f5763b8 (diff) | |
download | py-bcrypt-git-8825f7fb639a8beadeb9d91e290eabd6a9e1f02c.tar.gz |
we should use the right type for our buffers. fixes a cffi warning (#92)
-rw-r--r-- | src/bcrypt/__init__.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bcrypt/__init__.py b/src/bcrypt/__init__.py index abc9d75..cd779a6 100644 --- a/src/bcrypt/__init__.py +++ b/src/bcrypt/__init__.py @@ -47,7 +47,7 @@ def gensalt(rounds=12, prefix=b"2b"): raise ValueError("Invalid rounds") salt = os.urandom(16) - output = _bcrypt.ffi.new("unsigned char[]", 30) + output = _bcrypt.ffi.new("char[]", 30) _bcrypt.lib.encode_base64(output, salt, len(salt)) return ( @@ -79,7 +79,7 @@ def hashpw(password, salt): # passing it into the C library. original_salt, salt = salt, _normalize_re.sub(b"$2b$", salt) - hashed = _bcrypt.ffi.new("unsigned char[]", 128) + hashed = _bcrypt.ffi.new("char[]", 128) retval = _bcrypt.lib.bcrypt_hashpass(password, salt, hashed, len(hashed)) if retval != 0: |