#17237: TLS compilation warnings and unit test failures ------------------------+--------------------------------------- Reporter: teor | Owner: Type: defect | Status: new Priority: normal | Milestone: Tor: 0.2.8.x-final Component: Tor | Version: Tor: unspecified Resolution: | Keywords: 027-backport 026-backport Actual Points: | Parent ID: Points: | Sponsor: ------------------------+---------------------------------------
Comment (by rl1987): The above error appears because patch for #17082 exposed SSL_SESSION_get_master_key() function in tortls.h header file. This function may or may not be provided by OpenSSL. In the latest OpenSSL version, it is. Quick patch for this: https://github.com/rl1987/tor/commit/b216340d75403571b8031baf5f63f751584470d1 However, I am still getting the above warnings about X509 * pointers AND I am getting more errors further down the road: {{{ CC src/test/src_test_test-test_tortls.o src/test/test_tortls.c:55:40: error: invalid application of 'sizeof' to an incomplete type 'SSL_METHOD' (aka 'struct ssl_method_st') SSL_METHOD *method = tor_malloc_zero(sizeof(SSL_METHOD)); ^ ~~~~~~~~~~~~ ./src/common/util.h:125:49: note: expanded from macro 'tor_malloc_zero' #define tor_malloc_zero(size) tor_malloc_zero_(size DMALLOC_ARGS) ^ /usr/local/ssl/include/openssl/ssl.h:322:16: note: forward declaration of 'struct ssl_method_st' typedef struct ssl_method_st SSL_METHOD; ^ src/test/test_tortls.c:56:34: error: invalid application of 'sizeof' to an incomplete type 'SSL_METHOD' (aka 'struct ssl_method_st') memcpy(method, TLSv1_method(), sizeof(SSL_METHOD)); ^ ~~~~~~~~~~~~ /usr/include/secure/_string.h:65:38: note: expanded from macro 'memcpy' __builtin___memcpy_chk (dest, src, len, __darwin_obsz0 (dest)) ^ /usr/local/ssl/include/openssl/ssl.h:322:16: note: forward declaration of 'struct ssl_method_st' typedef struct ssl_method_st SSL_METHOD; ^ src/test/test_tortls.c:137:9: error: incomplete definition of type 'struct ssl_method_st' method->num_ciphers = fake_num_ciphers; ~~~~~~^ /usr/local/ssl/include/openssl/ssl.h:322:16: note: forward declaration of 'struct ssl_method_st' typedef struct ssl_method_st SSL_METHOD; ^ src/test/test_tortls.c:446:11: error: incomplete definition of type 'struct ssl_st' tls->ssl->rwstate = SSL_READING; ~~~~~~~~^ /usr/local/ssl/include/openssl/ossl_typ.h:176:16: note: forward declaration of 'struct ssl_st' typedef struct ssl_st SSL; ^ src/test/test_tortls.c:454:11: error: incomplete definition of type 'struct ssl_st' tls->ssl->rwstate = SSL_READING; ~~~~~~~~^ /usr/local/ssl/include/openssl/ossl_typ.h:176:16: note: forward declaration of 'struct ssl_st' typedef struct ssl_st SSL; ^ src/test/test_tortls.c:462:11: error: incomplete definition of type 'struct ssl_st' tls->ssl->rwstate = 0; ~~~~~~~~^ /usr/local/ssl/include/openssl/ossl_typ.h:176:16: note: forward declaration of 'struct ssl_st' typedef struct ssl_st SSL; ^ src/test/test_tortls.c:463:11: error: incomplete definition of type 'struct ssl_st' tls->ssl->shutdown = SSL_RECEIVED_SHUTDOWN; ~~~~~~~~^ /usr/local/ssl/include/openssl/ossl_typ.h:176:16: note: forward declaration of 'struct ssl_st' typedef struct ssl_st SSL; ^ src/test/test_tortls.c:464:11: error: incomplete definition of type 'struct ssl_st' tls->ssl->s3->warn_alert =SSL_AD_CLOSE_NOTIFY; ~~~~~~~~^ /usr/local/ssl/include/openssl/ossl_typ.h:176:16: note: forward declaration of 'struct ssl_st' typedef struct ssl_st SSL; ^ src/test/test_tortls.c:511:32: error: invalid application of 'sizeof' to an incomplete type 'X509' (aka 'struct x509_st') cert->cert = tor_malloc_zero(sizeof(X509)); ^ ~~~~~~ ./src/common/util.h:125:49: note: expanded from macro 'tor_malloc_zero' #define tor_malloc_zero(size) tor_malloc_zero_(size DMALLOC_ARGS) ^ /usr/local/ssl/include/openssl/ossl_typ.h:154:16: note: forward declaration of 'struct x509_st' typedef struct x509_st X509; ^ src/test/test_tortls.c:559:25: error: invalid application of 'sizeof' to an incomplete type 'X509' (aka 'struct x509_st') one = tor_malloc_zero(sizeof(X509)); ^ ~~~~~~ ./src/common/util.h:125:49: note: expanded from macro 'tor_malloc_zero' #define tor_malloc_zero(size) tor_malloc_zero_(size DMALLOC_ARGS) ^ /usr/local/ssl/include/openssl/ossl_typ.h:154:16: note: forward declaration of 'struct x509_st' typedef struct x509_st X509; ^ src/test/test_tortls.c:560:6: error: incomplete definition of type 'struct x509_st' one->references = 1; ~~~^ /usr/local/ssl/include/openssl/ossl_typ.h:154:16: note: forward declaration of 'struct x509_st' typedef struct x509_st X509; ^ src/test/test_tortls.c:561:25: error: invalid application of 'sizeof' to an incomplete type 'X509' (aka 'struct x509_st') two = tor_malloc_zero(sizeof(X509)); ^ ~~~~~~ ./src/common/util.h:125:49: note: expanded from macro 'tor_malloc_zero' #define tor_malloc_zero(size) tor_malloc_zero_(size DMALLOC_ARGS) ^ /usr/local/ssl/include/openssl/ossl_typ.h:154:16: note: forward declaration of 'struct x509_st' typedef struct x509_st X509; ^ src/test/test_tortls.c:562:6: error: incomplete definition of type 'struct x509_st' two->references = 1; ~~~^ /usr/local/ssl/include/openssl/ossl_typ.h:154:16: note: forward declaration of 'struct x509_st' typedef struct x509_st X509; ^ src/test/test_tortls.c:567:30: error: invalid application of 'sizeof' to an incomplete type 'SSL' (aka 'struct ssl_st') tls->ssl = tor_malloc_zero(sizeof(SSL)); ^ ~~~~~ ./src/common/util.h:125:49: note: expanded from macro 'tor_malloc_zero' #define tor_malloc_zero(size) tor_malloc_zero_(size DMALLOC_ARGS) ^ /usr/local/ssl/include/openssl/ossl_typ.h:176:16: note: forward declaration of 'struct ssl_st' typedef struct ssl_st SSL; ^ src/test/test_tortls.c:568:11: error: incomplete definition of type 'struct ssl_st' tls->ssl->session = tor_malloc_zero(sizeof(SSL_SESSION)); ~~~~~~~~^ /usr/local/ssl/include/openssl/ossl_typ.h:176:16: note: forward declaration of 'struct ssl_st' typedef struct ssl_st SSL; ^ src/test/test_tortls.c:568:39: error: invalid application of 'sizeof' to an incomplete type 'SSL_SESSION' (aka 'struct ssl_session_st') tls->ssl->session = tor_malloc_zero(sizeof(SSL_SESSION)); ^ ~~~~~~~~~~~~~ ./src/common/util.h:125:49: note: expanded from macro 'tor_malloc_zero' #define tor_malloc_zero(size) tor_malloc_zero_(size DMALLOC_ARGS) ^ /usr/local/ssl/include/openssl/ssl.h:324:16: note: forward declaration of 'struct ssl_session_st' typedef struct ssl_session_st SSL_SESSION; ^ src/test/test_tortls.c:569:11: error: incomplete definition of type 'struct ssl_st' tls->ssl->session->peer = one; ~~~~~~~~^ /usr/local/ssl/include/openssl/ossl_typ.h:176:16: note: forward declaration of 'struct ssl_st' typedef struct ssl_st SSL; ^ src/test/test_tortls.c:577:6: error: incomplete definition of type 'struct x509_st' one->cert_info = tor_malloc_zero(sizeof(X509_CINF)); ~~~^ /usr/local/ssl/include/openssl/ossl_typ.h:154:16: note: forward declaration of 'struct x509_st' typedef struct x509_st X509; ^ src/test/test_tortls.c:577:36: error: invalid application of 'sizeof' to an incomplete type 'X509_CINF' (aka 'struct x509_cinf_st') one->cert_info = tor_malloc_zero(sizeof(X509_CINF)); ^ ~~~~~~~~~~~ ./src/common/util.h:125:49: note: expanded from macro 'tor_malloc_zero' #define tor_malloc_zero(size) tor_malloc_zero_(size DMALLOC_ARGS) ^ /usr/local/ssl/include/openssl/x509.h:169:16: note: forward declaration of 'struct x509_cinf_st' typedef struct x509_cinf_st X509_CINF; ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated. make[1]: *** [src/test/src_test_test-test_tortls.o] Error 1 make: *** [all] Error 2 }}} -- Ticket URL: <https://trac.torproject.org/projects/tor/ticket/17237#comment:10> Tor Bug Tracker & Wiki <https://trac.torproject.org/> The Tor Project: anonymity online _______________________________________________ tor-bugs mailing list tor-bugs@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs