Comparison

util/x509.lua @ 10494:69e55b03d5cf

util.x509: Fix recording of CommonNames in get_identities Don't worry, this function is not used by anything yet, this isn't a security issue. It'll be used by Prosody to pick the correct certificate for itself in the future. The `names` multitable is a collection of (name, service) pairs but it put them in the wrong order here.
author Kim Alvefur <zash@zash.se>
date Sun, 08 Dec 2019 17:48:37 +0100
parent 10259:9df135b06c2f
child 12106:c0cb8e86ad21
comparison
equal deleted inserted replaced
10493:d9132e7412b8 10494:69e55b03d5cf
264 for i = 1, #subject do 264 for i = 1, #subject do
265 local dn = subject[i]; 265 local dn = subject[i];
266 if dn.oid == oid_commonname then 266 if dn.oid == oid_commonname then
267 local name = nameprep(dn.value); 267 local name = nameprep(dn.value);
268 if name and idna_to_ascii(name) then 268 if name and idna_to_ascii(name) then
269 names:set("*", name, true); 269 names:set(name, "*", true);
270 end 270 end
271 end 271 end
272 end 272 end
273 return names.data; 273 return names.data;
274 end 274 end