Skip to content
Snippets Groups Projects
Commit 9cc130f0 authored by Vladimir Davydov's avatar Vladimir Davydov Committed by Vladimir Davydov
Browse files

crypto: use ERR_reason_error_string instead of ERR_error_string

ERR_error_string adds some extra information that depends on the OpenSSL
library version (code, module, method). This information says nothing to
the end user, and it results in different test results after updating to
OpenSSL 3.0. Let's use ERR_reason_error_string instead, which just
prints a human-readable error message.

Part of #6477

NO_DOC=minor change in error message
NO_CHANGELOG=minor change in error message
parent f72662c5
No related branches found
No related tags found
No related merge requests found
......@@ -112,7 +112,7 @@ evp_cipher_find(enum crypto_algo algo, enum crypto_mode mode)
*/
#define diag_set_OpenSSL() \
diag_set(CryptoError, "OpenSSL error: %s", \
ERR_error_string(ERR_get_error(), NULL))
ERR_reason_error_string(ERR_get_error()))
/** Stream to encrypt/decrypt data packets step by step. */
struct crypto_stream {
......
......@@ -167,13 +167,11 @@ bad_iv = '123456abcdefghij'
...
ciph.decrypt(enc, bad_pass, iv)
---
- error: 'OpenSSL error: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad
decrypt'
- error: 'OpenSSL error: bad decrypt'
...
ciph.decrypt(enc, pass, bad_iv)
---
- error: 'OpenSSL error: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad
decrypt'
- error: 'OpenSSL error: bad decrypt'
...
test_run:cmd("clear filter")
---
......
......@@ -448,8 +448,7 @@ digest.aes256cbc.decrypt(digest.aes256cbc.encrypt('test123', 'passpasspasspasspa
...
digest.aes256cbc.decrypt(digest.aes256cbc.encrypt('test123', 'passpasspasspasspasspasspasspass', 'iv12tras8712cvbh'), 'nosspasspasspasspasspasspasspass', 'iv12tras8712cvbh')
---
- error: 'OpenSSL error: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad
decrypt'
- error: 'OpenSSL error: bad decrypt'
...
--
-- Test base64 options. (gh-2479, gh-2478, gh-2777).
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment