Mercurial > prosody-modules
comparison mod_s2s_auth_dane/mod_s2s_auth_dane.lua @ 1352:b0f780d3a24e
mod_s2s_auth_dane: Don't pass nil to hash functions in case of unsupported selectors
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Tue, 18 Mar 2014 15:20:28 +0100 |
| parents | a052740bbf48 |
| children | a17c2c4043e5 |
comparison
equal
deleted
inserted
replaced
| 1351:a052740bbf48 | 1352:b0f780d3a24e |
|---|---|
| 139 else | 139 else |
| 140 module:log("warn", "DANE selector %s is unsupported", tlsa:getSelector() or select); | 140 module:log("warn", "DANE selector %s is unsupported", tlsa:getSelector() or select); |
| 141 end | 141 end |
| 142 | 142 |
| 143 if match == 1 then | 143 if match == 1 then |
| 144 certdata = hashes.sha256(certdata); | 144 certdata = certdata and hashes.sha256(certdata); |
| 145 elseif match == 2 then | 145 elseif match == 2 then |
| 146 certdata = hashes.sha512(certdata); | 146 certdata = certdata and hashes.sha512(certdata); |
| 147 elseif match ~= 0 then | 147 elseif match ~= 0 then |
| 148 module:log("warn", "DANE match rule %s is unsupported", tlsa:getMatchType() or match); | 148 module:log("warn", "DANE match rule %s is unsupported", tlsa:getMatchType() or match); |
| 149 certdata = nil; | 149 certdata = nil; |
| 150 end | 150 end |
| 151 | 151 |
