diff options
author | Kim Alvefur <zash@zash.se> | 2019-09-10 18:16:11 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-09-10 18:16:11 +0200 |
commit | 9ea6b422a3568aefec377a30c321096fb5604be9 (patch) | |
tree | c62b420fc980dddb58d7f9719bd17ee45f96a8dd | |
parent | b83267011047adaa367b6b65d5268ec74456294b (diff) | |
download | prosody-9ea6b422a3568aefec377a30c321096fb5604be9.tar.gz prosody-9ea6b422a3568aefec377a30c321096fb5604be9.zip |
util.x509: Nameprep commonName once
-rw-r--r-- | util/x509.lua | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/util/x509.lua b/util/x509.lua index 1cdf07dc..c4001ecb 100644 --- a/util/x509.lua +++ b/util/x509.lua @@ -236,8 +236,11 @@ local function get_identities(cert) --> set of names local subject = cert:subject(); for i = 1, #subject do local dn = subject[i]; - if dn.oid == oid_commonname and nameprep(dn.value) then - names[dn.value] = true; + if dn.oid == oid_commonname then + local name = nameprep(dn.value); + if name then + names[name] = true; + end end end return names; |