Skip to content

Commit 958dbb9

Browse files
committed
deps: update lua-resty-openssl to version 1.6.4
1 parent c8b3bae commit 958dbb9

File tree

6 files changed

+55
-7
lines changed

6 files changed

+55
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- [DOCS] Add multi-language support to the documentation, including French
66
- [UI] Fix incorrect key used when viewing service details
7+
- [DEPS] Update lua-resty-openssl version to v1.6.4
78

89
## v1.6.5-rc2 - ????/??/??
910

src/deps/deps.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@
125125
},
126126
{
127127
"id": "lua-resty-openssl",
128-
"name": "lua-resty-openssl v1.6.3",
128+
"name": "lua-resty-openssl v1.6.4",
129129
"url": "https://github.com/fffonion/lua-resty-openssl.git",
130-
"commit": "790209507c4bb7d24f5b3eb3f4cb9621af60831b",
130+
"commit": "1c9e3f5f0ce5274d82f2faf259dd34d4b6b75eb6",
131131
"post_install": "rm -r src/deps/src/lua-resty-openssl/t"
132132
},
133133
{

src/deps/src/lua-resty-openssl/CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
## [Unreleased]
33

44

5+
<a name="1.6.4"></a>
6+
## [1.6.4] - 2025-09-08
7+
### bug fixes
8+
- **jwk:** fix EC key x and y padding [42cac34](https://github.com/fffonion/lua-resty-openssl/commit/42cac34d5749c8b629002f66e8bbc8ce7ff54303)
9+
10+
511
<a name="1.6.3"></a>
612
## [1.6.3] - 2025-09-04
713
### bug fixes
@@ -658,7 +664,8 @@
658664
- **x509:** export pubkey [ede4f81](https://github.com/fffonion/lua-resty-openssl/commit/ede4f817cb0fe092ad6f9ab5d6ecdcde864a9fd8)
659665

660666

661-
[Unreleased]: https://github.com/fffonion/lua-resty-openssl/compare/1.6.3...HEAD
667+
[Unreleased]: https://github.com/fffonion/lua-resty-openssl/compare/1.6.4...HEAD
668+
[1.6.4]: https://github.com/fffonion/lua-resty-openssl/compare/1.6.3...1.6.4
662669
[1.6.3]: https://github.com/fffonion/lua-resty-openssl/compare/1.6.2...1.6.3
663670
[1.6.2]: https://github.com/fffonion/lua-resty-openssl/compare/1.6.1...1.6.2
664671
[1.6.1]: https://github.com/fffonion/lua-resty-openssl/compare/1.6.0...1.6.1

src/deps/src/lua-resty-openssl/lib/resty/openssl.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ try_require_modules()
2424

2525

2626
local _M = {
27-
_VERSION = '1.6.3',
27+
_VERSION = '1.6.4',
2828
}
2929

3030
function _M.load_modules()

src/deps/src/lua-resty-openssl/lib/resty/openssl/auxiliary/jwk.lua

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,36 @@ local jwk_params_required_mapping = {
342342
OKP = {},
343343
}
344344

345+
local ec_coord_size_map = {
346+
-- JWK RFC7518
347+
["P-256"] = 32,
348+
["P-384"] = 48,
349+
["P-521"] = 66, -- rounded up to the next byte
350+
-- JOSE RFC8812 and others
351+
prime256v1 = 32,
352+
secp384r1 = 48,
353+
secp521r1 = 66, -- rounded up to the next byte
354+
brainpoolP256r1 = 32,
355+
brainpoolP320r1 = 40,
356+
brainpoolP384r1 = 48,
357+
brainpoolP512r1 = 64, -- note this is 512 not 521
358+
secp256k1 = 32,
359+
}
360+
-- Pad coordinates to field size with leading zeros
361+
local function pad_ec_coordinate(coord, crv)
362+
local size = ec_coord_size_map[crv]
363+
if not size then
364+
return nil, "unsupported curve " .. tostring(crv)
365+
end
366+
if #coord < size then
367+
return string.rep("\x00", size - #coord) .. coord
368+
elseif #coord > size then
369+
return nil, "coordinate length " .. #coord .. " is longer than expected " .. size
370+
else
371+
return coord
372+
end
373+
end
374+
345375
function _M.load_jwk_ex(txt, ptyp, properties)
346376
local tbl, err = json.decode(txt)
347377
if err then
@@ -420,7 +450,17 @@ function _M.load_jwk_ex(txt, ptyp, properties)
420450

421451
if kty == "EC" then
422452
if params_t["x"] and params_t["y"] then
423-
params_t["pub"] = "\x04" .. params_t["x"]:reverse() .. params_t["y"]:reverse()
453+
local x = params_t["x"]:reverse()
454+
local y = params_t["y"]:reverse()
455+
x, err = pad_ec_coordinate(x, tbl["crv"])
456+
if err then
457+
return nil, "jwk:load_jwk: pad_ec_coordinate: " .. err
458+
end
459+
y, err = pad_ec_coordinate(y, tbl["crv"])
460+
if err then
461+
return nil, "jwk:load_jwk: pad_ec_coordinate: " .. err
462+
end
463+
params_t["pub"] = "\x04" .. x .. y
424464
params_t["x"], params_t["y"] = nil, nil
425465
end
426466
end

src/deps/src/lua-resty-openssl/lua-resty-openssl-1.6.3-1.rockspec renamed to src/deps/src/lua-resty-openssl/lua-resty-openssl-1.6.4-1.rockspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package = "lua-resty-openssl"
2-
version = "1.6.3-1"
2+
version = "1.6.4-1"
33
source = {
44
url = "git+https://github.com/fffonion/lua-resty-openssl.git",
5-
tag = "1.6.3"
5+
tag = "1.6.4"
66
}
77
description = {
88
detailed = "FFI-based OpenSSL binding for LuaJIT.",

0 commit comments

Comments
 (0)