1 (edited by sergiop 2020-08-06 07:58:49)

Topic: [SOLVED] Compilation errors on iOS

Hi,

I have an iOS app that uses OpenSSL, and to reduce memory usage I wanted to give it a try to wolfSSL. Unfortunately I'm having trouble compiling my project with wolfSSL.

To build wolfSSL I'm defining IPHONE, as well as passing the following flags to configure

                "--enable-opensslall",
                "--enable-opensslextra",
                "--enable-asio",
                "--enable-static",
                "--disable-shared",
                "--enable-lowresource",
                "--enable-sni",
                "--enable-alpn",
                "--enable-ecc",
                "--enable-sp",
                "--enable-harden",
                "--enable-fastmath",
                "--enable-tls13",
                "--disable-oldtls",
                "--disable-pwdbased",
                "--enable-poly1305",
                "--enable-chacha",
                "--enable-supportedcurves",
                "--enable-extended-master",
                "--enable-sha3=small",
                "--enable-aesgcm=small",
                "--enable-curve25519=small",
                "--enable-ed25519=small",
                "--enable-certgen",
                "--enable-certreq",
                "--enable-certext",
                "--disable-examples"

When I try to compile my project I get compilation errors only with ASN1 and certificate extensions:

In file included from /Users/spaque/Workspace/proxy/src/cert/Certificate.cpp:1:
In file included from /Users/spaque/Workspace/proxy/src/cert/Certificate.h:8:
In file included from /Users/spaque/.conan/data/wolfssl/4.4.0/_/_/package/a53c403ad85370bc61eaa67d47bf767b370c82cf/include/wolfssl/openssl/ssl.h:35:
In file included from /Users/spaque/.conan/data/wolfssl/4.4.0/_/_/package/a53c403ad85370bc61eaa67d47bf767b370c82cf/include/wolfssl/ssl.h:3208:
/Users/spaque/.conan/data/wolfssl/4.4.0/_/_/package/a53c403ad85370bc61eaa67d47bf767b370c82cf/include/wolfssl/openssl/asn1.h:126:66: error: expected ')'
WOLFSSL_API void *wolfSSL_ASN1_item_new(const WOLFSSL_ASN1_ITEM *template);
                                                                 ^
/Users/spaque/.conan/data/wolfssl/4.4.0/_/_/package/a53c403ad85370bc61eaa67d47bf767b370c82cf/include/wolfssl/openssl/asn1.h:126:40: note: to match this
 '('
WOLFSSL_API void *wolfSSL_ASN1_item_new(const WOLFSSL_ASN1_ITEM *template);
                                       ^
/Users/spaque/.conan/data/wolfssl/4.4.0/_/_/package/a53c403ad85370bc61eaa67d47bf767b370c82cf/include/wolfssl/openssl/asn1.h:127:77: error: expected ')'
WOLFSSL_API void wolfSSL_ASN1_item_free(void *val, const WOLFSSL_ASN1_ITEM *template);
                                                                            ^
/Users/spaque/.conan/data/wolfssl/4.4.0/_/_/package/a53c403ad85370bc61eaa67d47bf767b370c82cf/include/wolfssl/openssl/asn1.h:127:40: note: to match this
 '('
WOLFSSL_API void wolfSSL_ASN1_item_free(void *val, const WOLFSSL_ASN1_ITEM *template);
                                       ^
/Users/spaque/.conan/data/wolfssl/4.4.0/_/_/package/a53c403ad85370bc61eaa67d47bf767b370c82cf/include/wolfssl/openssl/asn1.h:129:64: error: expected ')'
                                      const WOLFSSL_ASN1_ITEM *template);
                                                               ^
/Users/spaque/.conan/data/wolfssl/4.4.0/_/_/package/a53c403ad85370bc61eaa67d47bf767b370c82cf/include/wolfssl/openssl/asn1.h:128:38: note: to match this
 '('
WOLFSSL_API int wolfSSL_ASN1_item_i2d(const void *src, byte **dest,
                                     ^
/Users/spaque/Workspace/proxy/src/cert/Certificate.cpp:116:13: error: use of undeclared identifier 'X509_add_ext'
            X509_add_ext(cert, extension, -1);
            ^

Before including ssl.h I'm always including wolfssl/options.h. Am I missing something or using incompatible configure flags?

Share

Re: [SOLVED] Compilation errors on iOS

Just realized the X509_add_ext function is not yet in the OpenSSL compatibility layer, simply adding

#define X509_add_ext wolfSSL_X509_add_ext

fixes that problem. However the issue with ASN1 remains.

Share

Re: [SOLVED] Compilation errors on iOS

Hi sergiop,

The word `template` is reserved with some compilers. This has already been renamed to `tpl` post v4.4.0 release here:
https://github.com/wolfSSL/wolfssl/pull/2921

I just pushed the fix for the missing `X509_add_ext` to PR:
https://github.com/wolfSSL/wolfssl/pull/3199

Thanks,
David Garske, wolfSSL

Share