]> git.lizzy.rs Git - plan9front.git/commit
x509: encode empty sequence as constructed
authorOri Bernstein <ori@eigenstate.org>
Mon, 9 Aug 2021 15:33:16 +0000 (15:33 +0000)
committerOri Bernstein <ori@eigenstate.org>
Mon, 9 Aug 2021 15:33:16 +0000 (15:33 +0000)
commitc6a9c55de7e5d1d510a717cffd42648d249269db
tree711ddf9fa4a13446013e3cccb073de4f6460bb0c
parent3909b83a90ff0c820ef7c903a03fc12b043ebfea
x509: encode empty sequence as constructed

According to the ASN.1 BER spec, we should be encoding
all sequences (including empty ones) as constructed:

8.9.1 The encoding of a sequence value shall be constructed.
8.10.1 The encoding of a sequence-of value shall be constructed.
8.11.1 The encoding of a set value shall be constructed.
8.12.1 The encoding of a set-of value shall be constructed.

However, we were only setting them as constructed when the
list was non-empty.

This changes it, and makes letsencrypt happy with the CSRs that
we generate.
sys/src/libsec/port/x509.c