-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add missing ret code checks in PEM module #828
Add missing ret code checks in PEM module #828
Conversation
8d37954
to
25a48aa
Compare
The CI failure is expected, refer to this for more information. |
tests/suites/test_suite_pem.data
Outdated
|
||
PEM read (malformed PEM) | ||
depends_on:MBEDTLS_DES_C:MBEDTLS_CIPHER_MODE_CBC | ||
mbedtls_pem_read_buffer:"-----BEGIN EC PRIVATE KEY-----":"-----END EC PRIVATE KEY-----":"-----BEGIN EC PRIVATE KEY-----\nProc-Type\: 4,ENCRYPTED\nDEK-Info\: DES-CBC,AA94892A169FA426\n\nMAAA\n-----END EC PRIVATE KEY-----":"pwd":MBEDTLS_ERR_DES_INVALID_INPUT_LENGTH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that we could achieve full coverage of the changes with minimal effort if we would add a very similar test vector for DES3 and AES as well.
25a48aa
to
56e942e
Compare
Added tests suggested by @yanesca |
Add missing return code checks in the functions pem_des_decrypt(), pem_3des_decrypt() and pem_aes_decrypt() so that the calling function mbedtls_pem_read_buffer() is notified of errors reported by the crypto primitives AES, DES and 3DES.
56e942e
to
a3b9adb
Compare
Rebased fix on top of development branch |
CI failed only due to timing tests (known issue), ok to merge |
Use constant-time look-up in modular exponentiation
Add missing return code checks in the functions pem_des_decrypt(),
pem_3des_decrypt() and pem_aes_decrypt() so that the calling function
mbedtls_pem_read_buffer() is notified of errors reported by the crypto
primitives AES, DES and 3DES.
NOTES: