Skip to content
This repository was archived by the owner on Sep 6, 2023. It is now read-only.
This repository was archived by the owner on Sep 6, 2023. It is now read-only.

extmod/modussl_mbedtls non-random CTR_DRBG #122

@annejan

Description

@annejan

The random function returning 0
https://github.com/micropython/micropython-esp32/blob/esp32/extmod/modussl_mbedtls.c#L74
And the random seed starting with "upy"
https://github.com/micropython/micropython-esp32/blob/esp32/extmod/modussl_mbedtls.c#L123
Makes me feel this is not very random / cryptographically sound.

Could it be this was done to work around the ESP8266's lack of resources?
If so would you be open to a PR changing this for the ESP32?

I completely get not including hundreds of root CA's etc, and not validating certificates, but the above seems more of a risk factor than that posed by a MitM . .

Since mbedtls uses a Counter mode Deterministic Random Byte Generator which is currently always seeded with "upy" and has no source of randomness.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions