Open
Description
Describe the bug
CertificateToString() calls PEM_write_bio_X509() to write a cert as PEM into memory (BIO_new(BIO_s_mem())
) and ignores any errors:
- "Writes to memory BIOs will always succeed if memory is available" (bio_s_mem(3)), so this by itself shouldn'tTM be a problem unless OOM. But even in that enge case, I'd prefer an exception instead of a pseudo-successfully returned truncated result.
- Also, something could theoretically be wrong with the certificate.
To Reproduce
icinga2/lib/base/tlsutility.cpp
Lines 802 to 805 in fe85bf1
Expected behavior
If PEM_write_bio_X509() fails, throw an exception, just like MakeX509CSR().
Additional context
Random finding during:
ref/IP/57407
Activity