[riot-notifications] [RIOT-OS/RIOT] pkg/mbedtls: initial pkg import to use entropy module (#15671)

Leandro Lanzieri notifications at github.com
Tue Jul 6 10:19:41 CEST 2021


@leandrolanzieri commented on this pull request.



> +
+menuconfig KCONFIG_USEMODULE_MBEDTLS
+    bool "Configure mbed TLS"
+    help
+        Configure mbed TLS using Kconfig.
+
+if KCONFIG_USEMODULE_MBEDTLS
+
+config MBEDTLS_SELF_TEST
+    bool "Enable the checkup functions (*_self_test)"
+    default y
+
+config MBEDTLS_ENTROPY_C
+    bool "Enable the platform-specific entropy code."
+    default y
+    depends on MBEDTLS_SHA256_C || MBEDTLS_SHA512_C

Where is `MBEDTLS_SHA512_C` being defined?

> +    help
+        Configure mbed TLS mbedtls entropy using Kconfig.
+
+if KCONFIG_USEMODULE_MBEDTLS_ENTROPY
+
+config MBEDTLS_ENTROPY_HARDWARE_ALT
+    bool "Let mbed TLS use your own implementation of a hardware entropy collector"
+    default y
+    help
+        Your function must be called
+        mbedtls_hardware_poll(), have the same prototype
+        as declared in entropy_poll.h, and accept NULL as
+        first argument.
+
+config MBEDTLS_NO_PLATFORM_ENTROPY
+    bool "Enable this macro to disable the built-in platform entropy functions"

```suggestion
    bool "Disable the built-in platform entropy functions"
```

> +#if IS_ACTIVE(CONFIG_MBEDTLS_SHA256_ALT)
 #define MBEDTLS_SHA256_ALT 1
+#endif

I think this may cause confusion. If the exposed configuration parameters to the user are the `CONFIG_` ones, then that's what should be documented in Doxygen. So in this case the user should find `CONFIG_MBEDTLS_SHA256_ALT` instead of `MBEDTLS_SHA256_ALT`.

Additionally, as all the configurations seem to default to `1`, we may need to guard them around a check for `CONFIG_KCONFIG_USEMODULE_MBEDTLS`, because `false` in Kconfig translates to a not defined macro.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/15671#pullrequestreview-699654136
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210706/627a7c06/attachment.htm>


More information about the notifications mailing list