ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra/Deliantra/Util.pm
(Generate patch)

Comparing deliantra/Deliantra/Deliantra/Util.pm (file contents):
Revision 1.3 by root, Thu Nov 15 06:46:04 2012 UTC vs.
Revision 1.4 by root, Thu Nov 15 09:48:51 2012 UTC

13=over 4 13=over 4
14 14
15=cut 15=cut
16 16
17package Deliantra::Util; 17package Deliantra::Util;
18
19use common::sense;
18 20
19use Digest::SHA; 21use Digest::SHA;
20use Digest::SHA3; 22use Digest::SHA3;
21 23
22=item Deliantra::Util::hash_pw $cleartext 24=item Deliantra::Util::hash_pw $cleartext
47Authenticates a (hashed) password using the given nonce. 49Authenticates a (hashed) password using the given nonce.
48 50
49=cut 51=cut
50 52
51sub auth_pw($$) { 53sub 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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines