… | |
… | |
13 | =over 4 |
13 | =over 4 |
14 | |
14 | |
15 | =cut |
15 | =cut |
16 | |
16 | |
17 | package Deliantra::Util; |
17 | package Deliantra::Util; |
|
|
18 | |
|
|
19 | use common::sense; |
18 | |
20 | |
19 | use Digest::SHA; |
21 | use Digest::SHA; |
20 | use Digest::SHA3; |
22 | use Digest::SHA3; |
21 | |
23 | |
22 | =item Deliantra::Util::hash_pw $cleartext |
24 | =item Deliantra::Util::hash_pw $cleartext |
… | |
… | |
47 | Authenticates a (hashed) password using the given nonce. |
49 | Authenticates a (hashed) password using the given nonce. |
48 | |
50 | |
49 | =cut |
51 | =cut |
50 | |
52 | |
51 | sub auth_pw($$) { |
53 | sub auth_pw($$) { |
52 | my ($pass, $nonce1, $nonce2) = @_; |
54 | my ($hash, $nonce1, $nonce2) = @_; |
53 | |
55 | |
54 | # simple HMAC application |
56 | # simple HMAC application |
55 | Digest::SHA3::sha3_512 $nonce1 . Digest::SHA3::sha3_512 $nonce2 . $hash |
57 | Digest::SHA3::sha3_512 $nonce1 . Digest::SHA3::sha3_512 $nonce2 . $hash |
56 | } |
58 | } |
57 | |
59 | |