Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
error.h
00001 /** 00002 * \file error.h 00003 * 00004 * \brief Error to string translation 00005 */ 00006 /* 00007 * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 00008 * SPDX-License-Identifier: Apache-2.0 00009 * 00010 * Licensed under the Apache License, Version 2.0 (the "License"); you may 00011 * not use this file except in compliance with the License. 00012 * You may obtain a copy of the License at 00013 * 00014 * http://www.apache.org/licenses/LICENSE-2.0 00015 * 00016 * Unless required by applicable law or agreed to in writing, software 00017 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 00018 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00019 * See the License for the specific language governing permissions and 00020 * limitations under the License. 00021 * 00022 * This file is part of mbed TLS (https://tls.mbed.org) 00023 */ 00024 #ifndef MBEDTLS_ERROR_H 00025 #define MBEDTLS_ERROR_H 00026 00027 #include <stddef.h> 00028 00029 /** 00030 * Error code layout. 00031 * 00032 * Currently we try to keep all error codes within the negative space of 16 00033 * bits signed integers to support all platforms (-0x0001 - -0x7FFF). In 00034 * addition we'd like to give two layers of information on the error if 00035 * possible. 00036 * 00037 * For that purpose the error codes are segmented in the following manner: 00038 * 00039 * 16 bit error code bit-segmentation 00040 * 00041 * 1 bit - Unused (sign bit) 00042 * 3 bits - High level module ID 00043 * 5 bits - Module-dependent error code 00044 * 7 bits - Low level module errors 00045 * 00046 * For historical reasons, low-level error codes are divided in even and odd, 00047 * even codes were assigned first, and -1 is reserved for other errors. 00048 * 00049 * Low-level module errors (0x0002-0x007E, 0x0003-0x007F) 00050 * 00051 * Module Nr Codes assigned 00052 * MPI 7 0x0002-0x0010 00053 * GCM 3 0x0012-0x0014 0x0013-0x0013 00054 * BLOWFISH 3 0x0016-0x0018 0x0017-0x0017 00055 * THREADING 3 0x001A-0x001E 00056 * AES 5 0x0020-0x0022 0x0021-0x0025 00057 * CAMELLIA 3 0x0024-0x0026 0x0027-0x0027 00058 * XTEA 2 0x0028-0x0028 0x0029-0x0029 00059 * BASE64 2 0x002A-0x002C 00060 * OID 1 0x002E-0x002E 0x000B-0x000B 00061 * PADLOCK 1 0x0030-0x0030 00062 * DES 2 0x0032-0x0032 0x0033-0x0033 00063 * CTR_DBRG 4 0x0034-0x003A 00064 * ENTROPY 3 0x003C-0x0040 0x003D-0x003F 00065 * NET 11 0x0042-0x0052 0x0043-0x0045 00066 * ARIA 4 0x0058-0x005E 00067 * ASN1 7 0x0060-0x006C 00068 * CMAC 1 0x007A-0x007A 00069 * PBKDF2 1 0x007C-0x007C 00070 * HMAC_DRBG 4 0x0003-0x0009 00071 * CCM 3 0x000D-0x0011 00072 * ARC4 1 0x0019-0x0019 00073 * MD2 1 0x002B-0x002B 00074 * MD4 1 0x002D-0x002D 00075 * MD5 1 0x002F-0x002F 00076 * RIPEMD160 1 0x0031-0x0031 00077 * SHA1 1 0x0035-0x0035 00078 * SHA256 1 0x0037-0x0037 00079 * SHA512 1 0x0039-0x0039 00080 * 00081 * High-level module nr (3 bits - 0x0...-0x7...) 00082 * Name ID Nr of Errors 00083 * PEM 1 9 00084 * PKCS#12 1 4 (Started from top) 00085 * X509 2 20 00086 * PKCS5 2 4 (Started from top) 00087 * DHM 3 11 00088 * PK 3 15 (Started from top) 00089 * RSA 4 11 00090 * ECP 4 9 (Started from top) 00091 * MD 5 5 00092 * CIPHER 6 8 00093 * SSL 6 17 (Started from top) 00094 * SSL 7 31 00095 * 00096 * Module dependent error code (5 bits 0x.00.-0x.F8.) 00097 */ 00098 00099 #ifdef __cplusplus 00100 extern "C" { 00101 #endif 00102 00103 /** 00104 * \brief Translate a mbed TLS error code into a string representation, 00105 * Result is truncated if necessary and always includes a terminating 00106 * null byte. 00107 * 00108 * \param errnum error code 00109 * \param buffer buffer to place representation in 00110 * \param buflen length of the buffer 00111 */ 00112 void mbedtls_strerror( int errnum, char *buffer, size_t buflen ); 00113 00114 #ifdef __cplusplus 00115 } 00116 #endif 00117 00118 #endif /* error.h */
Generated on Tue Jul 12 2022 12:43:57 by
