Distinguish different cases with the same OpenSSL error code 23/236723/3
authorLukasz Pawelczyk <l.pawelczyk@samsung.com>
Fri, 19 Jun 2020 13:25:52 +0000 (15:25 +0200)
committerLukasz Pawelczyk <l.pawelczyk@samsung.com>
Fri, 26 Jun 2020 15:36:20 +0000 (17:36 +0200)
commita97af8d086e04e29435dcaf836a13b40df655ec1
treec7c2b5a6c7f4ae326e8b72a4de1a54f99b84a494
parenta8929ac54c843e43def74155a2986c63c7831353
Distinguish different cases with the same OpenSSL error code

When importing a key with a wrong password and decrypting data with
wrong key/bcm or simply broken data OpenSSL can return exactly the
same error code (ERR_LIB_EVP, EVP_F_EVP_DECRYPTFINAL_EX,
EVP_R_BAD_DECRYPT). As we need to distinguish INVALID_PARAM and
INVALID_PASS in import_key, but decryption cannot return INVALID_PASS
handle this manually in the decryption.

Change-Id: Iba2b5fccfb1660c20b76a345bc799a0b145d700c
src/encrypt.c