blob: d1bfa17171e2ec10b01b92581c2ccbea544558eb [file] [log] [blame]
Tom Cosgrove7eced7d2023-09-01 13:55:39 +01001/* mbedtls_config.h wrapper that defines mbedtls_platform_zeroize() to be
2 * memset(), so that the compile can check arguments for us.
3 * Used for testing.
4 */
5/*
6 * Copyright The Mbed TLS Contributors
7 * SPDX-License-Identifier: Apache-2.0
8 *
9 * Licensed under the Apache License, Version 2.0 (the "License"); you may
10 * not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
12 *
13 * http://www.apache.org/licenses/LICENSE-2.0
14 *
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 */
21
22#include "mbedtls/mbedtls_config.h"
23
24#include <string.h>
25
26/* Define _ALT so we don't get the built-in implementation. The test code will
27 * also need to define MBEDTLS_TEST_DEFINES_ZEROIZE so we don't get the
28 * declaration. */
29#define MBEDTLS_PLATFORM_ZEROIZE_ALT
30
31#define mbedtls_platform_zeroize(buf, len) memset(buf, 0, len)