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

TRNG enabled. TRNG APIs implemented. REV A/B/C/D flags removed. Warnings removed #3009

Merged
merged 4 commits into from
Oct 28, 2016

Conversation

pradeep-gr
Copy link
Contributor

Notes:

  • Pull requests will not be accepted until the submitter has agreed to the contributer agreement.
  • This is just a template, so feel free to use/remove the unnecessary things

Description

A few sentences describing the overall goals of the pull request's commits.

Status

READY/IN DEVELOPMENT/HOLD

Migrations

If this PR changes any APIs or behaviors, give a short description of what API users should do when this PR is merged.

YES | NO

Related PRs

List related PRs against other branches:

branch PR
other_pr_production link
other_pr_master link

Todos

  • Tests
  • Documentation

Deploy notes

Notes regarding the deployment of this PR. These should note any
required changes in the build environment, tools, compilers, etc.

Steps to test or reproduce

Outline the steps to test or reproduce the PR here.

…ngs removed.

@sg- sg- added the needs: CI label Oct 13, 2016
@sg-
Copy link
Contributor

sg- commented Oct 13, 2016

/morph test-nightly

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 0

Build failed!

@sg-
Copy link
Contributor

sg- commented Oct 13, 2016

/morph test-nightly

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 0

Test failed!

@bridadan
Copy link
Contributor

The previous test looked good, however a new commit has since been pushed. I'll run another nightly on it

/morph test-nightly

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 0

Test failed!

@pradeep-gr
Copy link
Contributor Author

@mbed-bot Any action needed from my side?

@bridadan
Copy link
Contributor

@mbed-bot: TEST

HOST_OSES=ALL
BUILD_TOOLCHAINS=ALL
TARGETS=NCS36510

@mbed-bot
Copy link

[Build 1048]
SUCCESS: Building succeeded and tests were run! Be sure to check the test results

@bridadan
Copy link
Contributor

@pradeep-gr nope, all tests look ok. Just need someone to review now! @0xc0170 Do you have a second to take a look?

@sg-
Copy link
Contributor

sg- commented Oct 19, 2016

@pradeep-gr also need a conflict resolved.

@pradeep-gr
Copy link
Contributor Author

@sg Conflict resolved

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 20, 2016

Thanks for rebasing.

Note for future: please refrain from mixing non-related changes (removing warnings, adding TRNG, etc). It's more difficult to review/integrate, easier to end up with conflicts.

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 20, 2016

/morph test-nightly

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 924

Test failed!

@bridadan
Copy link
Contributor

Tests look OK

@pradeep-gr
Copy link
Contributor Author

@0xc0170 That was not intentional. Due to difficulty in re-basing.

@pradeep-gr
Copy link
Contributor Author

Last commit will solve issue #3038

@pradeep-gr
Copy link
Contributor Author

mbedtls_entropy_self_test_fail

mbedtls_entropy_self_test is failing on new re-based fork. Find snapshot attached.

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 24, 2016

mbedtls_entropy_self_test is failing on new re-based fork. Find snapshot attached.

Any details for this?

@pradeep-gr
Copy link
Contributor Author

mbed-os-tests-mbedtls-selftest_result.txt
Attached is test result.

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 25, 2016

@pradeep-gr Have you investigated why it fails?

cc @andresag01 @sbutcher-arm - please look at the test results above (failure)

@pradeep-gr
Copy link
Contributor Author

@0xc0170 I tried to investigate. But i do not think i have access to some of the files. Eg: This test uses self_test_function() function where i do not have access. Please let me know if there is any HAL dependency. I do not think this test reaching till trng APIs.

@andresag01
Copy link

@pradeep-gr: The mbedtls_entropy_self_test() functionality is in https://github.com/ARMmbed/mbed-os/blob/master/features/mbedtls/src/entropy.c#L578. They test the mbedtls_hardware_poll() function which, as far as I understand, is implemented using the TRGN API in mbed OS https://github.com/ARMmbed/mbed-os/blob/master/features/mbedtls/platform/src/mbed_trng.c#L21.

@andresag01
Copy link

@pradeep-gr, @0xc0170: Unfortunately, the mbedgt test output contains very little information related to the cause of the failure. The only text I can see related to the failure is:

[1477376794.62][CONN][RXD] :67::FAIL: Expected 1 Was 0
[1477376794.67][CONN][INF] found KV pair in stream: {{__testcase_finish;mbedtls_entropy_self_test;0;
1}}, queued...
[1477376794.76][CONN][RXD] >>> 'mbedtls_entropy_self_test': 0 passed, 1 failed with reason 'Assertio
n Failed'

Could you please provide some more information? I would suggest running a stand-alone application that calls mbedtls_entropy_self_test() and mbedtls_entropy_source_self_test() with argument 1. Then start a debugger or put some print statements inside the self_test() functions to see where it fails.

@pradeep-gr
Copy link
Contributor Author

@andresag01 @0xc0170 As I mentioned i do not have access to some of the functions used by mbedtls_entropy_self_test() I cannot fetch more debug details. Please try to reproduce at your side. And this test not reaching HAL trng module also.

@andresag01
Copy link

andresag01 commented Oct 25, 2016

@pradeep-gr, @0xc0170:

i do not have access to some of the functions used by mbedtls_entropy_self_test()

I am not sure I understand this, as I posted sometime ago, the mbedtls code is available under mbed-os/features/mbedtls and the functions of interest are https://github.com/ARMmbed/mbed-os/blob/master/features/mbedtls/src/entropy.c#L578.

this test not reaching HAL trng module also

I do not think this is correct. As I explained before, the function mbedtls_hardware_poll() from mbedtls is implemented in mbed OS using the TRNG API. The source code that does this is available at https://github.com/ARMmbed/mbed-os/blob/master/features/mbedtls/platform/src/mbed_trng.c#L21. Furthermore, I manually ran the entropy self tests, and I can confirm that control reaches your TRNG implementation at targets/TARGET_ONSEMI/TARGET_NCS36510/ncs36510_trng_api.c.

The mbedtls entropy self test is divided in two parts. The one that seems to be failing in this PR is mbedtls_entropy_source_self_test(). This part does some simple checks directly in the output of the output of the TRNG API in the case of mbed OS. I printed the entropy gathered during the test and got the following output:

First gather: 00 00 30 a8 00 00 00 80 00 00 00 00 00 00 00 00 
Second gather: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
Third gather: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 

Clearly, the data gathered does not contain much entropy, and this is the reason why the test is failing.

@pradeep-gr
Copy link
Contributor Author

@andresag01 @0xc0170 mbed-os-tests-mbedtls-selftest issue fixed. Issue was due to optimization. This test was passing in IAR as IAR is using different optimization level for debug.
Please verify with commit bb824c6

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 26, 2016

@andresag01 Thanks for the help. Can you please verify that now this all passing mbedtls tests?

@bridadan
Copy link
Contributor

/morph test-nightly

@andresag01
Copy link

@0xc0170: I have run the mbedtls self test with the latest version of this PR and it seems to pass. However, I would like to clarify that I have NOT reviewed this code and cannot comment on anything regarding its quality and correctness other than the mbedtls_entropy_self_test passes as reported by mbedgt.

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 952

All builds and test passed!

@bridadan
Copy link
Contributor

Yay, 100% passing nightly again! 😄 Can we get this PR merged soon?

@0xc0170 0xc0170 merged commit 6eac2b0 into ARMmbed:master Oct 28, 2016
oter pushed a commit to oter/mbed-os that referenced this pull request Nov 21, 2016
Release mbed OS 5.2.2 and mbed lib v129

Known issues in this release

There is currently a DNS resolution failure in Thread mode with this release. This causes a failure in the
mbed-os-example-client. This will be fixed in a subsequent release. This can be worked around by reverting
to mbed-os-5.2.0

Ports for Upcoming Targets

3011: Add u-blox Sara-N target. ARMmbed#3011
3099: MAX32625 ARMmbed#3099
3151: Add support for FRDM-K82F ARMmbed#3151
3177: New mcu k22512 fixing pr 3136 ARMmbed#3177

Fixes and Changes

2990: [tools] Parallel building of tests ARMmbed#2990
3008: NUCLEO_F072RB: Fix wrong timer channel number on pwm PB_5 pin ARMmbed#3008
3013: STM32xx - Change how the ADC internal pins are checked before pinmap_ ARMmbed#3013
3023: digital_loop tests update for STM32 ARMmbed#3023
3041: [nRF5] - added implementation of API of serial port flow control configuration. ARMmbed#3041
3092: [tools + tests] Adding parallelized build option for iar and uvision exporters ARMmbed#3092
3084: [nrf5] fix in Digital I/O : a gpioe pin was uninitialized badly ARMmbed#3084
3009: TRNG enabled. TRNG APIs implemented. REV A/B/C/D flags removed. Warnings removed ARMmbed#3009
3139: Handle [NOT_SUPPORTED] exception in make.py ARMmbed#3139
3074: Target stm init gcc alignement ARMmbed#3074
3140: [tests] Replacing getchar with RawSerial getc in greentea-client ARMmbed#3140
3158: Added support for 6lowpan PAN ID filter to mbed mesh api configuration ARMmbed#3158
2988: Update of can_api.c fixing ARMmbed#2987 ARMmbed#2988
3175: Updating IAR definition for the NCS36510 for IAR EW v7.8 ARMmbed#3175
3170: [tests] Preventing test from printing before Greentea __sync ARMmbed#3170
3169: [Update of ARMmbed#3014] Usb updates ARMmbed#3169
3143: CFStore fix needed for the Cloud Client ARMmbed#3143
3135: lwip - Fix memory leak in k64f cyclic-buffer overflow ARMmbed#3135
3048: Make update.py test compile examples prior to updating mbed-os version. ARMmbed#3048
3162: lwip/nsapi - Clean up warnings in network code ARMmbed#3162
3161: nsapi - Add better heuristic for the default record of DNS queries ARMmbed#3161
3173: [Exporters] Add a device_name to microbit entry in targets.json ARMmbed#3173
3072: i2c_loop tests update for STM32 ARMmbed#3072
2958: Allowing mbed_app.json files to be discovered for tests. ARMmbed#2958
2969: [nRF52] - switch irq priorities of driver handlers to the lowest level ARMmbed#2969
3078: lwip: Allow several configuration macros to be set externally (bis) ARMmbed#3078
3165: Add address type checks to NanostackInterface ARMmbed#3165
3166: nsapi_dns: Provide 2 IPv6-hosted default servers ARMmbed#3166
3171: [tools] Fixing project.py -S printing problem ARMmbed#3171
3172: [Exporters] New export-build tests ARMmbed#3172
3184: ARMmbed#3183 Compiler warning in trng_api.c with K64F  ARMmbed#3184
3185: Update tests to fix build failures. Also make the code similar to oth ARMmbed#3185
3104: [NuMaker] Support CAN and fix PWM CLK error ARMmbed#3104
3182: Exporter documentation ARMmbed#3182
3186: MultiTech mDot - add back SPI3 pins ARMmbed#3186
3187: [Export-Make] Use internal class variable for resolving templates in makefiles ARMmbed#3187
3195: [Exporters - Make-based] Quote the shell call in mkdir and rmdir ARMmbed#3195
3204: [Export build-test] Directory traversal error ARMmbed#3204
3189: [Exporters - Make-based] Force make exporter to search PATH for compilers ARMmbed#3189
3200: Using Popen for uVision and unifying the structure of the build function ARMmbed#3200
3075: nsapi - Add standardized return types for size and errors ARMmbed#3075
3221: u-blox odin w2 drivers update ARMmbed#3221
aisair pushed a commit to aisair/mbed that referenced this pull request Apr 30, 2024
Ports for Upcoming Targets

3011: Add u-blox Sara-N target. ARMmbed/mbed-os#3011
3099: MAX32625 ARMmbed/mbed-os#3099
3151: Add support for FRDM-K82F ARMmbed/mbed-os#3151
3177: New mcu k22512 fixing pr 3136 ARMmbed/mbed-os#3177

Fixes and Changes

3008: NUCLEO_F072RB: Fix wrong timer channel number on pwm PB_5 pin ARMmbed/mbed-os#3008
3013: STM32xx - Change how the ADC internal pins are checked before pinmap_ ARMmbed/mbed-os#3013
3041: [nRF5] - added implementation of API of serial port flow control configuration. ARMmbed/mbed-os#3041
3084: [nrf5] fix in Digital I/O : a gpioe pin was uninitialized badly ARMmbed/mbed-os#3084
3009: TRNG enabled. TRNG APIs implemented. REV A/B/C/D flags removed. Warnings removed ARMmbed/mbed-os#3009
3074: Target stm init gcc alignement ARMmbed/mbed-os#3074
2988: Update of can_api.c fixing #2987 ARMmbed/mbed-os#2988
3173: [Exporters] Add a device_name to microbit entry in targets.json ARMmbed/mbed-os#3173
2969: [nRF52] - switch irq priorities of driver handlers to the lowest level ARMmbed/mbed-os#2969
3184: #3183 Compiler warning in trng_api.c with K64F  ARMmbed/mbed-os#3184
3104: [NuMaker] Support CAN and fix PWM CLK error ARMmbed/mbed-os#3104
3186: MultiTech mDot - add back SPI3 pins ARMmbed/mbed-os#3186
3075: nsapi - Add standardized return types for size and errors ARMmbed/mbed-os#3075
3221: u-blox odin w2 drivers update ARMmbed/mbed-os#3221
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants