Annotation of embedaddon/strongswan/src/libstrongswan/plugins/wolfssl/wolfssl_common.h, revision 1.1.1.2

1.1       misho       1: /*
1.1.1.2 ! misho       2:  * Copyright (C) 2020 Tobias Brunner
        !             3:  * HSR Hochschule fuer Technik Rapperswil
        !             4:  *
1.1       misho       5:  * Copyright (C) 2019 Sean Parkinson, wolfSSL Inc.
                      6:  *
                      7:  * Permission is hereby granted, free of charge, to any person obtaining a copy
                      8:  * of this software and associated documentation files (the "Software"), to deal
                      9:  * in the Software without restriction, including without limitation the rights
                     10:  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
                     11:  * copies of the Software, and to permit persons to whom the Software is
                     12:  * furnished to do so, subject to the following conditions:
                     13:  *
                     14:  * The above copyright notice and this permission notice shall be included in
                     15:  * all copies or substantial portions of the Software.
                     16:  *
                     17:  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
                     18:  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
                     19:  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
                     20:  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
                     21:  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
                     22:  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
                     23:  * THE SOFTWARE.
                     24:  */
                     25: 
                     26: #ifndef WOLFSSL_PLUGIN_COMMON_H_
                     27: #define WOLFSSL_PLUGIN_COMMON_H_
                     28: 
                     29: #include <library.h>
                     30: 
                     31: /* Undefine these as they are enum entries in wolfSSL - same values */
                     32: #ifdef AES_BLOCK_SIZE
                     33: #undef AES_BLOCK_SIZE
                     34: #endif
                     35: 
                     36: #ifdef CAMELLIA_BLOCK_SIZE
                     37: #undef CAMELLIA_BLOCK_SIZE
                     38: #endif
                     39: 
                     40: #ifdef DES_BLOCK_SIZE
                     41: #undef DES_BLOCK_SIZE
                     42: #endif
                     43: 
                     44: #ifdef RSA_PSS_SALT_LEN_DEFAULT
                     45: #undef RSA_PSS_SALT_LEN_DEFAULT
                     46: #endif
                     47: 
                     48: /* PARSE_ERROR is an enum entry in wolfSSL - not used in this plugin */
                     49: #define PARSE_ERROR    WOLFSSL_PARSE_ERROR
                     50: 
                     51: /* Remap unused enums from the OpenSSL compatibility layer to avoid conflicts */
                     52: #define ASN1_BOOLEAN         REMAP_ASN1_BOOLEAN
                     53: #define ASN1_OID             REMAP_ASN1_OID
                     54: #define ASN1_INTEGER         REMAP_ASN1_INTEGER
                     55: #define ASN1_BIT_STRING      REMAP_ASN1_BIT_STRING
                     56: #define ASN1_IA5STRING       REMAP_ASN1_IA5STRING
                     57: #define ASN1_OCTET_STRING    REMAP_ASN1_OCTET_STRING
                     58: #define ASN1_UTCTIME         REMAP_ASN1_UTCTIME
                     59: #define ASN1_GENERALIZEDTIME REMAP_ASN1_GENERALIZEDTIME
                     60: 
                     61: #ifndef WOLFSSL_USER_SETTINGS
                     62:        #include <wolfssl/options.h>
                     63: #endif
                     64: #include <wolfssl/ssl.h>
                     65: 
1.1.1.2 ! misho      66: /* Special type used to handle EdDSA keys depending on config options */
        !            67: #if defined(HAVE_ED25519) || defined(HAVE_ED448)
        !            68: #ifdef HAVE_ED25519
        !            69: #include <wolfssl/wolfcrypt/ed25519.h>
        !            70: #endif
        !            71: #ifdef HAVE_ED448
        !            72: #include <wolfssl/wolfcrypt/ed448.h>
        !            73: #endif
        !            74: typedef union {
        !            75: #ifdef HAVE_ED25519
        !            76:        ed25519_key ed25519;
        !            77: #endif
        !            78: #ifdef HAVE_ED448
        !            79:        ed448_key ed448;
        !            80: #endif
        !            81: } wolfssl_ed_key;
        !            82: #endif /* HAVE_ED25519 || HAVE_ED448 */
        !            83: 
1.1       misho      84: #undef PARSE_ERROR
                     85: 
                     86: #undef ASN1_BOOLEAN
                     87: #undef ASN1_OID
                     88: #undef ASN1_INTEGER
                     89: #undef ASN1_BIT_STRING
                     90: #undef ASN1_IA5STRING
                     91: #undef ASN1_OCTET_STRING
                     92: #undef ASN1_UTCTIME
                     93: #undef ASN1_GENERALIZEDTIME
                     94: 
                     95: /* Eliminate macro conflicts */
                     96: #undef RNG
                     97: 
                     98: #endif /* WOLFSSL_PLUGIN_COMMON_H_ */

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>