Software /
code /
prosody
Comparison
util/openssl.lua @ 7529:bdaff978c790
util.openssl: rename variable to not collide with other 'k's [luacheck]
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Thu, 28 Jul 2016 15:34:45 +0800 |
parent | 7482:88a92ba697bf |
child | 8382:e5d00bf4a4d5 |
comparison
equal
deleted
inserted
replaced
7528:50365a496890 | 7529:bdaff978c790 |
---|---|
59 "emailAddress"; | 59 "emailAddress"; |
60 } | 60 } |
61 _M._DN_order = DN_order; | 61 _M._DN_order = DN_order; |
62 function ssl_config:serialize() | 62 function ssl_config:serialize() |
63 local s = ""; | 63 local s = ""; |
64 for k, t in pairs(self) do | 64 for section, t in pairs(self) do |
65 s = s .. ("[%s]\n"):format(k); | 65 s = s .. ("[%s]\n"):format(section); |
66 if k == "subject_alternative_name" then | 66 if section == "subject_alternative_name" then |
67 for san, n in pairs(t) do | 67 for san, n in pairs(t) do |
68 for i = 1, #n do | 68 for i = 1, #n do |
69 s = s .. s_format("%s.%d = %s\n", san, i -1, n[i]); | 69 s = s .. s_format("%s.%d = %s\n", san, i -1, n[i]); |
70 end | 70 end |
71 end | 71 end |
72 elseif k == "distinguished_name" then | 72 elseif section == "distinguished_name" then |
73 for _, k in ipairs(t[1] and t or DN_order) do | 73 for _, k in ipairs(t[1] and t or DN_order) do |
74 local v = t[k]; | 74 local v = t[k]; |
75 if v then | 75 if v then |
76 s = s .. ("%s = %s\n"):format(k, v); | 76 s = s .. ("%s = %s\n"):format(k, v); |
77 end | 77 end |