Paul Bakker | 9d78140 | 2011-05-09 16:17:09 +0000 | [diff] [blame] | 1 | /** |
| 2 | * \file error.h |
| 3 | * |
| 4 | * \brief Error to string translation |
Darryl Green | a40a101 | 2018-01-05 15:33:17 +0000 | [diff] [blame] | 5 | */ |
| 6 | /* |
Bence Szépkúti | 1e14827 | 2020-08-07 13:07:28 +0200 | [diff] [blame] | 7 | * Copyright The Mbed TLS Contributors |
Dave Rodgman | 16799db | 2023-11-02 19:47:20 +0000 | [diff] [blame] | 8 | * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later |
Paul Bakker | 9d78140 | 2011-05-09 16:17:09 +0000 | [diff] [blame] | 9 | */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 10 | #ifndef MBEDTLS_ERROR_H |
| 11 | #define MBEDTLS_ERROR_H |
Paul Bakker | 9d78140 | 2011-05-09 16:17:09 +0000 | [diff] [blame] | 12 | |
Bence Szépkúti | c662b36 | 2021-05-27 11:25:03 +0200 | [diff] [blame] | 13 | #include "mbedtls/build_info.h" |
Harry Ramsey | 69b67c8 | 2024-10-10 13:13:37 +0100 | [diff] [blame] | 14 | #include "mbedtls/error_common.h" |
Ron Eldor | 9cbd1b2 | 2018-12-16 12:14:37 +0200 | [diff] [blame] | 15 | |
Rich Evans | 00ab470 | 2015-02-06 13:43:58 +0000 | [diff] [blame] | 16 | #include <stddef.h> |
Paul Bakker | 3c2122f | 2013-06-24 19:03:14 +0200 | [diff] [blame] | 17 | |
Paul Bakker | bcd5db4 | 2011-05-20 12:30:59 +0000 | [diff] [blame] | 18 | #ifdef __cplusplus |
| 19 | extern "C" { |
| 20 | #endif |
| 21 | |
Paul Bakker | 9d78140 | 2011-05-09 16:17:09 +0000 | [diff] [blame] | 22 | /** |
Gilles Peskine | 2e38a0d | 2023-09-12 19:19:31 +0200 | [diff] [blame] | 23 | * \brief Translate an Mbed TLS error code into a string representation. |
| 24 | * The result is truncated if necessary and always includes a |
| 25 | * terminating null byte. |
Paul Bakker | 9d78140 | 2011-05-09 16:17:09 +0000 | [diff] [blame] | 26 | * |
| 27 | * \param errnum error code |
| 28 | * \param buffer buffer to place representation in |
| 29 | * \param buflen length of the buffer |
| 30 | */ |
Gilles Peskine | 449bd83 | 2023-01-11 14:50:10 +0100 | [diff] [blame] | 31 | void mbedtls_strerror(int errnum, char *buffer, size_t buflen); |
Paul Bakker | e2ab84f | 2013-06-29 18:24:32 +0200 | [diff] [blame] | 32 | |
Paul Bakker | bcd5db4 | 2011-05-20 12:30:59 +0000 | [diff] [blame] | 33 | #ifdef __cplusplus |
| 34 | } |
| 35 | #endif |
| 36 | |
Paul Bakker | 9d78140 | 2011-05-09 16:17:09 +0000 | [diff] [blame] | 37 | #endif /* error.h */ |