|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Fail-closed PSA external-RNG hook for the verify-only bootloader. More...
#include <stddef.h>#include <stdint.h>#include "mbedtls/platform_util.h"#include "psa/crypto.h"Go to the source code of this file.
Functions | |
| psa_status_t | mbedtls_psa_external_get_random (mbedtls_psa_external_random_context_t *context, uint8_t *output, size_t output_size, size_t *output_length) |
Fail-closed PSA external-RNG hook for the verify-only bootloader.
The vendored tf-psa-crypto port sets MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG, so the PSA core needs an mbedtls_psa_external_get_random symbol at link time. This immutable bootloader performs exactly ONE cryptographic operation: ECDSA-P256 signature verification over the public image body, the public provisioned root key, and the public trailer (via ra8_rot_verify_image from the RA8_ENABLE_ROOT_OF_TRUST launch gate). That operation is mathematically deterministic and draws NO randomness, and the bootloader never signs, generates a key, or derives a secret – so there is no secret here for randomness to protect.
Rather than link the deterministic placeholder RNG the KAT apps use (a latent catastrophe if this image were ever repurposed to sign or keygen), this hook FAILS CLOSED: any request for entropy returns PSA_ERROR_INSUFFICIENT_ENTROPY. On the verify-only boot path it is never called, so the bootloader authenticates and launches the genuine image normally. A call would mean an unexpected code path drew randomness – and for an immutable bootloader, failing loudly (rejecting the launch) is the correct, safe response, never emitting predictable bytes that could masquerade as entropy.
Definition in file psa_verify_rng.c.
| psa_status_t mbedtls_psa_external_get_random | ( | mbedtls_psa_external_random_context_t * | context, |
| uint8_t * | output, | ||
| size_t | output_size, | ||
| size_t * | output_length ) |
Definition at line 43 of file psa_verify_rng.c.