mirror of
https://github.com/brunoos/luasec.git
synced 2024-12-28 05:18:21 +01:00
Report the actual TLS version used, not the version the cipher belongs
to.
This commit is contained in:
parent
063e8a8a5c
commit
1a75704ff0
@ -645,7 +645,8 @@ static int meth_info(lua_State *L)
|
|||||||
lua_pushstring(L, buf);
|
lua_pushstring(L, buf);
|
||||||
lua_pushnumber(L, bits);
|
lua_pushnumber(L, bits);
|
||||||
lua_pushnumber(L, algbits);
|
lua_pushnumber(L, algbits);
|
||||||
return 3;
|
lua_pushstring(L, SSL_get_version(ssl->ssl));
|
||||||
|
return 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int meth_copyright(lua_State *L)
|
static int meth_copyright(lua_State *L)
|
||||||
|
@ -128,7 +128,7 @@ end
|
|||||||
-- Extract connection information.
|
-- Extract connection information.
|
||||||
--
|
--
|
||||||
local function info(ssl, field)
|
local function info(ssl, field)
|
||||||
local str, comp, err
|
local str, comp, err, protocol
|
||||||
comp, err = core.compression(ssl)
|
comp, err = core.compression(ssl)
|
||||||
if err then
|
if err then
|
||||||
return comp, err
|
return comp, err
|
||||||
@ -138,7 +138,7 @@ local function info(ssl, field)
|
|||||||
return comp
|
return comp
|
||||||
end
|
end
|
||||||
local info = {compression = comp}
|
local info = {compression = comp}
|
||||||
str, info.bits, info.algbits = core.info(ssl)
|
str, info.bits, info.algbits, protocol = core.info(ssl)
|
||||||
if str then
|
if str then
|
||||||
info.cipher, info.protocol, info.key,
|
info.cipher, info.protocol, info.key,
|
||||||
info.authentication, info.encryption, info.mac =
|
info.authentication, info.encryption, info.mac =
|
||||||
@ -146,6 +146,9 @@ local function info(ssl, field)
|
|||||||
"^(%S+)%s+(%S+)%s+Kx=(%S+)%s+Au=(%S+)%s+Enc=(%S+)%s+Mac=(%S+)")
|
"^(%S+)%s+(%S+)%s+Kx=(%S+)%s+Au=(%S+)%s+Enc=(%S+)%s+Mac=(%S+)")
|
||||||
info.export = (string.match(str, "%sexport%s*$") ~= nil)
|
info.export = (string.match(str, "%sexport%s*$") ~= nil)
|
||||||
end
|
end
|
||||||
|
if protocol then
|
||||||
|
info.protocol = protocol
|
||||||
|
end
|
||||||
if field then
|
if field then
|
||||||
return info[field]
|
return info[field]
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user