]> git.ipfire.org Git - thirdparty/openssl.git/commit
TEST: fix test/errtest.c
authorRichard Levitte <levitte@openssl.org>
Mon, 29 Jun 2020 10:43:40 +0000 (12:43 +0200)
committerRichard Levitte <levitte@openssl.org>
Sun, 5 Jul 2020 19:13:25 +0000 (21:13 +0200)
commit17b7f8968481aa99c622080ac73879f42fb8c4ae
treea187f00f9c9d1ed6cf2914bd519868241399f253
parent71f2994b151f5de0c7bc14592c84795ff98256c1
TEST: fix test/errtest.c

test/errtest.c used the system error code 1 for EPERM.  However, EPERM
may be coded differently on different systems, so we switch to using
EPERM instead.  However, because we know that the ERR sub-system
truncates system error codes that occupy more than 24 bits, we check
that the reason code in the recorded error matches our EPERM, and skip
the test if not.

To be safe (even though the error string for that code is well defined
in POSIX), we also use strerror() to retrieve the string for that
error code instead of using a hard coded value.

Fixes #12276
Fixes #12217
Fixes #12354

Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/12343)
test/errtest.c