pjsip 2.8 with SSL 1.1.0f problem building for iOS

B
Boris
Fri, Feb 1, 2019 10:05 AM

Hi all,

I'm really having hard time building pjsip with ssl for iOS.
I used https://github.com/chebur/pjsip scripts, with slight changes to
versions.
Building library without SSL works fine.
After adding #define PJ_HAS_SSL_SOCK 1 to config_site.h and building.
ssl library is found

Using SSL prefix... /Users/speedy/Downloads/pjsip-master/build/openssl
checking for OpenSSL installations..
checking openssl/ssl.h usability... yes
checking openssl/ssl.h presence... yes
checking for openssl/ssl.h... yes
checking for ERR_load_BIO_strings in -lcrypto... yes
checking for SSL_CTX_new in -lssl... yes
OpenSSL library found, SSL support enabled

But after that there is a warning that typedef is not found in cipher.h and
hell brakes lose. Here is the warrning:
pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:79:29:
warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
typedef srtp_err_status_t (*srtp_cipher_alloc_func_t)

Here is the part where warning and errors start:

In file included from ../src/pjmedia/transport_srtp.c:97:
In file included from
/Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/crypto_kernel.h:49:
/Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:79:29:
warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
typedef srtp_err_status_t (*srtp_cipher_alloc_func_t)
^
/Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:79:9:
warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
typedef srtp_err_status_t (*srtp_cipher_alloc_func_t)

/Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:79:27:
error: function cannot return function type 'int (srtp_cipher_pointer_t *,
int, int)' (aka 'int (struct srtp_cipher_t **, int, int)')
typedef srtp_err_status_t (*srtp_cipher_alloc_func_t)
                          ^
/Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:86:5:
error: function cannot return function type 'srtp_err_status_t' (aka 'int
(int *)')
    (void *state, const uint8_t *key);
    ^
/Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:89:56:
error: function cannot return function type 'srtp_err_status_t' (aka 'int
(int *)')
typedef srtp_err_status_t
(*srtp_cipher_dealloc_func_t)(srtp_cipher_pointer_t cp);
                                                       ^
/Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:95:5:
error: function cannot return function type 'srtp_err_status_t' (aka 'int
(int *)')
    (void *state, const uint8_t *aad, uint32_t aad_len);
    ^
/Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:100:5:
error: function cannot return function type 'srtp_err_status_t' (aka 'int
(int *)')
    (void *state, uint8_t *buffer, unsigned int *octets_to_encrypt);
    ^
/Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:104:5:
error: function cannot return function type 'srtp_err_status_t' (aka 'int
(int *)')
    (void *state, uint8_t *buffer, unsigned int *octets_to_decrypt);
    ^
/Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:110:5:
error: function cannot return function type 'srtp_err_status_t' (aka 'int
(int *)')
    (void *state, uint8_t *iv, srtp_cipher_direction_t direction);
    ^
/Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:117:5:
error: function cannot return function type 'srtp_err_status_t' (aka 'int
(int *)')
    (void *state, uint8_t *tag, uint32_t *len);
    ^
/Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:143:5:
error: unknown type name 'srtp_cipher_alloc_func_t'
    srtp_cipher_alloc_func_t alloc;
    ^
/Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:153:5:
error: unknown type name 'srtp_cipher_type_id_t'
    srtp_cipher_type_id_t id;
    ^
/Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:176:45:
error: function cannot return function type 'srtp_err_status_t' (aka 'int
(int *)')
srtp_err_status_t srtp_cipher_type_self_test(const srtp_cipher_type_t *ct);
                                            ^
/Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:184:40:
error: function cannot return function type 'srtp_err_status_t' (aka 'int
(int *)')
srtp_err_status_t srtp_cipher_type_test(const srtp_cipher_type_t *ct, const
srtp_cipher_test_case_t *test_data);
                                       ^
/Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:199:41:
error: function cannot return function type 'srtp_err_status_t' (aka 'int
(int *)')
srtp_err_status_t srtp_cipher_type_alloc(const srtp_cipher_type_t *ct,
srtp_cipher_t **c, int key_len, int tlen);
                                        ^
/Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:200:38:
error: function cannot return function type 'srtp_err_status_t' (aka 'int
(int *)')
srtp_err_status_t srtp_cipher_dealloc(srtp_cipher_t *c);
                                     ^
/Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:201:35:
error: function cannot return function type 'srtp_err_status_t' (aka 'int
(int *)')
srtp_err_status_t srtp_cipher_init(srtp_cipher_t *c, const uint8_t *key);
                                  ^
/Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:202:37:
error: function cannot return function type 'srtp_err_status_t' (aka 'int
(int *)')
srtp_err_status_t srtp_cipher_set_iv(srtp_cipher_t *c, uint8_t *iv, int
direction);
                                    ^
/Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:203:37:
error: function cannot return function type 'srtp_err_status_t' (aka 'int
(int *)')
srtp_err_status_t srtp_cipher_output(srtp_cipher_t *c, uint8_t *buffer,
uint32_t *num_octets_to_output);
                                    ^
/Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:204:38:
error: function cannot return function type 'srtp_err_status_t' (aka 'int
(int *)')
srtp_err_status_t srtp_cipher_encrypt(srtp_cipher_t *c, uint8_t *buffer,
uint32_t *num_octets_to_output);
                                     ^
/Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:205:38:
error: function cannot return function type 'srtp_err_status_t' (aka 'int
(int *)')
srtp_err_status_t srtp_cipher_decrypt(srtp_cipher_t *c, uint8_t *buffer,
uint32_t *num_octets_to_output);
                                     ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
2 warnings and 20 errors generated.
make[2]: *** [output/pjmedia-armv7-apple-darwin_ios/transport_srtp.o] Error
1
make[1]: *** [libpjmedia-armv7-apple-darwin_ios.a] Error 2
make: *** [lib] Error 1


I have attached whole log.
Any help would be appreciated.
Tnx,
Boris



Hi all, I'm really having hard time building pjsip with ssl for iOS. I used https://github.com/chebur/pjsip scripts, with slight changes to versions. Building library without SSL works fine. After adding #define PJ_HAS_SSL_SOCK 1 to config_site.h and building. ssl library is found ------------------------------- Using SSL prefix... /Users/speedy/Downloads/pjsip-master/build/openssl checking for OpenSSL installations.. checking openssl/ssl.h usability... yes checking openssl/ssl.h presence... yes checking for openssl/ssl.h... yes checking for ERR_load_BIO_strings in -lcrypto... yes checking for SSL_CTX_new in -lssl... yes OpenSSL library found, SSL support enabled -------------------------------- But after that there is a warning that typedef is not found in cipher.h and hell brakes lose. Here is the warrning: pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:79:29: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] typedef srtp_err_status_t (*srtp_cipher_alloc_func_t) --------------------------------------------------------------------------- Here is the part where warning and errors start: In file included from ../src/pjmedia/transport_srtp.c:97: In file included from /Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/crypto_kernel.h:49: /Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:79:29: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] typedef srtp_err_status_t (*srtp_cipher_alloc_func_t) ^ /Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:79:9: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] typedef srtp_err_status_t (*srtp_cipher_alloc_func_t) ~~~~~~~ ^ /Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:79:27: error: function cannot return function type 'int (srtp_cipher_pointer_t *, int, int)' (aka 'int (struct srtp_cipher_t **, int, int)') typedef srtp_err_status_t (*srtp_cipher_alloc_func_t) ^ /Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:86:5: error: function cannot return function type 'srtp_err_status_t' (aka 'int (int *)') (void *state, const uint8_t *key); ^ /Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:89:56: error: function cannot return function type 'srtp_err_status_t' (aka 'int (int *)') typedef srtp_err_status_t (*srtp_cipher_dealloc_func_t)(srtp_cipher_pointer_t cp); ^ /Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:95:5: error: function cannot return function type 'srtp_err_status_t' (aka 'int (int *)') (void *state, const uint8_t *aad, uint32_t aad_len); ^ /Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:100:5: error: function cannot return function type 'srtp_err_status_t' (aka 'int (int *)') (void *state, uint8_t *buffer, unsigned int *octets_to_encrypt); ^ /Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:104:5: error: function cannot return function type 'srtp_err_status_t' (aka 'int (int *)') (void *state, uint8_t *buffer, unsigned int *octets_to_decrypt); ^ /Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:110:5: error: function cannot return function type 'srtp_err_status_t' (aka 'int (int *)') (void *state, uint8_t *iv, srtp_cipher_direction_t direction); ^ /Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:117:5: error: function cannot return function type 'srtp_err_status_t' (aka 'int (int *)') (void *state, uint8_t *tag, uint32_t *len); ^ /Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:143:5: error: unknown type name 'srtp_cipher_alloc_func_t' srtp_cipher_alloc_func_t alloc; ^ /Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:153:5: error: unknown type name 'srtp_cipher_type_id_t' srtp_cipher_type_id_t id; ^ /Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:176:45: error: function cannot return function type 'srtp_err_status_t' (aka 'int (int *)') srtp_err_status_t srtp_cipher_type_self_test(const srtp_cipher_type_t *ct); ^ /Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:184:40: error: function cannot return function type 'srtp_err_status_t' (aka 'int (int *)') srtp_err_status_t srtp_cipher_type_test(const srtp_cipher_type_t *ct, const srtp_cipher_test_case_t *test_data); ^ /Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:199:41: error: function cannot return function type 'srtp_err_status_t' (aka 'int (int *)') srtp_err_status_t srtp_cipher_type_alloc(const srtp_cipher_type_t *ct, srtp_cipher_t **c, int key_len, int tlen); ^ /Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:200:38: error: function cannot return function type 'srtp_err_status_t' (aka 'int (int *)') srtp_err_status_t srtp_cipher_dealloc(srtp_cipher_t *c); ^ /Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:201:35: error: function cannot return function type 'srtp_err_status_t' (aka 'int (int *)') srtp_err_status_t srtp_cipher_init(srtp_cipher_t *c, const uint8_t *key); ^ /Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:202:37: error: function cannot return function type 'srtp_err_status_t' (aka 'int (int *)') srtp_err_status_t srtp_cipher_set_iv(srtp_cipher_t *c, uint8_t *iv, int direction); ^ /Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:203:37: error: function cannot return function type 'srtp_err_status_t' (aka 'int (int *)') srtp_err_status_t srtp_cipher_output(srtp_cipher_t *c, uint8_t *buffer, uint32_t *num_octets_to_output); ^ /Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:204:38: error: function cannot return function type 'srtp_err_status_t' (aka 'int (int *)') srtp_err_status_t srtp_cipher_encrypt(srtp_cipher_t *c, uint8_t *buffer, uint32_t *num_octets_to_output); ^ /Users/speedy/Downloads/pjsip-master/build/pjproject/src/third_party/srtp/crypto/include/cipher.h:205:38: error: function cannot return function type 'srtp_err_status_t' (aka 'int (int *)') srtp_err_status_t srtp_cipher_decrypt(srtp_cipher_t *c, uint8_t *buffer, uint32_t *num_octets_to_output); ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 2 warnings and 20 errors generated. make[2]: *** [output/pjmedia-armv7-apple-darwin_ios/transport_srtp.o] Error 1 make[1]: *** [libpjmedia-armv7-apple-darwin_ios.a] Error 2 make: *** [lib] Error 1 I have attached whole log. Any help would be appreciated. Tnx, Boris