aboutsummaryrefslogtreecommitdiffstats
path: root/util-src
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-11-29 17:58:45 +0100
committerKim Alvefur <zash@zash.se>2020-11-29 17:58:45 +0100
commitae14dc12208406f54c3ac260dc1dfe701e77f3a3 (patch)
tree3521e985e7949acfcd08ce022b47c149055ba9a3 /util-src
parent54f8ca81f427db3ae9624f9ab5ebd0a566f63013 (diff)
downloadprosody-ae14dc12208406f54c3ac260dc1dfe701e77f3a3.tar.gz
prosody-ae14dc12208406f54c3ac260dc1dfe701e77f3a3.zip
util.hashes: Expose sha224 and sha384 HMAC functions
For completeness and consistency with set of plain hash functions
Diffstat (limited to 'util-src')
-rw-r--r--util-src/hashes.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/util-src/hashes.c b/util-src/hashes.c
index 6b7a28d8..00661531 100644
--- a/util-src/hashes.c
+++ b/util-src/hashes.c
@@ -169,10 +169,18 @@ static int Lhmac_sha1(lua_State *L) {
return Levp_hmac(L, EVP_sha1());
}
+static int Lhmac_sha224(lua_State *L) {
+ return Levp_hmac(L, EVP_sha224());
+}
+
static int Lhmac_sha256(lua_State *L) {
return Levp_hmac(L, EVP_sha256());
}
+static int Lhmac_sha384(lua_State *L) {
+ return Levp_hmac(L, EVP_sha384());
+}
+
static int Lhmac_sha512(lua_State *L) {
return Levp_hmac(L, EVP_sha512());
}
@@ -236,7 +244,9 @@ static const luaL_Reg Reg[] = {
{ "sha512", Lsha512 },
{ "md5", Lmd5 },
{ "hmac_sha1", Lhmac_sha1 },
+ { "hmac_sha224", Lhmac_sha224 },
{ "hmac_sha256", Lhmac_sha256 },
+ { "hmac_sha384", Lhmac_sha384 },
{ "hmac_sha512", Lhmac_sha512 },
{ "hmac_md5", Lhmac_md5 },
{ "scram_Hi_sha1", Lpbkdf2_sha1 }, /* COMPAT */