blob: 7abb00fd03c5a050d925d113ded0744d05ee83a7 [file] [log] [blame]
Paul Bakker9d781402011-05-09 16:17:09 +00001/**
2 * \file error.h
3 *
4 * \brief Error to string translation
Darryl Greena40a1012018-01-05 15:33:17 +00005 */
6/*
Bence Szépkúti1e148272020-08-07 13:07:28 +02007 * Copyright The Mbed TLS Contributors
Dave Rodgman16799db2023-11-02 19:47:20 +00008 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
Paul Bakker9d781402011-05-09 16:17:09 +00009 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020010#ifndef MBEDTLS_ERROR_H
11#define MBEDTLS_ERROR_H
Paul Bakker9d781402011-05-09 16:17:09 +000012
Bence Szépkútic662b362021-05-27 11:25:03 +020013#include "mbedtls/build_info.h"
Harry Ramsey69b67c82024-10-10 13:13:37 +010014#include "mbedtls/error_common.h"
Ron Eldor9cbd1b22018-12-16 12:14:37 +020015
Rich Evans00ab4702015-02-06 13:43:58 +000016#include <stddef.h>
Paul Bakker3c2122f2013-06-24 19:03:14 +020017
Paul Bakkerbcd5db42011-05-20 12:30:59 +000018#ifdef __cplusplus
19extern "C" {
20#endif
21
Paul Bakker9d781402011-05-09 16:17:09 +000022/**
Gilles Peskine2e38a0d2023-09-12 19:19:31 +020023 * \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 Bakker9d781402011-05-09 16:17:09 +000026 *
27 * \param errnum error code
28 * \param buffer buffer to place representation in
29 * \param buflen length of the buffer
30 */
Gilles Peskine449bd832023-01-11 14:50:10 +010031void mbedtls_strerror(int errnum, char *buffer, size_t buflen);
Paul Bakkere2ab84f2013-06-29 18:24:32 +020032
Paul Bakkerbcd5db42011-05-20 12:30:59 +000033#ifdef __cplusplus
34}
35#endif
36
Paul Bakker9d781402011-05-09 16:17:09 +000037#endif /* error.h */