1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

Merge pull request #3121 from gilles-peskine-arm/invasive_testing_strategy-crypto

Invasive testing strategy

Create a new header `common.h`.

Introduce a configuration option `MBEDTLS_TEST_HOOKS` for test-specific code, to be used in accordance with the invasive testing strategy.
This commit is contained in:
Gilles Peskine
2020-06-02 16:55:48 +02:00
committed by GitHub
9 changed files with 474 additions and 0 deletions

View File

@ -1,4 +1,12 @@
/* BEGIN_HEADER */
/* The tests in this module verify the contents of key store files. They
* access internal key storage functions directly. Some of the tests depend
* on the the storage format. On the other hand, these tests treat the storage
* subsystem as a black box, and in particular have no reliance on the
* internals of the ITS implementation.
*/
#include <stdint.h>
#include "psa_crypto_helpers.h"
@ -9,6 +17,10 @@
#define PSA_KEY_STORAGE_MAGIC_HEADER "PSA\0KEY"
#define PSA_KEY_STORAGE_MAGIC_HEADER_LENGTH ( sizeof( PSA_KEY_STORAGE_MAGIC_HEADER ) )
/* Enforce the storage format for keys. The storage format is not a public
* documented interface, but it must be preserved between versions so that
* upgrades work smoothly, so it's a stable interface nonetheless.
*/
typedef struct {
uint8_t magic[PSA_KEY_STORAGE_MAGIC_HEADER_LENGTH];
uint8_t version[4];

View File

@ -1,4 +1,10 @@
/* BEGIN_HEADER */
/* This test file is specific to the ITS implementation in PSA Crypto
* on top of stdio. It expects to know what the stdio name of a file is
* based on its keystore name.
*/
#include "../library/psa_crypto_its.h"
#include "psa_helpers.h"