util/hmac.lua
author Matthew Wild <mwild1@gmail.com>
Mon, 20 Feb 2023 18:10:15 +0000
branch0.12
changeset 12898 0598d822614f
parent 9963 45caa32992b6
child 12565 adfb46a3e8a7
permissions -rw-r--r--
mod_websocket: Fire pre-session-close event (fixes #1800) This event was added in a7c183bb4e64 and is required to make mod_smacks know that a session was intentionally closed and shouldn't be hibernated (see fcea4d9e7502). Because this was missing from mod_websocket's session.close(), mod_smacks would always attempt to hibernate websocket sessions even if they closed cleanly. That mod_websocket has its own copy of session.close() is something to fix another day (probably not in the stable branch). So for now this commit makes the minimal change to get things working again. Thanks to Damian and the Jitsi team for reporting.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1522
569d58d21612 Add copyright header to those files missing one
Matthew Wild <mwild1@gmail.com>
parents: 1516
diff changeset
     1
-- Prosody IM
2923
b7049746bd29 Update copyright headers for 2010
Matthew Wild <mwild1@gmail.com>
parents: 1522
diff changeset
     2
-- Copyright (C) 2008-2010 Matthew Wild
b7049746bd29 Update copyright headers for 2010
Matthew Wild <mwild1@gmail.com>
parents: 1522
diff changeset
     3
-- Copyright (C) 2008-2010 Waqas Hussain
5776
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5537
diff changeset
     4
--
1522
569d58d21612 Add copyright header to those files missing one
Matthew Wild <mwild1@gmail.com>
parents: 1516
diff changeset
     5
-- This project is MIT/X11 licensed. Please see the
569d58d21612 Add copyright header to those files missing one
Matthew Wild <mwild1@gmail.com>
parents: 1516
diff changeset
     6
-- COPYING file in the source package for more information.
569d58d21612 Add copyright header to those files missing one
Matthew Wild <mwild1@gmail.com>
parents: 1516
diff changeset
     7
--
569d58d21612 Add copyright header to those files missing one
Matthew Wild <mwild1@gmail.com>
parents: 1516
diff changeset
     8
5537
15464633d8fb util.hmac, util.hashes: Implement HMAC functions in C, and move to util.hashes
Florian Zeitz <florob@babelmonkeys.de>
parents: 3540
diff changeset
     9
-- COMPAT: Only for external pre-0.9 modules
15464633d8fb util.hmac, util.hashes: Implement HMAC functions in C, and move to util.hashes
Florian Zeitz <florob@babelmonkeys.de>
parents: 3540
diff changeset
    10
1456
3135cf40110d Added HMAC utility module
Dwayne Bent <dbb.0@liqd.org>
parents:
diff changeset
    11
local hashes = require "util.hashes"
3135cf40110d Added HMAC utility module
Dwayne Bent <dbb.0@liqd.org>
parents:
diff changeset
    12
9962
d879f2253c2d util.hmac: Reflow code
Kim Alvefur <zash@zash.se>
parents: 5776
diff changeset
    13
return {
d879f2253c2d util.hmac: Reflow code
Kim Alvefur <zash@zash.se>
parents: 5776
diff changeset
    14
	md5 = hashes.hmac_md5,
d879f2253c2d util.hmac: Reflow code
Kim Alvefur <zash@zash.se>
parents: 5776
diff changeset
    15
	sha1 = hashes.hmac_sha1,
d879f2253c2d util.hmac: Reflow code
Kim Alvefur <zash@zash.se>
parents: 5776
diff changeset
    16
	sha256 = hashes.hmac_sha256,
9963
45caa32992b6 util.hmac: Expose hmac-sha-512 too
Kim Alvefur <zash@zash.se>
parents: 9962
diff changeset
    17
	sha512 = hashes.hmac_sha512,
9962
d879f2253c2d util.hmac: Reflow code
Kim Alvefur <zash@zash.se>
parents: 5776
diff changeset
    18
};