CVSROOT:        /cvs
Module name:    src
Changes by:     be...@cvs.openbsd.org   2021/08/20 13:54:16

Modified files:
        lib/libcrypto/asn1: Tag: OPENBSD_6_8 t_x509a.c 

Log message:
In LibreSSL, printing a certificate can result in a crash in
X509_CERT_AUX_print().

Commit in -current:

CVSROOT:        /cvs
Module name:    src
Changes by:     schwa...@cvs.openbsd.org        2021/07/10 11:45:16

Modified files:
lib/libcrypto/asn1: t_x509a.c

Log message:
Fix a read buffer overrun in X509_CERT_AUX_print(3),
which by implication also affects X509_print(3).

The ASN1_STRING_get0_data(3) manual explitely cautions the reader
that the data is not necessarily NUL-terminated, and the function
X509_alias_set1(3) does not sanitize the data passed into it in
any way either, so we must assume the alias->data field is merely
a byte array and not necessarily a string in the sense of the C
language.

I found this bug while writing manual pages for these functions.

OK tb@

As an aside, note that the function still produces incomplete and
misleading results when the data contains a NUL byte in the middle
and that error handling is consistently absent throughout, even
though the function provides an "int" return value obviously intended
to be 1 for success and 0 for failure, and even though this function
is called by another function that also wants to return 1 for success
and 0 for failure and even does so in many of its code paths, though
not in others.  But let's stay focussed.  Many things would be nice
to have in the wide wild world, but a buffer overflow must not be
allowed to remain in our backyard.

This is patches/6.8/common/029_x509.patch.sig

Reply via email to