Diff

util/openssl.lua @ 7192:18a13a7b4bac

util.openssl: Allow order of distinguished name fields to be included in config
author Kim Alvefur <zash@zash.se>
date Thu, 25 Feb 2016 15:34:38 +0100
parent 7023:c2ccbfe30113
child 7458:82710f8c1fe6
line wrap: on
line diff
--- a/util/openssl.lua	Wed Feb 24 11:15:27 2016 +0100
+++ b/util/openssl.lua	Thu Feb 25 15:34:38 2016 +0100
@@ -70,8 +70,7 @@
 				end
 			end
 		elseif k == "distinguished_name" then
-			for i=1, #DN_order do
-				local k = DN_order[i]
+			for i, k in ipairs(t[1] and t or DN_order) do
 				local v = t[k];
 				if v then
 					s = s .. ("%s = %s\n"):format(k, v);