mirror of
https://github.com/brunoos/luasec.git
synced 2025-07-12 22:14:23 +02:00
Add identity hint to PSK
This commit is contained in:
@ -764,6 +764,18 @@ static int set_server_psk_cb(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the PSK indentity hint.
|
||||
*/
|
||||
static int set_psk_identity_hint(lua_State *L)
|
||||
{
|
||||
p_context ctx = checkctx(L, 1);
|
||||
const char *hint = luaL_checkstring(L, 2);
|
||||
int ret = SSL_CTX_use_psk_identity_hint(ctx->context, hint);
|
||||
lua_pushboolean(L, ret);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Client callback to PSK.
|
||||
*/
|
||||
@ -882,6 +894,7 @@ static luaL_Reg funcs[] = {
|
||||
{"setdhparam", set_dhparam},
|
||||
{"setverify", set_verify},
|
||||
{"setoptions", set_options},
|
||||
{"setpskhint", set_psk_identity_hint},
|
||||
{"setserverpskcb", set_server_psk_cb},
|
||||
{"setclientpskcb", set_client_psk_cb},
|
||||
{"setmode", set_mode},
|
||||
|
Reference in New Issue
Block a user