Skip to content
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

Check and correct use of MBEDTLS_ERR_SSL_INTERNAL_ERROR #1989

Open
hanno-becker opened this issue Aug 28, 2018 · 2 comments
Open

Check and correct use of MBEDTLS_ERR_SSL_INTERNAL_ERROR #1989

hanno-becker opened this issue Aug 28, 2018 · 2 comments

Comments

@hanno-becker
Copy link

hanno-becker commented Aug 28, 2018

Context: The error code MBEDTLS_ERR_SSL_INTERNAL_ERROR is (to my understanding) meant to be used solely for internal assertion failures only which double-check what should unconditionally hold regardless of API (mis-)use or malformed data received from the peer. In particular, to the best of our knowledge, we should be able to remove all of these checks without compromising the security of the library.

Issue:

  • Sometimes we do use MBEDTLS_ERR_SSL_INTERNAL_ERROR for things that can be triggered by malformed input. One example is here which would be triggered if a peer sent a datagram containing a valid record, followed by a single overhead byte. We should go through all uses of MBEDTLS_ERR_SSL_INTERNAL_ERROR and verify that they are indeed assertion failures, and if not, replace them by appropriate and expressive error codes.
  • Most of the time we just print should never happen for internal assertion failures - we should have more expressive error messages.
@ciarmcom
Copy link

ARM Internal Ref: IOTSSL-2488

@mpg
Copy link
Contributor

mpg commented Sep 11, 2018

Most of the time we just print should never happen for internal assertion failures - we should have more expressive error messages.

I'm not sure I agree with that point. Once the first point has been fixed, these messages should never ever be seen by anybody, except sometimes ourselves during development/debugging, so I don't think it's worth spending time to enhance them. The file and line number already give us all the information we need to know what instance of "should never happen" it is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants