Comparison

util/x509.lua @ 12812:b2d422b88cd6

Revert unintentionally committed parts of 12bd40b8e105
author Kim Alvefur <zash@zash.se>
date Wed, 21 Dec 2022 21:34:07 +0100
parent 12808:12bd40b8e105
child 12975:d10957394a3c
comparison
equal deleted inserted replaced
12811:ccc0bdad82cc 12812:b2d422b88cd6
274 end 274 end
275 end 275 end
276 return names.data; 276 return names.data;
277 end 277 end
278 278
279 local pat = "%-%-%-%-%-BEGIN ([A-Z ]+)%-%-%-%-%-\r?\n([0-9A-Za-z+/=\r\n]*)\r?\n%-%-%-%-%-END %1%-%-%-%-%-"; 279 local pat = "%-%-%-%-%-BEGIN ([A-Z ]+)%-%-%-%-%-\r?\n"..
280 "([0-9A-Za-z+/=\r\n]*)\r?\n%-%-%-%-%-END %1%-%-%-%-%-";
280 281
281 local function pem2der(pem) 282 local function pem2der(pem)
282 local typ, data = pem:match(pat); 283 local typ, data = pem:match(pat);
283 if typ and data then 284 if typ and data then
284 return base64.decode(data), typ; 285 return base64.decode(data), typ;