Re: libcrypto: Fix EINVAL in openssl/tls_init

2023-03-27 Thread Theo Buehler
On Mon, Mar 27, 2023 at 09:59:47AM +0200, Jan Klemkow wrote: > On Fri, Mar 24, 2023 at 10:02:05PM +0100, Theo Buehler wrote: > > > Thus, I would suggest to set this constant to ELAST. So, we will avoid > > > useless unknown error strings and a non-zero errno after tls_init(). > > > > ELAST isn't

Re: libcrypto: Fix EINVAL in openssl/tls_init

2023-03-27 Thread Jan Klemkow
On Fri, Mar 24, 2023 at 10:02:05PM +0100, Theo Buehler wrote: > > Thus, I would suggest to set this constant to ELAST. So, we will avoid > > useless unknown error strings and a non-zero errno after tls_init(). > > ELAST isn't portable. It's under __BSD_VISIBLE in sys/errno.h. > > It would seem

Re: libcrypto: Fix EINVAL in openssl/tls_init

2023-03-24 Thread Theo Buehler
> Thus, I would suggest to set this constant to ELAST. So, we will avoid > useless unknown error strings and a non-zero errno after tls_init(). ELAST isn't portable. It's under __BSD_VISIBLE in sys/errno.h. It would seem better to use the save_errno idiom to store the errno at the start of the

libcrypto: Fix EINVAL in openssl/tls_init

2023-03-24 Thread Jan Klemkow
Hi, after tls_init() and OPENSSL_init_ssl() errno is always set to EINVAL. This is caused by a routine that tries to prefetch all error strings up to 127 from strerror(3). But, strerror(3) sets EINVAL for unknown values of error. Thus, I would suggest to set this constant to ELAST. So, we will