File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ def _is_unicode(val):
55
55
return (type (val ) == _TYPE_UNICODE )
56
56
57
57
58
- def encode_unicode_string (unicode_string ):
58
+ def _unicode_string_to_utf8_bytes (unicode_string ):
59
59
"""Convert a unicode string value to bytes."""
60
60
61
61
return codecs .encode (unicode_string , 'utf8' )
Original file line number Diff line number Diff line change 44
44
import time
45
45
46
46
from mig .shared .base import force_utf8 , mask_creds , string_snippet
47
- from mig .shared .compat import encode_unicode_string
47
+ from mig .shared .compat import _unicode_string_to_utf8_bytes
48
48
from mig .shared .defaults import keyword_auto , RESET_TOKEN_TTL
49
49
50
50
@@ -119,7 +119,7 @@ def best_crypt_salt(configuration):
119
119
def make_hash (password , _urandom = urandom ):
120
120
"""Generate a random salt and return a new hash for the password."""
121
121
salt = b64encode (_urandom (SALT_LENGTH ))
122
- password_bytes = encode_unicode_string (password )
122
+ password_bytes = _unicode_string_to_utf8_bytes (password )
123
123
password_hashed = hashlib .pbkdf2_hmac (HASH_FUNCTION ,
124
124
password_bytes , salt ,
125
125
COST_FACTOR , KEY_LENGTH )
You can’t perform that action at this time.
0 commit comments