]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
wolfssl: Rename `encrypt` methods to avoid conflicts with system headers
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Mon, 8 Aug 2022 07:52:19 +0000 (09:52 +0200)
committerTobias Brunner <tobias@strongswan.org>
Thu, 18 Aug 2022 08:41:15 +0000 (10:41 +0200)
Rename `encrypt` methods to avoid the following build failure when wolfSSL
is built with --enable-opensslextra:

In file included from ../../../../src/libstrongswan/utils/utils.h:59,
                 from ../../../../src/libstrongswan/library.h:101,
                 from wolfssl_common.h:29,
                 from wolfssl_aead.c:23:
wolfssl_aead.c:90:16: error: conflicting types for 'encrypt'; have '_Bool(union <anonymous>,  chunk_t,  chunk_t,  chunk_t,  chunk_t *)'
   90 | METHOD(aead_t, encrypt, bool,
      |                ^~~~~~~
../../../../src/libstrongswan/utils/utils/object.h:99:20: note: in definition of macro 'METHOD'
   99 |         static ret name(union {iface *_public; this;} \
      |                    ^~~~
In file included from /home/autobuild/autobuild/instance-5/output-1/host/powerpc64le-buildroot-linux-musl/sysroot/usr/include/wolfssl/wolfcrypt/wc_port.h:573,
                 from /home/autobuild/autobuild/instance-5/output-1/host/powerpc64le-buildroot-linux-musl/sysroot/usr/include/wolfssl/wolfcrypt/types.h:35,
                 from /home/autobuild/autobuild/instance-5/output-1/host/powerpc64le-buildroot-linux-musl/sysroot/usr/include/wolfssl/wolfcrypt/logging.h:33,
                 from /home/autobuild/autobuild/instance-5/output-1/host/powerpc64le-buildroot-linux-musl/sysroot/usr/include/wolfssl/ssl.h:35,
                 from wolfssl_common.h:64,
                 from wolfssl_aead.c:23:
/home/autobuild/autobuild/instance-5/output-1/host/powerpc64le-buildroot-linux-musl/sysroot/usr/include/unistd.h:149:6: note: previous declaration of 'encrypt' with type 'void(char *, int)'
  149 | void encrypt(char *, int);
      |      ^~~~~~~

Closes strongswan/strongswan#1201

src/libstrongswan/plugins/wolfssl/wolfssl_aead.c
src/libstrongswan/plugins/wolfssl/wolfssl_crypter.c
src/libstrongswan/plugins/wolfssl/wolfssl_ec_public_key.c
src/libstrongswan/plugins/wolfssl/wolfssl_ed_public_key.c
src/libstrongswan/plugins/wolfssl/wolfssl_rsa_public_key.c

index 2ea7c94cd65166aa580a72fcff378705d1a7657e..44f054916cfa21cb91e1fc69dbc420335f33f22f 100644 (file)
@@ -87,7 +87,7 @@ struct private_aead_t {
        encryption_algorithm_t alg;
 };
 
-METHOD(aead_t, encrypt, bool,
+METHOD(aead_t, encrypt_, bool,
        private_aead_t *this, chunk_t plain, chunk_t assoc, chunk_t iv,
        chunk_t *encrypted)
 {
@@ -323,7 +323,7 @@ aead_t *wolfssl_aead_create(encryption_algorithm_t algo,
 
        INIT(this,
                .public = {
-                       .encrypt = _encrypt,
+                       .encrypt = _encrypt_,
                        .decrypt = _decrypt,
                        .get_block_size = _get_block_size,
                        .get_icv_size = _get_icv_size,
index cffe7ba23752c8632a6596dd1e82476f73ed7c76..085a912404c621e60715411079d4c5f1dffcc95a 100644 (file)
@@ -230,7 +230,7 @@ METHOD(crypter_t, decrypt, bool,
        return success;
 }
 
-METHOD(crypter_t, encrypt, bool,
+METHOD(crypter_t, encrypt_, bool,
        private_wolfssl_crypter_t *this, chunk_t data, chunk_t iv, chunk_t *dst)
 {
        u_char *out;
@@ -578,7 +578,7 @@ wolfssl_crypter_t *wolfssl_crypter_create(encryption_algorithm_t algo,
        INIT(this,
                .public = {
                        .crypter = {
-                               .encrypt = _encrypt,
+                               .encrypt = _encrypt_,
                                .decrypt = _decrypt,
                                .get_block_size = _get_block_size,
                                .get_iv_size = _get_iv_size,
index d8a1ededb06fcd4b6ac33665def0a6e5832921a1..110543762f213acd80358b4daf7cd1d18939481c 100644 (file)
@@ -193,7 +193,7 @@ METHOD(public_key_t, verify, bool,
        }
 }
 
-METHOD(public_key_t, encrypt, bool,
+METHOD(public_key_t, encrypt_, bool,
        private_wolfssl_ec_public_key_t *this, encryption_scheme_t scheme,
        void *params, chunk_t crypto, chunk_t *plain)
 {
@@ -324,7 +324,7 @@ static private_wolfssl_ec_public_key_t *create_empty()
                        .key = {
                                .get_type = _get_type,
                                .verify = _verify,
-                               .encrypt = _encrypt,
+                               .encrypt = _encrypt_,
                                .get_keysize = _get_keysize,
                                .equals = public_key_equals,
                                .get_fingerprint = _get_fingerprint,
index f423d8d5691029ac6568a8b48e2d93fec7a0db5d..ea0fb3dfc7709bb5655812e359fb8d019c2b9848 100644 (file)
@@ -111,7 +111,7 @@ METHOD(public_key_t, verify, bool,
        return ret == 0 && res == 1;
 }
 
-METHOD(public_key_t, encrypt, bool,
+METHOD(public_key_t, encrypt_, bool,
        private_public_key_t *this, encryption_scheme_t scheme,
        void *params, chunk_t crypto, chunk_t *plain)
 {
@@ -368,7 +368,7 @@ static private_public_key_t *create_empty(key_type_t type)
                .public = {
                        .get_type = _get_type,
                        .verify = _verify,
-                       .encrypt = _encrypt,
+                       .encrypt = _encrypt_,
                        .get_keysize = _get_keysize,
                        .equals = public_key_equals,
                        .get_fingerprint = _get_fingerprint,
index 72df115fe907ab06f992da9615d46738b2f5116b..da8899c2d8ce79940bad1d1c5e66e1eb7928103b 100644 (file)
@@ -216,7 +216,7 @@ METHOD(public_key_t, verify, bool,
        }
 }
 
-METHOD(public_key_t, encrypt, bool,
+METHOD(public_key_t, encrypt_, bool,
        private_wolfssl_rsa_public_key_t *this, encryption_scheme_t scheme,
        void *params, chunk_t plain, chunk_t *crypto)
 {
@@ -440,7 +440,7 @@ static private_wolfssl_rsa_public_key_t *create_empty()
                        .key = {
                                .get_type = _get_type,
                                .verify = _verify,
-                               .encrypt = _encrypt,
+                               .encrypt = _encrypt_,
                                .equals = public_key_equals,
                                .get_keysize = _get_keysize,
                                .get_fingerprint = _get_fingerprint,