diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/context/lua/mtx-server.lua | 2 | ||||
-rw-r--r-- | scripts/context/lua/mtxlibs.lua | 1 | ||||
-rw-r--r-- | scripts/context/lua/mtxrun.lua | 41 | ||||
-rw-r--r-- | scripts/context/stubs/mswin/mtxrun.lua | 41 | ||||
-rw-r--r-- | scripts/context/stubs/unix/mtxrun | 41 | ||||
-rw-r--r-- | scripts/context/stubs/win64/mtxrun.lua | 41 |
6 files changed, 149 insertions, 18 deletions
diff --git a/scripts/context/lua/mtx-server.lua b/scripts/context/lua/mtx-server.lua index 448b20ac5..4f7b9b591 100644 --- a/scripts/context/lua/mtx-server.lua +++ b/scripts/context/lua/mtx-server.lua @@ -48,8 +48,6 @@ local gettime = os.gettimeofday or os.clock scripts = scripts or { } scripts.webserver = scripts.webserver or { } -dofile(resolvers.findfile("luat-soc.lua","tex")) - local socket = socket or require("socket") ----- http = http or require("socket.http") -- not needed diff --git a/scripts/context/lua/mtxlibs.lua b/scripts/context/lua/mtxlibs.lua index fa539b2bf..9c8cd28ca 100644 --- a/scripts/context/lua/mtxlibs.lua +++ b/scripts/context/lua/mtxlibs.lua @@ -82,6 +82,7 @@ local ownlibs = { "l-file.lua", -- limited functionality when no lfs -- "l-gzip.lua", "l-md5.lua", -- not loaded when no md5 library + "l-sha.lua", -- not loaded when no sha2 library "l-url.lua", "l-dir.lua", -- limited functionality when no lfs "l-boolean.lua", diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index 66b512921..8619ceb1d 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -3642,7 +3642,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-os"] = package.loaded["l-os"] or true --- original size: 16952, stripped down to: 9696 +-- original size: 17018, stripped down to: 9696 if not modules then modules={} end modules ['l-os']={ version=1.001, @@ -4585,6 +4585,38 @@ end -- of closure do -- create closure to overcome 200 locals limit +package.loaded["l-sha"] = package.loaded["l-sha"] or true + +-- original size: 1085, stripped down to: 987 + +if not modules then modules={} end modules ['l-sha']={ + version=1.001, + comment="companion to luat-lib.mkiv", + author="Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright="PRAGMA ADE / ConTeXt Development Team", + license="see context related readme files" +} +if sha2 then + local lpegmatch=lpeg.match + local lpegpatterns=lpeg.patterns + local bytestohex=lpegpatterns.bytestohex + local bytestoHEX=lpegpatterns.bytestoHEX + local digest256=sha2.digest256 + local digest384=sha2.digest384 + local digest512=sha2.digest512 + sha2.hash256=function(str) return lpegmatch(bytestohex,digest256(str)) end + sha2.hash384=function(str) return lpegmatch(bytestohex,digest384(str)) end + sha2.hash512=function(str) return lpegmatch(bytestohex,digest512(str)) end + sha2.HASH256=function(str) return lpegmatch(bytestoHEX,digest256(str)) end + sha2.HASH384=function(str) return lpegmatch(bytestoHEX,digest384(str)) end + sha2.HASH512=function(str) return lpegmatch(bytestoHEX,digest512(str)) end +end + + +end -- of closure + +do -- create closure to overcome 200 locals limit + package.loaded["l-url"] = package.loaded["l-url"] or true -- original size: 14755, stripped down to: 7236 @@ -24548,10 +24580,10 @@ end end -- of closure --- used libraries : l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua +-- used libraries : l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 981253 --- stripped bytes : 346948 +-- original bytes : 982404 +-- stripped bytes : 347112 -- end library merge @@ -24589,6 +24621,7 @@ local ownlibs = { -- order can be made better 'l-file.lua', 'l-gzip.lua', 'l-md5.lua', + 'l-sha.lua', 'l-url.lua', 'l-dir.lua', 'l-boolean.lua', diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index 66b512921..8619ceb1d 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -3642,7 +3642,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-os"] = package.loaded["l-os"] or true --- original size: 16952, stripped down to: 9696 +-- original size: 17018, stripped down to: 9696 if not modules then modules={} end modules ['l-os']={ version=1.001, @@ -4585,6 +4585,38 @@ end -- of closure do -- create closure to overcome 200 locals limit +package.loaded["l-sha"] = package.loaded["l-sha"] or true + +-- original size: 1085, stripped down to: 987 + +if not modules then modules={} end modules ['l-sha']={ + version=1.001, + comment="companion to luat-lib.mkiv", + author="Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright="PRAGMA ADE / ConTeXt Development Team", + license="see context related readme files" +} +if sha2 then + local lpegmatch=lpeg.match + local lpegpatterns=lpeg.patterns + local bytestohex=lpegpatterns.bytestohex + local bytestoHEX=lpegpatterns.bytestoHEX + local digest256=sha2.digest256 + local digest384=sha2.digest384 + local digest512=sha2.digest512 + sha2.hash256=function(str) return lpegmatch(bytestohex,digest256(str)) end + sha2.hash384=function(str) return lpegmatch(bytestohex,digest384(str)) end + sha2.hash512=function(str) return lpegmatch(bytestohex,digest512(str)) end + sha2.HASH256=function(str) return lpegmatch(bytestoHEX,digest256(str)) end + sha2.HASH384=function(str) return lpegmatch(bytestoHEX,digest384(str)) end + sha2.HASH512=function(str) return lpegmatch(bytestoHEX,digest512(str)) end +end + + +end -- of closure + +do -- create closure to overcome 200 locals limit + package.loaded["l-url"] = package.loaded["l-url"] or true -- original size: 14755, stripped down to: 7236 @@ -24548,10 +24580,10 @@ end end -- of closure --- used libraries : l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua +-- used libraries : l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 981253 --- stripped bytes : 346948 +-- original bytes : 982404 +-- stripped bytes : 347112 -- end library merge @@ -24589,6 +24621,7 @@ local ownlibs = { -- order can be made better 'l-file.lua', 'l-gzip.lua', 'l-md5.lua', + 'l-sha.lua', 'l-url.lua', 'l-dir.lua', 'l-boolean.lua', diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index 66b512921..8619ceb1d 100644 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -3642,7 +3642,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-os"] = package.loaded["l-os"] or true --- original size: 16952, stripped down to: 9696 +-- original size: 17018, stripped down to: 9696 if not modules then modules={} end modules ['l-os']={ version=1.001, @@ -4585,6 +4585,38 @@ end -- of closure do -- create closure to overcome 200 locals limit +package.loaded["l-sha"] = package.loaded["l-sha"] or true + +-- original size: 1085, stripped down to: 987 + +if not modules then modules={} end modules ['l-sha']={ + version=1.001, + comment="companion to luat-lib.mkiv", + author="Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright="PRAGMA ADE / ConTeXt Development Team", + license="see context related readme files" +} +if sha2 then + local lpegmatch=lpeg.match + local lpegpatterns=lpeg.patterns + local bytestohex=lpegpatterns.bytestohex + local bytestoHEX=lpegpatterns.bytestoHEX + local digest256=sha2.digest256 + local digest384=sha2.digest384 + local digest512=sha2.digest512 + sha2.hash256=function(str) return lpegmatch(bytestohex,digest256(str)) end + sha2.hash384=function(str) return lpegmatch(bytestohex,digest384(str)) end + sha2.hash512=function(str) return lpegmatch(bytestohex,digest512(str)) end + sha2.HASH256=function(str) return lpegmatch(bytestoHEX,digest256(str)) end + sha2.HASH384=function(str) return lpegmatch(bytestoHEX,digest384(str)) end + sha2.HASH512=function(str) return lpegmatch(bytestoHEX,digest512(str)) end +end + + +end -- of closure + +do -- create closure to overcome 200 locals limit + package.loaded["l-url"] = package.loaded["l-url"] or true -- original size: 14755, stripped down to: 7236 @@ -24548,10 +24580,10 @@ end end -- of closure --- used libraries : l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua +-- used libraries : l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 981253 --- stripped bytes : 346948 +-- original bytes : 982404 +-- stripped bytes : 347112 -- end library merge @@ -24589,6 +24621,7 @@ local ownlibs = { -- order can be made better 'l-file.lua', 'l-gzip.lua', 'l-md5.lua', + 'l-sha.lua', 'l-url.lua', 'l-dir.lua', 'l-boolean.lua', diff --git a/scripts/context/stubs/win64/mtxrun.lua b/scripts/context/stubs/win64/mtxrun.lua index 66b512921..8619ceb1d 100644 --- a/scripts/context/stubs/win64/mtxrun.lua +++ b/scripts/context/stubs/win64/mtxrun.lua @@ -3642,7 +3642,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-os"] = package.loaded["l-os"] or true --- original size: 16952, stripped down to: 9696 +-- original size: 17018, stripped down to: 9696 if not modules then modules={} end modules ['l-os']={ version=1.001, @@ -4585,6 +4585,38 @@ end -- of closure do -- create closure to overcome 200 locals limit +package.loaded["l-sha"] = package.loaded["l-sha"] or true + +-- original size: 1085, stripped down to: 987 + +if not modules then modules={} end modules ['l-sha']={ + version=1.001, + comment="companion to luat-lib.mkiv", + author="Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright="PRAGMA ADE / ConTeXt Development Team", + license="see context related readme files" +} +if sha2 then + local lpegmatch=lpeg.match + local lpegpatterns=lpeg.patterns + local bytestohex=lpegpatterns.bytestohex + local bytestoHEX=lpegpatterns.bytestoHEX + local digest256=sha2.digest256 + local digest384=sha2.digest384 + local digest512=sha2.digest512 + sha2.hash256=function(str) return lpegmatch(bytestohex,digest256(str)) end + sha2.hash384=function(str) return lpegmatch(bytestohex,digest384(str)) end + sha2.hash512=function(str) return lpegmatch(bytestohex,digest512(str)) end + sha2.HASH256=function(str) return lpegmatch(bytestoHEX,digest256(str)) end + sha2.HASH384=function(str) return lpegmatch(bytestoHEX,digest384(str)) end + sha2.HASH512=function(str) return lpegmatch(bytestoHEX,digest512(str)) end +end + + +end -- of closure + +do -- create closure to overcome 200 locals limit + package.loaded["l-url"] = package.loaded["l-url"] or true -- original size: 14755, stripped down to: 7236 @@ -24548,10 +24580,10 @@ end end -- of closure --- used libraries : l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua +-- used libraries : l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 981253 --- stripped bytes : 346948 +-- original bytes : 982404 +-- stripped bytes : 347112 -- end library merge @@ -24589,6 +24621,7 @@ local ownlibs = { -- order can be made better 'l-file.lua', 'l-gzip.lua', 'l-md5.lua', + 'l-sha.lua', 'l-url.lua', 'l-dir.lua', 'l-boolean.lua', |