boulder/csr
Phil Porada 8a65f7104e
Force a new allocation for sans in NamesFromCSR (#6759)
In `csr.NamesFromCSR`, there's a subtle trap when appending to a slice.
We set `sans := csr.DNSNames` and then depending on the existence of a
CommonName, we append to sans which could mutate the backing array in
`csr.DNSNames`. Instead, we will force a new allocation meaning that
`sans` has its own pointer to a distinct memory unrelated to the pointer
of `csr.DNSNames`.

See this blog post too: https://build-your-own.org/blog/20230316_go_full_slice/
2023-03-21 14:06:18 -07:00
..
csr.go Force a new allocation for sans in NamesFromCSR (#6759) 2023-03-21 14:06:18 -07:00
csr_test.go Change SetCommonName to RequireCommonName (#6749) 2023-03-21 11:07:06 -07:00