]> git.lizzy.rs Git - plan9front.git/commit
libsec: emulate openssl asn1 when generating x509 csr
authorcinap_lenrek <cinap_lenrek@felloff.net>
Sun, 20 Jun 2021 23:33:13 +0000 (23:33 +0000)
committercinap_lenrek <cinap_lenrek@felloff.net>
Sun, 20 Jun 2021 23:33:13 +0000 (23:33 +0000)
commite9aed242ccf6c569491b34e5455e9ea9b78cd29a
treebbe08a5774e0c614ceb85baec0c28c77da2238c5
parenteeb0f9a9dad1c09ba2c0985b1af2c99b1bebe4c1
libsec: emulate openssl asn1 when generating x509 csr

when trying to request certificates from letsencrypt,
their test api would reject our csr because of
"tuncated sequence" unless we force subectAltName
by passing multiple domains (as comma separated list).

apparently, we need to provide the context specific tag
"cont [ 0 ]" for the extensions even when we do have
any extensions for the csr (triggered when we need to
have subjectAltNames).

for this, we change mkcont() to take a Elist* instead,
which then can be nil when not used. also put the tag
number argument first, which makes it easier to read.
sys/src/libsec/port/x509.c