aboutsummaryrefslogtreecommitdiff
path: root/test/errtest.c
AgeCommit message (Collapse)AuthorFilesLines
2020-06-04Update copyright yearMatt Caswell1-1/+1
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/12043)
2020-05-28Fix errtest for older compilersShane Lontis1-2/+6
Some older compilers use "unknown function" if they dont support __func, so the test using ERR_PUT_error needed to compensate for this when comparing against the expected value. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11967)
2020-05-26Fix ERR_print_errors so that it matches the documented format in ↵Shane Lontis1-0/+44
doc/man3/ERR_error_string.pod Fixes #11743 The ouput format had 2 issues that caused it not to match the expected documented format: (1) At some point the thread id printing was changed to use the OPENSSL_hex2str method which puts ':' between hex bytes. An internal function that skips the seperator has been added. (2) The error code no longer exists. So this was completely removed from the string. It is now replaced by :: As an example: 00:77:6E:52:14:7F:00:00:error:asn1 encoding routines:asn1_check_tlen:wrong tag:crypto/asn1/tasn_dec.c:1135: Is now: 00776E52147F0000:error::asn1 encoding routines:asn1_check_tlen:wrong tag:crypto/asn1/tasn_dec.c:1135: Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11789)
2019-09-12Modernise the ERR functionality further (new functions and deprecations)Richard Levitte1-2/+2
ERR_func_error_string() essentially returns NULL, and since all function codes are now removed for all intents and purposes, this function has fallen out of use and cannot be modified to suit the data, since its only function is to interpret an error code. To compensate for the loss of error code, we instead provide new functions that extracts the function name strings from an error record: - ERR_get_error_func() - ERR_peek_error_func() - ERR_peek_last_error_func() Similarly, the once all encompasing functions ERR_peek_last_error_line_data(), ERR_peek_error_line_data() and ERR_get_error_line_data() lack the capability of getting the function name string, so we deprecate those and add these functions to replace them: - ERR_get_error_all() - ERR_peek_error_all() - ERR_peek_last_error_all() Finally, we adjust a few lines of code that used the now deprecated functions. Fixes #9756 Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9756)
2019-09-03test/errtest.c: more conditions for checking __FILE__ and __LINE__Richard Levitte1-5/+9
When at least one of OPENSSL_NO_ERR or OPENSSL_NO_FILENAMES is defined, __FILE__ and __LINE__ are not saved with the error record. This test only checked OPENSSL_NO_FILENAMES. Now fixed. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9755)
2019-08-08Fix no-filenamesMatt Caswell1-3/+8
If built with no-filenames then we shouldn't test this functionality in the test suite. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/9544)
2019-08-02Replace FUNCerr with ERR_raise_dataRich Salz1-2/+3
Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9496)
2019-07-31ERR: Remove ERR_put_func_error() and reimplement ERR_put_error() as a macroRichard Levitte1-3/+5
Also, deprecate ERR_put_error() Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/9452)
2019-07-22Add ERR_put_func_error, and use it.Rich Salz1-0/+19
Change SYSerr to have the function name; remove SYS_F_xxx defines Add a test and documentation. Use get_last_socket_err, which removes some ifdef's in OpenSSL code. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9072)
2019-06-18Change ERR_add_error_[v]data to appendRich Salz1-0/+13
The "add error data" functions now append to the current error. Add a test for this. Cleanup some of the ERR_put functions. In the FIPS module, always append "(in the FIPS module)" to any errors. Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9181)
2018-12-06Following the license change, modify the boilerplates in test/Richard Levitte1-1/+1
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7767)
2018-05-23Save and restore the Windows error around TlsGetValue.David Benjamin1-0/+39
TlsGetValue clears the last error even on success, so that callers may distinguish it successfully returning NULL or failing. This error-mangling behavior interferes with the caller's use of GetLastError. In particular SSL_get_error queries the error queue to determine whether the caller should look at the OS's errors. To avoid destroying state, save and restore the Windows error. Fixes #6299. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6316)