Gilles Peskine | 7a894f2 | 2019-11-26 16:06:46 +0100 | [diff] [blame] | 1 | /** |
| 2 | * \file psa/crypto_compat.h |
| 3 | * |
| 4 | * \brief PSA cryptography module: Backward compatibility aliases |
| 5 | * |
| 6 | * \note This file may not be included directly. Applications must |
| 7 | * include psa/crypto.h. |
| 8 | */ |
| 9 | /* |
| 10 | * Copyright (C) 2019, ARM Limited, All Rights Reserved |
| 11 | * SPDX-License-Identifier: Apache-2.0 |
| 12 | * |
| 13 | * Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 14 | * not use this file except in compliance with the License. |
| 15 | * You may obtain a copy of the License at |
| 16 | * |
| 17 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 18 | * |
| 19 | * Unless required by applicable law or agreed to in writing, software |
| 20 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 21 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 22 | * See the License for the specific language governing permissions and |
| 23 | * limitations under the License. |
| 24 | * |
| 25 | * This file is part of mbed TLS (https://tls.mbed.org) |
| 26 | */ |
| 27 | |
| 28 | #ifndef PSA_CRYPTO_COMPAT_H |
| 29 | #define PSA_CRYPTO_COMPAT_H |
| 30 | |
Gilles Peskine | 7a894f2 | 2019-11-26 16:06:46 +0100 | [diff] [blame] | 31 | #ifdef __cplusplus |
| 32 | extern "C" { |
| 33 | #endif |
| 34 | |
Gilles Peskine | 7b0ab6d | 2019-11-26 16:32:12 +0100 | [diff] [blame] | 35 | #if !defined(MBEDTLS_DEPRECATED_REMOVED) |
| 36 | |
| 37 | #if defined(MBEDTLS_DEPRECATED_WARNING) && !defined(MBEDTLS_PSA_DEPRECATED) |
| 38 | #define MBEDTLS_PSA_DEPRECATED __attribute__((deprecated)) |
| 39 | #else |
| 40 | #define MBEDTLS_PSA_DEPRECATED |
| 41 | #endif |
| 42 | |
| 43 | typedef MBEDTLS_PSA_DEPRECATED psa_status_t mbedtls_deprecated_psa_status_t; |
| 44 | |
| 45 | #define MBEDTLS_DEPRECATED_CONSTANT( type, value ) \ |
| 46 | ( (mbedtls_deprecated_##type) ( value ) ) |
| 47 | |
Gilles Peskine | 7a894f2 | 2019-11-26 16:06:46 +0100 | [diff] [blame] | 48 | /* |
| 49 | * Deprecated PSA Crypto error code definitions |
| 50 | */ |
Gilles Peskine | 7a894f2 | 2019-11-26 16:06:46 +0100 | [diff] [blame] | 51 | #define PSA_ERROR_UNKNOWN_ERROR \ |
Gilles Peskine | 7b0ab6d | 2019-11-26 16:32:12 +0100 | [diff] [blame] | 52 | MBEDTLS_DEPRECATED_CONSTANT( psa_status_t, PSA_ERROR_GENERIC_ERROR ) |
Gilles Peskine | 7a894f2 | 2019-11-26 16:06:46 +0100 | [diff] [blame] | 53 | #define PSA_ERROR_OCCUPIED_SLOT \ |
Gilles Peskine | 7b0ab6d | 2019-11-26 16:32:12 +0100 | [diff] [blame] | 54 | MBEDTLS_DEPRECATED_CONSTANT( psa_status_t, PSA_ERROR_ALREADY_EXISTS ) |
Gilles Peskine | 7a894f2 | 2019-11-26 16:06:46 +0100 | [diff] [blame] | 55 | #define PSA_ERROR_EMPTY_SLOT \ |
Gilles Peskine | 7b0ab6d | 2019-11-26 16:32:12 +0100 | [diff] [blame] | 56 | MBEDTLS_DEPRECATED_CONSTANT( psa_status_t, PSA_ERROR_DOES_NOT_EXIST ) |
Gilles Peskine | 7a894f2 | 2019-11-26 16:06:46 +0100 | [diff] [blame] | 57 | #define PSA_ERROR_INSUFFICIENT_CAPACITY \ |
Gilles Peskine | 7b0ab6d | 2019-11-26 16:32:12 +0100 | [diff] [blame] | 58 | MBEDTLS_DEPRECATED_CONSTANT( psa_status_t, PSA_ERROR_INSUFFICIENT_DATA ) |
Gilles Peskine | 7a894f2 | 2019-11-26 16:06:46 +0100 | [diff] [blame] | 59 | #define PSA_ERROR_TAMPERING_DETECTED \ |
Gilles Peskine | 7b0ab6d | 2019-11-26 16:32:12 +0100 | [diff] [blame] | 60 | MBEDTLS_DEPRECATED_CONSTANT( psa_status_t, PSA_ERROR_CORRUPTION_DETECTED ) |
| 61 | |
| 62 | #endif /* MBEDTLS_DEPRECATED_REMOVED */ |
Gilles Peskine | 7a894f2 | 2019-11-26 16:06:46 +0100 | [diff] [blame] | 63 | |
| 64 | #ifdef __cplusplus |
| 65 | } |
| 66 | #endif |
| 67 | |
| 68 | #endif /* PSA_CRYPTO_COMPAT_H */ |