-
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
MIPS RSA pk encryption produces invalid result #1722
Comments
Thanks for the feedback! MIPS isn't a platform we have in our CI nor one we have tools or boards for, so we'd very much welcome a fix for this one. |
ARM Internal Ref: IOTSSL-2364 |
@jmartin-r7, if the issue is in the
|
@aurel32 that does look to address the specific issue in my test, I will do more testing and see about opening a PR. I need to understand the possible impacts before accepting this as a long term solution. |
Hi @jmartin-r7, I got aware of this issue and the subsequent PR only now: Many thanks for reporting this and for providing a thorough description of how to reproduce the issue (for the record: I had to set Regards, |
Hi @aurel32, thank you very much for finding and reporting the cause for the issue. I confirm that the clobber list is broken, and that changing it per your suggestion at least fixes the issue at hand in the setup @jmartin-r7 describes. Further review and discussion will be done in PR #1949. Regards, |
Signed-off-by: Jeffrey Martin <Jeffrey_Martin@rapid7.com>
May be related to #1093 and seen impacting big and little endian MIPS
Description
Mitigated by following suggestion to remove embedded assembly in
bn_mul.h
based on Getting MBEDTLS_ERR_RSA_PRIVATE_FAILED error #755 (comment)Bug
OS
Mbed OS linux MIPS and MIPSEL
mbed TLS build:
Version: 2.6.0 and still present in 2.9.0
OS version: reproduced in
qemu-mips
and Openwrt 15.05 (Broadcom BCM5300)Configuration: attached config.h
config.h.txt
Compiler and options (if you used a pre-built binary, please indicate how you obtained it):
https://bitbucket.org/GregorR/musl-cross
Peer device TLS stack and version
N/A failure can be reproduced in sample code, although this was identified by encrypting data with an RSA public key on MIPS and attempting to decrypt in Ruby 2.5.1 on x86_64.
RSA key was generated with
OpenSSL 1.0.2j
Expected behavior
Sample code should report success on decrypt of public key encrypted data.
Actual behavior
Decryption fails with error code
Steps to reproduce
Sample failing code on MIPS, this code reports success on ARM & x86_64
compiled with sample
mips-linux-gnu-gcc -static main.c -o test -I"../mbedtls/include/" -L"../lib" -lmbedtls -lmbedcrypto
using https://hub.docker.com/r/asmimproved/qemu-mips/The text was updated successfully, but these errors were encountered: