Open ofry opened 5 years ago
Is this not a duplicate of the existing issue?
I'm not sure will rewrite this code solve #7451 or not. However, not checking these return values is bug anyway.
Now that the other issue is solved, what specific cases is the API not being followed?
mbedtls_ssl_write()
Warning This function will do partial writes in some cases. If the return value is non-negative but less than length, the function must be called again with updated arguments: buf + ret, len - ret (if ret is the return value) until it returns a value equal to the last 'len' argument.
mbedtls_net_set_block(), mbedtls_net_set_nonblock()
Returns 0 if successful, or a non-zero error code
@Cthulhu-throwaway Is it prudent to do this?
First and foremost consider this:
Description
Follow mbedtls API: check return values after any mbedtls-related function call in file libretro-common/net/net_socket_ssl.c
MbedTLS API is there: https://tls.mbed.org/api/index.html
Examples:
https://tls.mbed.org/api/net__sockets_8h.html#aeea4e6fd5ad3167bf8563e61f6f75963 https://tls.mbed.org/api/ssl_8h.html#a5bbda87d484de82df730758b475f32e5
Related to #7451
Steps to reproduce the bug
Bisect Results
[Try to bisect and tell us when this started happening]
Version/Commit
You can find this information under Information/System Information
Environment information