commit 0f1e5fb4586aa29d9b8d37d06614a9ac72a65521 parent 2ddadbbab11e09c88e310e30a6bcb03459b39ba3 Author: Drew DeVault <sir@cmpwn.com> Date: Sun, 1 May 2022 09:19:14 +0200 crypto::bcrypt: remove slice alloc workaround References: https://todo.sr.ht/~sircmpwn/hare/670 Signed-off-by: Drew DeVault <sir@cmpwn.com> Diffstat:
M | crypto/bcrypt/bcrypt.ha | | | 9 | +++------ |
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/crypto/bcrypt/bcrypt.ha b/crypto/bcrypt/bcrypt.ha @@ -133,16 +133,13 @@ fn load(input: []u8) (hash | errors::invalid) = { return errors::invalid; }; - const data = strings::toutf8(loadtok(&tok)?); + let data = strings::toutf8(loadtok(&tok)?); if (!(loadtok(&tok) is errors::invalid)) { return errors::invalid; }; - // XXX: There's some issue with alloc(data[..]...) - hash.salt = data[..ENCODED_SALT_SIZE]; - hash.salt = alloc(hash.salt...); - hash.hash = data[ENCODED_SALT_SIZE..]; - hash.hash = alloc(hash.hash...); + hash.salt = alloc(data[..ENCODED_SALT_SIZE]...); + hash.hash = alloc(data[ENCODED_SALT_SIZE..]...); return hash; };