Tom Cosgrove | b2fafa5 | 2023-09-01 14:40:21 +0100 | [diff] [blame] | 1 | /* mbedtls_config.h modifier that defines mbedtls_platform_zeroize() to be |
Tom Cosgrove | 7eced7d | 2023-09-01 13:55:39 +0100 | [diff] [blame] | 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 | |
Tom Cosgrove | 7eced7d | 2023-09-01 13:55:39 +0100 | [diff] [blame] | 22 | #include <string.h> |
| 23 | |
| 24 | /* Define _ALT so we don't get the built-in implementation. The test code will |
| 25 | * also need to define MBEDTLS_TEST_DEFINES_ZEROIZE so we don't get the |
| 26 | * declaration. */ |
| 27 | #define MBEDTLS_PLATFORM_ZEROIZE_ALT |
| 28 | |
| 29 | #define mbedtls_platform_zeroize(buf, len) memset(buf, 0, len) |