-
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
PKCS and X.509 selftests fail on big-endian PowerPC since 2.16.1 #2622
Comments
…gs in 2.16.1. Tracking issue in upstream Mbed-TLS#2622
Hi @mrpippy, thanks a lot for your report and initial analysis! Could you check which code-path your system selects for Kind regards, |
ARM Internal Ref: IOTSSL-2843 |
Yes it does use |
Hi @mrpippy, thanks, the function is indeed buggy (it's embarrassing, where shall the platform-specific difference in functional behaviour come from if the function only uses operations whose functional effect is fully specified? Anyway...). I'll open a PR for it. Thanks again for your report! |
The previous implementation of mpi_bigendian_to_host() did a byte-swapping regardless of the endianness of the system. Fixes Mbed-TLS#2622.
Description
Bug
OS
Mac OS X
mbed TLS build:
Version: 2.16.1
OS version: 10.4.11
Configuration: default config.h included with mbedtls
Compiler and options: GCC 4.0.1 (included with Xcode 2.5, the latest available for Mac OS X 10.4)
Additional environment information: Running on a Power Mac G5 (contains big-endian PowerPC 970)
Expected behavior
programs/benchmark
andprograms/selftest
should both pass (which they do in 2.16.0)Actual behavior
In
programs/benchmark
the RSA-2048 and RSA-4096 benchmarks fail withBIGNUM - Bad input parameters to function
In
programs/selftest
the PKCS#1 and X.509 certificate load tests both fail.Steps to reproduce
gmake -k ; programs/test/benchmark ; programs/test/selftest
I believe the issue is related to the
mpi_bigendian_to_host()
changes by @hanno-arm (f872007). After hard-coding the big-endian codepath (which does no byte-swapping), the tests and benchmarks complete successfully.I think there's multiple issues to solve:
#warning
when the system endianness cannot be detected at compile timeMBEDTLS_
#define
to specify endianness when it can't be detected. Defining__BYTE_ORDER__
to__ORDER_BIG_ENDIAN
in myconfig.h
seems to work without any problems but is not the cleanest solutionThe text was updated successfully, but these errors were encountered: