intel / intel-sgx-ssl

Intel® Software Guard Extensions SSL
Other
227 stars 75 forks source link

Fail to use EVP_* functions within enclave #22

Closed tyler-lee closed 6 years ago

tyler-lee commented 6 years ago

Hi all, I try to call openssl EVP_* functions within enclave. It turns out a lot of "undefined reference to '.....'". Has any body make this out? Or does intel-sgx-ssl support such a scheme?

akryeem-INTC commented 6 years ago

SGXSSL does support calling EVP_* APIs.

Can you provide some additional info? maybe you're missing some library linkage? what errors are you getting? how your Makefile looks like?

tyler-lee commented 6 years ago

Thanks for your replay.

In https://github.com/tyler-lee/async_on_sync/blob/master/PublicEnclave/PublicEnclave.cpp, aos_verify: EVP_CIPHER_CTX *ctx; if(!(ctx = EVP_CIPHER_CTX_new())) handleErrors(); EVP_CIPHER_CTX_free(ctx);

Makefile that I used: https://github.com/tyler-lee/async_on_sync/blob/master/Makefile

It runs well when I comment this EVP_* functions while it turns out following errors:

./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(ocb128.o): In function CRYPTO_ocb128_aad': ocb128.c:(.text+0xbc4): undefined reference tomemcpy_chk' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(ocb128.o): In function CRYPTO_ocb128_encrypt': ocb128.c:(.text+0xfc2): undefined reference to__memcpy_chk' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(ocb128.o): In function CRYPTO_ocb128_decrypt': ocb128.c:(.text+0x138d): undefined reference tomemcpy_chk' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(obj_dat.o): In function OBJ_create_objects': obj_dat.c:(.text+0x1212): undefined reference tosgxssl_ctype_b_loc' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(obj_dat.o): In function added_obj_cmp': obj_dat.c:(.text+0x9b): undefined reference tostrcmp' obj_dat.c:(.text+0xd0): undefined reference to memcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(obj_dat.o): In functionln_cmp_BSEARCH_CMP_FN': obj_dat.c:(.text+0x10a): undefined reference to strcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(obj_dat.o): In functionsn_cmp_BSEARCH_CMP_FN': obj_dat.c:(.text+0x128): undefined reference to strcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(obj_dat.o): In functionobj_cmp_BSEARCH_CMP_FN': obj_dat.c:(.text+0x23e): undefined reference to memcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(obj_lib.o): In functionOBJ_cmp': obj_lib.c:(.text+0x134): undefined reference to memcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(threads_pthread.o): In functionCRYPTO_THREAD_lock_new': threads_pthread.c:(.text+0x25): undefined reference to sgxssl_pthread_rwlock_init' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(threads_pthread.o): In functionCRYPTO_THREAD_read_lock': threads_pthread.c:(.text+0x65): undefined reference to sgxssl_pthread_rwlock_rdlock' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(threads_pthread.o): In functionCRYPTO_THREAD_write_lock': threads_pthread.c:(.text+0x85): undefined reference to sgxssl_pthread_rwlock_wrlock' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(threads_pthread.o): In functionCRYPTO_THREAD_unlock': threads_pthread.c:(.text+0xa5): undefined reference to sgxssl_pthread_rwlock_unlock' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(threads_pthread.o): In functionCRYPTO_THREAD_lock_free': threads_pthread.c:(.text+0xca): undefined reference to sgxssl_pthread_rwlock_destroy' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(threads_pthread.o): In functionCRYPTO_THREAD_run_once': threads_pthread.c:(.text+0xf5): undefined reference to sgxssl_pthread_once' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(threads_pthread.o): In functionCRYPTO_THREAD_init_local': threads_pthread.c:(.text+0x115): undefined reference to sgxssl_pthread_key_create' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(threads_pthread.o): In functionCRYPTO_THREAD_set_local': threads_pthread.c:(.text+0x147): undefined reference to sgxssl_pthread_setspecific' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(threads_pthread.o): In functionCRYPTO_THREAD_cleanup_local': threads_pthread.c:(.text+0x167): undefined reference to sgxssl_pthread_key_delete' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(threads_pthread.o): In functionCRYPTO_THREAD_get_local': threads_pthread.c:(.text+0x133): undefined reference to sgxssl_pthread_getspecific' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(threads_pthread.o): In functionCRYPTO_THREAD_get_current_id': threads_pthread.c:(.text+0x181): undefined reference to sgxssl_pthread_self' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(threads_pthread.o): In functionCRYPTO_THREAD_compare_id': threads_pthread.c:(.text+0x191): undefined reference to sgxssl_pthread_equal' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(asn1_lib.o): In functionASN1_STRING_cmp': asn1_lib.c:(.text+0x7ae): undefined reference to memcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(tasn_enc.o): In functionder_cmp': tasn_enc.c:(.text+0x1f): undefined reference to memcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(tasn_enc.o): In functionasn1_template_ex_i2d': tasn_enc.c:(.text+0xf41): undefined reference to qsort' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(b_dump.o): In functionBIO_dump_indent_cb': b_dump.c:(.text+0xb6): undefined reference to __memset_chk' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(b_print.o): In function_dopr': bprint.c:(.text+0x1571): undefined reference to `sgxsslctype_b_loc' b_print.c:(.text+0x1641): undefined reference to sgxssl___ctype_b_loc' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(bn_print.o): In functionBN_hex2bn': bn_print.c:(.text+0x58b): undefined reference to sgxssl___ctype_b_loc' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(bn_print.o): In functionBN_dec2bn': bn_print.c:(.text+0x7b4): undefined reference to sgxssl___ctype_b_loc' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(cryptlib.o): In functionOPENSSL_cpuid_setup': cryptlib.c:(.text+0x52): undefined reference to sgxssl_getenv' cryptlib.c:(.text+0x83): undefined reference tosgxssl_sscanf' cryptlib.c:(.text+0xb1): undefined reference to strchr' cryptlib.c:(.text+0xd0): undefined reference tostrtoul' cryptlib.c:(.text+0x100): undefined reference to strtoul' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(tb_asnmth.o): In functionlook_str_cb': tb_asnmth.c:(.text+0xc8): undefined reference to strncasecmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(tb_asnmth.o): In functionENGINE_get_pkey_asn1_meth_str': tb_asnmth.c:(.text+0x44c): undefined reference to strncasecmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(err.o): In functionERR_error_string_n': err.c:(.text+0x996): undefined reference to strchr' err.c:(.text+0x9bd): undefined reference tostrchr' err.c:(.text+0x9e0): undefined reference to strchr' err.c:(.text+0xa03): undefined reference tostrchr' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(init.o): In function ossl_init_base_ossl_': init.c:(.text+0x18f): undefined reference tosgxssl_atexit' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(lhash.o): In function OPENSSL_LH_new': lhash.c:(.text+0x113): undefined reference tostrcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(mem_sec.o): In function CRYPTO_secure_malloc_init': mem_sec.c:(.text+0x5a6): undefined reference tosgxssl_sysconf' mem_sec.c:(.text+0x5de): undefined reference to sgxssl_mmap' mem_sec.c:(.text+0x638): undefined reference tosgxssl_mprotect' mem_sec.c:(.text+0x668): undefined reference to sgxssl_mprotect' mem_sec.c:(.text+0x680): undefined reference tosgxssl_mlock' mem_sec.c:(.text+0x69d): undefined reference to sgxssl_madvise' mem_sec.c:(.text+0x712): undefined reference tosgxssl_munmap' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(mem_sec.o): In function CRYPTO_secure_malloc_done': mem_sec.c:(.text+0x875): undefined reference tosgxssl_munmap' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(o_str.o): In function openssl_strerror_r': o_str.c:(.text+0x505): undefined reference tostrerror_r' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(md_rand.o): In function get_sgx_rand_bytes': md_rand.c:(.text+0x15): undefined reference tosgxssl_read_rand' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(rsa_pmeth.o): In function pkey_rsa_ctrl_str': rsa_pmeth.c:(.text+0x2a4): undefined reference toatoi' rsa_pmeth.c:(.text+0x344): undefined reference to atoi' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(rsa_pmeth.o): In functionpkey_rsa_verify': rsa_pmeth.c:(.text+0x15b4): undefined reference to memcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(rsa_pss.o): In functionRSA_verify_PKCS1_PSS_mgf1': rsa_pss.c:(.text+0x5b7): undefined reference to memcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(rsa_saos.o): In functionRSA_verify_ASN1_OCTET_STRING': rsa_saos.c:(.text+0x243): undefined reference to memcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(rsa_sign.o): In functionint_rsa_verify': rsa_sign.c:(.text+0x5ae): undefined reference to memcmp' rsa_sign.c:(.text+0x6b4): undefined reference tomemcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(rsa_sign.o):rsa_sign.c:(.text+0x6ec): more undefined references to memcmp' follow ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(stack.o): In functionOPENSSL_sk_sort': stack.c:(.text+0x676): undefined reference to qsort' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(ameth_lib.o): In functionEVP_PKEY_asn1_find_str': ameth_lib.c:(.text+0x297): undefined reference to strncasecmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(async.o): In functionasync_fibre_swapcontext.constprop.2': async.c:(.text+0x1b): undefined reference to setjmp' async.c:(.text+0x36): undefined reference tosgxssl_setcontext' async.c:(.text+0x51): undefined reference to longjmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(b_addr.o): In functionBIO_ADDR_rawmake': b_addr.c:(.text+0x245): undefined reference to strncpy' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(b_addr.o): In functionaddr_strings.part.2': b_addr.c:(.text+0x4b0): undefined reference to sgxssl_getnameinfo' b_addr.c:(.text+0x4ef): undefined reference tosgxssl_gai_strerror' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(b_addr.o): In function BIO_parse_hostserv': b_addr.c:(.text+0x989): undefined reference tostrrchr' b_addr.c:(.text+0x999): undefined reference to strchr' b_addr.c:(.text+0x9ff): undefined reference tostrchr' b_addr.c:(.text+0xa46): undefined reference to strchr' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(b_addr.o): In functionBIO_lookup': b_addr.c:(.text+0xc9c): undefined reference to sgxssl_getaddrinfo' b_addr.c:(.text+0xcdc): undefined reference tosgxssl_gai_strerror' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(b_addr.o): In function BIO_ADDRINFO_free': b_addr.c:(.text+0x94f): undefined reference tosgxssl_freeaddrinfo' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(b_sock.o): In function BIO_sock_error': b_sock.c:(.text+0x36): undefined reference tosgxssl_getsockopt' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(b_sock.o): In function BIO_socket_ioctl': b_sock.c:(.text+0x324): undefined reference tosgxssl_ioctl' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(b_sock.o): In function BIO_accept': b_sock.c:(.text+0x5f9): undefined reference tosgxsslbuiltinstrcpy_chk' b_sock.c:(.text+0x60d): undefined reference to sgxssl___builtin___strcat_chk' b_sock.c:(.text+0x61d): undefined reference tosgxsslbuiltinstrcat_chk' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(b_sock.o): In function BIO_set_tcp_ndelay': b_sock.c:(.text+0x6be): undefined reference tosgxssl_setsockopt' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(b_sock.o): In function BIO_sock_info': b_sock.c:(.text+0x756): undefined reference tosgxssl_getsockname' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(b_sock.o): In function BIO_gethostbyname': b_sock.c:(.text+0x71): undefined reference tosgxssl_gethostbyname' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(b_sock2.o): In function BIO_socket': b_sock2.c:(.text+0x2a): undefined reference tosgxssl_socket' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(b_sock2.o): In function BIO_connect': b_sock2.c:(.text+0xf8): undefined reference tosgxssl_setsockopt' b_sock2.c:(.text+0x11e): undefined reference to sgxssl_connect' b_sock2.c:(.text+0x1a8): undefined reference tosgxssl_setsockopt' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(b_sock2.o): In function BIO_listen': b_sock2.c:(.text+0x2f0): undefined reference tosgxssl_getsockopt' b_sock2.c:(.text+0x3f7): undefined reference to sgxssl_setsockopt' b_sock2.c:(.text+0x46a): undefined reference tosgxssl_bind' b_sock2.c:(.text+0x487): undefined reference to sgxssl_listen' b_sock2.c:(.text+0x4b8): undefined reference tosgxssl_setsockopt' b_sock2.c:(.text+0x528): undefined reference to sgxssl_setsockopt' b_sock2.c:(.text+0x598): undefined reference tosgxssl_setsockopt' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(b_sock2.o): In function BIO_accept_ex': b_sock2.c:(.text+0x6d7): undefined reference tosgxssl_accept' b_sock2.c:(.text+0x778): undefined reference to sgxssl_close' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(b_sock2.o): In functionBIO_closesocket': b_sock2.c:(.text+0x795): undefined reference to sgxssl_close' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(bss_sock.o): In functionsock_read': bss_sock.c:(.text+0x228): undefined reference to sgxssl_read' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(bss_sock.o): In functionsock_write': bss_sock.c:(.text+0x2a1): undefined reference to sgxssl_write' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(bss_sock.o): In functionsock_puts': bss_sock.c:(.text+0x30a): undefined reference to sgxssl_write' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(conf_mod.o): In functionCONF_modules_load': conf_mod.c:(.text+0xbf): undefined reference to strrchr' conf_mod.c:(.text+0xfc): undefined reference tostrncmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(conf_mod.o): In function CONF_get1_default_config_file': conf_mod.c:(.text+0x95e): undefined reference tosgxssl_getenv' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(conf_mod.o): In function CONF_parse_list': conf_mod.c:(.text+0xb11): undefined reference tosgxssl_ctype_b_loc' conf_mod.c:(.text+0xb3a): undefined reference to strchr' conf_mod.c:(.text+0xb5a): undefined reference tosgxssl_ctype_b_loc' conf_mod.c:(.text+0xba7): undefined reference to strchr' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(conf_sap.o): In functionOPENSSL_config': conf_sap.c:(.text+0x22): undefined reference to __strdup' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(dh_pmeth.o): In functionpkey_dh_ctrl_str': dh_pmeth.c:(.text+0x817): undefined reference to atoi' dh_pmeth.c:(.text+0x848): undefined reference toatoi' dh_pmeth.c:(.text+0x864): undefined reference to atoi' dh_pmeth.c:(.text+0x87c): undefined reference toatoi' dh_pmeth.c:(.text+0x894): undefined reference to atoi' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(dsa_asn1.o): In functionDSA_verify': dsa_asn1.c:(.text+0x364): undefined reference to memcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(dsa_gen.o): In functiondsa_builtin_paramgen': dsa_gen.c:(.text+0xf4): undefined reference to __memcpy_chk' dsa_gen.c:(.text+0x2e8): undefined reference tomemcpy_chk' dsa_gen.c:(.text+0x300): undefined reference to `memcpy_chk' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(dsa_pmeth.o): In function pkey_dsa_ctrl_str': dsa_pmeth.c:(.text+0x6c): undefined reference toatoi' dsa_pmeth.c:(.text+0x84): undefined reference to atoi' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(ec_pmeth.o): In functionpkey_ec_ctrl_str': ec_pmeth.c:(.text+0x7f): undefined reference to atoi' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(ecdsa_ossl.o): In functionossl_ecdsa_verify': ecdsa_ossl.c:(.text+0xf54): undefined reference to memcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(eck_prn.o): In functionECPKParameters_print': eck_prn.c:(.text+0x3ee): undefined reference to __memset_chk' eck_prn.c:(.text+0x4ce): undefined reference tomemset_chk' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(eng_list.o): In function ENGINE_add': eng_list.c:(.text+0x283): undefined reference tostrcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(eng_list.o): In function ENGINE_by_id': eng_list.c:(.text+0x613): undefined reference tostrcmp' eng_list.c:(.text+0x66b): undefined reference to sgxssl_getenv' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(e_aes_cbc_hmac_sha1.o): In functionaesni_cbc_hmac_sha1_ctrl': e_aes_cbc_hmac_sha1.c:(.text+0x1a4e): undefined reference to `memcpy_chk' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(e_aes_cbc_hmac_sha256.o): In function aesni_cbc_hmac_sha256_ctrl': e_aes_cbc_hmac_sha256.c:(.text+0x193e): undefined reference tomemcpy_chk' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(o_names.o): In function OBJ_NAME_new_index': o_names.c:(.text+0x212): undefined reference tostrcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(o_names.o): In function OBJ_NAME_do_all_sorted': o_names.c:(.text+0x778): undefined reference toqsort' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(o_names.o): In function do_all_sorted_cmp': o_names.c:(.text+0xf): undefined reference tostrcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(o_names.o): In function obj_name_cmp': o_names.c:(.text+0x119): undefined reference tostrcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(x509_cmp.o): In function X509_cmp': x509_cmp.c:(.text+0x17b): undefined reference tomemcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(x509_cmp.o): In function X509_CRL_match': x509_cmp.c:(.text+0xf4): undefined reference tomemcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(x509_cmp.o): In function X509_cmp': x509_cmp.c:(.text+0x1b2): undefined reference tomemcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(x509_cmp.o): In function X509_NAME_cmp': x509_cmp.c:(.text+0x222): undefined reference tomemcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(x509_obj.o): In function X509_NAME_oneline': x509_obj.c:(.text+0x42e): undefined reference tostrncpy' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(x_name.o): In function x509_name_canon.part.0': x_name.c:(.text+0x32f): undefined reference tosgxssl_ctype_tolower_loc' x_name.c:(.text+0x3cd): undefined reference to sgxssl___ctype_b_loc' x_name.c:(.text+0x417): undefined reference tosgxssl_ctype_b_loc' x_name.c:(.text+0x462): undefined reference to sgxssl___ctype_b_loc' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(v3_addr.o): In functionrange_should_be_prefix': v3_addr.c:(.text+0x21): undefined reference to memcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(v3_addr.o): In functionIPAddressFamily_cmp': v3_addr.c:(.text+0x1ab): undefined reference to memcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(v3_addr.o): In functionv6IPAddressOrRange_cmp': v3_addr.c:(.text+0x232): undefined reference to `memcpy_chk' v3_addr.c:(.text+0x291): undefined reference to __memcpy_chk' v3_addr.c:(.text+0x30e): undefined reference tomemcpy_chk' v3_addr.c:(.text+0x3a5): undefined reference to `memcpy_chk' v3_addr.c:(.text+0x41b): undefined reference to memcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(v3_addr.o): In functionv4IPAddressOrRange_cmp': v3_addr.c:(.text+0x4f2): undefined reference to __memcpy_chk' v3_addr.c:(.text+0x551): undefined reference tomemcpy_chk' v3_addr.c:(.text+0x5ce): undefined reference to `memcpy_chk' v3_addr.c:(.text+0x665): undefined reference to __memcpy_chk' v3_addr.c:(.text+0x6db): undefined reference tomemcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(v3_addr.o): In function addr_contains.part.1': v3_addr.c:(.text+0x80f): undefined reference tomemcpy_chk' v3_addr.c:(.text+0x89b): undefined reference to `memcpy_chk' v3_addr.c:(.text+0x96f): undefined reference to __memcpy_chk' v3_addr.c:(.text+0x9e5): undefined reference tomemcpy_chk' v3_addr.c:(.text+0xabd): undefined reference to `memcpy_chk' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(v3_addr.o):v3_addr.c:(.text+0xb62): more undefined references to __memcpy_chk' follow ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(v3_addr.o): In functionaddr_contains.part.1': v3_addr.c:(.text+0xcc4): undefined reference to memcmp' v3_addr.c:(.text+0xcda): undefined reference tomemcmp' v3_addr.c:(.text+0xd6f): undefined reference to __memcpy_chk' v3_addr.c:(.text+0xdb9): undefined reference tomemcpy_chk' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(v3_addr.o): In function i2r_address': v3_addr.c:(.text+0xf27): undefined reference tomemcpy_chk' v3_addr.c:(.text+0x107b): undefined reference to __memcpy_chk' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(v3_addr.o): In functionmake_IPAddressFamily': v3_addr.c:(.text+0x1a08): undefined reference to memcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(v3_addr.o): In functionX509v3_addr_is_canonical': v3_addr.c:(.text+0x2344): undefined reference to memcmp' v3_addr.c:(.text+0x25a8): undefined reference tomemcmp' v3_addr.c:(.text+0x25c2): undefined reference to memcmp' v3_addr.c:(.text+0x25da): undefined reference tomemcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(v3_addr.o):v3_addr.c:(.text+0x284c): more undefined references to memcmp' follow ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(v3_addr.o): In functionv2i_IPAddrBlocks': v3_addr.c:(.text+0x33de): undefined reference to strtoul' v3_addr.c:(.text+0x34ce): undefined reference tomemcmp' v3_addr.c:(.text+0x354b): undefined reference to strtoul' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(v3_crld.o): In functionset_reasons': v3_crld.c:(.text+0xf3): undefined reference to strcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(v3_ncons.o): In functionnc_match_single': v3_ncons.c:(.text+0x299): undefined reference to strchr' v3_ncons.c:(.text+0x2a9): undefined reference tostrchr' v3_ncons.c:(.text+0x328): undefined reference to memcmp' v3_ncons.c:(.text+0x356): undefined reference tostrchr' v3_ncons.c:(.text+0x38c): undefined reference to strchr' v3_ncons.c:(.text+0x3cc): undefined reference tostrncasecmp' v3_ncons.c:(.text+0x424): undefined reference to strcasecmp' v3_ncons.c:(.text+0x51f): undefined reference tostrncmp' v3_ncons.c:(.text+0x538): undefined reference to strcasecmp' v3_ncons.c:(.text+0x56f): undefined reference tostrcasecmp' v3_ncons.c:(.text+0x58b): undefined reference to strchr' v3_ncons.c:(.text+0x5c4): undefined reference tostrncasecmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(v3_purp.o): In function X509_PURPOSE_get_by_sname': v3_purp.c:(.text+0x7af): undefined reference tostrcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(v3_utl.o): In function equal_case': v3_utl.c:(.text+0x1f2): undefined reference tomemcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(v3_utl.o): In function ipv6_cb': v3_utl.c:(.text+0x2b0): undefined reference tosgxssl_sscanf' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(v3_utl.o): In function do_x509_check': v3_utl.c:(.text+0x49c): undefined reference tomemcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(v3_utl.o): In function equal_email': v3_utl.c:(.text+0x76c): undefined reference tomemcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(v3_utl.o): In function equal_wildcard': v3_utl.c:(.text+0x8fa): undefined reference tostrncasecmp' v3_utl.c:(.text+0xc81): undefined reference to strncasecmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(v3_utl.o): In functionX509V3_parse_list': v3_utl.c:(.text+0x149c): undefined reference to sgxssl___ctype_b_loc' v3_utl.c:(.text+0x1613): undefined reference tosgxssl_ctype_b_loc' v3_utl.c:(.text+0x1699): undefined reference to sgxssl___ctype_b_loc' v3_utl.c:(.text+0x17dd): undefined reference tosgxssl___ctype_b_loc' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(v3_utl.o): In function name_cmp': v3_utl.c:(.text+0x18ef): undefined reference tostrncmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(v3_utl.o): In function a2i_ipadd': v3_utl.c:(.text+0x1ebb): undefined reference tostrchr' v3_utl.c:(.text+0x2017): undefined reference to sgxssl_sscanf' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(v3_utl.o): In functiona2i_IPADDRESS_NC': v3_utl.c:(.text+0x21c5): undefined reference to strchr' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(v3_utl.o): In functionsk_strcmp': v3_utl.c:(.text+0x177): undefined reference to strcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(a_time.o): In functionASN1_TIME_diff': a_time.c:(.text+0x42b): undefined reference to sgxssl_time' a_time.c:(.text+0x476): undefined reference tosgxssl_time' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(async_posix.o): In function ASYNC_is_capable': async_posix.c:(.text+0x1e): undefined reference tosgxssl_getcontext' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(async_posix.o): In function async_fibre_makecontext': async_posix.c:(.text+0x74): undefined reference tosgxssl_getcontext' async_posix.c:(.text+0xd5): undefined reference to sgxssl_makecontext' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(bn_rand.o): In functionBN_generate_dsa_nonce': bn_rand.c:(.text+0xa75): undefined reference to `memcpy_chk' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(cms_sd.o): In function CMS_SignerInfo_verify_content': cms_sd.c:(.text+0x1145): undefined reference tomemcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(set_key.o): In function DES_is_weak_key': set_key.c:(.text+0xd4): undefined reference tomemcmp' set_key.c:(.text+0xf0): undefined reference to memcmp' set_key.c:(.text+0x10c): undefined reference tomemcmp' set_key.c:(.text+0x128): undefined reference to memcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(set_key.o):set_key.c:(.text+0x144): more undefined references tomemcmp' follow ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(eng_cnf.o): In function int_engine_module_init': eng_cnf.c:(.text+0xed): undefined reference tostrchr' eng_cnf.c:(.text+0x1f5): undefined reference to strchr' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(eng_ctrl.o): In functionENGINE_ctrl': eng_ctrl.c:(.text+0x374): undefined reference to strcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(eng_ctrl.o): In functionENGINE_ctrl_cmd_string': eng_ctrl.c:(.text+0x713): undefined reference to strtol' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(p5_crpt.o): In functionPKCS5_PBE_keyivgen': p5_crpt.c:(.text+0x2d9): undefined reference to __memcpy_chk' p5_crpt.c:(.text+0x326): undefined reference tomemcpy_chk' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(o_time.o): In function OPENSSL_gmtime': o_time.c:(.text+0x5): undefined reference tosgxssl_gmtime_r' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(pem_lib.o): In function PEM_read_bio': pem_lib.c:(.text+0x148d): undefined reference tostrncmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(pem_lib.o): In function pem_check_suffix': pem_lib.c:(.text+0x1825): undefined reference tostrcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(pem_lib.o): In function PEM_bytes_read_bio': pem_lib.c:(.text+0x191a): undefined reference tostrcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(pk7_doit.o): In function PKCS7_signatureVerify': pk7_doit.c:(.text+0x2209): undefined reference tomemcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(x509_vfy.o): In function dane_match.isra.1': x509_vfy.c:(.text+0x56d): undefined reference tomemcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(x509_vfy.o): In function X509_time_adj_ex': x509_vfy.c:(.text+0xeeb): undefined reference tosgxssl_time' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(x509_vfy.o): In function X509_cmp_time': x509_vfy.c:(.text+0x1124): undefined reference tostrcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(x509_vpm.o): In function param_cmp': x509_vpm.c:(.text+0x13d): undefined reference tostrcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(x509_vpm.o): In function table_cmp_BSEARCH_CMP_FN': x509_vpm.c:(.text+0x157): undefined reference tostrcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(v3_alt.o): In function i2v_GENERAL_NAME': v3_alt.c:(.text+0x295): undefined reference tosgxssl__builtinstrcat_chk' v3_alt.c:(.text+0x2b4): undefined reference to sgxssl___builtin___strcat_chk' v3_alt.c:(.text+0x2e5): undefined reference tosgxsslbuiltinstrcat_chk' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(v3_alt.o): In function a2i_GENERAL_NAME': v3_alt.c:(.text+0x6d9): undefined reference tostrchr' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(v3_conf.o): In function X509V3_EXT_nconf': v3_conf.c:(.text+0x5ea): undefined reference tosgxssl_ctype_b_loc' v3_conf.c:(.text+0x679): undefined reference to sgxssl___ctype_b_loc' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(v3_conf.o): In functionX509V3_EXT_nconf_nid': v3_conf.c:(.text+0x77a): undefined reference to sgxssl___ctype_b_loc' v3_conf.c:(.text+0x7f1): undefined reference tosgxssl___ctype_b_loc' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(v3_info.o): In function v2i_AUTHORITY_INFO_ACCESS': v3_info.c:(.text+0x2bf): undefined reference tostrchr' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(v3_tlsf.o): In function v2i_TLS_FEATURE': v3_tlsf.c:(.text+0x53): undefined reference tostrcasecmp' v3_tlsf.c:(.text+0x6a): undefined reference to strcasecmp' v3_tlsf.c:(.text+0x84): undefined reference tostrtol' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(a_mbstr.o): In function type_str': a_mbstr.c:(.text+0xc9): undefined reference tosgxssl_ctype_b_loc' a_mbstr.c:(.text+0x17b): undefined reference to strchr' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(a_mbstr.o): In functionASN1_mbstring_ncopy': a_mbstr.c:(.text+0x3cb): undefined reference to strchr' a_mbstr.c:(.text+0x473): undefined reference tosgxssl_ctype_b_loc' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(a_strnid.o): In function ASN1_STRING_set_default_mask_asc': a_strnid.c:(.text+0x142): undefined reference tostrtoul' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(asn1_gen.o): In function parse_tagging': asn1_gen.c:(.text+0x35): undefined reference tostrtoul' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(asn1_gen.o): In function bitstr_cb': asn1_gen.c:(.text+0xb91): undefined reference tostrtoul' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(asn1_gen.o): In function mask_cb': asn1_gen.c:(.text+0xcc9): undefined reference tostrncmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(asn1_gen.o): In function asn1_cb': asn1_gen.c:(.text+0xe0b): undefined reference tostrncmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(asn_mime.o): In function multi_split': asn_mime.c:(.text+0x224): undefined reference tostrncmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(asn_mime.o): In function mime_hdr_new': asn_mime.c:(.text+0x409): undefined reference tosgxssl_ctype_b_loc' asn_mime.c:(.text+0x429): undefined reference to tolower' asn_mime.c:(.text+0x46f): undefined reference tosgxssl_ctype_b_loc' asn_mime.c:(.text+0x491): undefined reference to tolower' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(asn_mime.o): In functionmime_hdr_addparam.isra.1': asn_mime.c:(.text+0x595): undefined reference to sgxssl___ctype_b_loc' asn_mime.c:(.text+0x5b1): undefined reference totolower' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(asn_mime.o): In function mime_parse_hdr': asn_mime.c:(.text+0x739): undefined reference tosgxssl_ctype_b_loc' asnmime.c:(.text+0x801): undefined reference to `sgxsslctype_b_loc' asn_mime.c:(.text+0x85f): undefined reference to sgxssl___ctype_b_loc' asn_mime.c:(.text+0x91f): undefined reference tosgxssl_ctype_b_loc' asnmime.c:(.text+0x97e): undefined reference to `sgxsslctype_b_loc' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(asn_mime.o):asnmime.c:(.text+0xacb): more undefined references to `sgxsslctype_b_loc' follow ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(asn_mime.o): In function mime_hdr_cmp': asn_mime.c:(.text+0x67): undefined reference tostrcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(asn_mime.o): In function mime_param_cmp': asn_mime.c:(.text+0xa7): undefined reference tostrcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(asn_moid.o): In function oid_module_init': asn_moid.c:(.text+0x74): undefined reference tostrrchr' asn_moid.c:(.text+0x93): undefined reference to sgxssl___ctype_b_loc' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(asn_mstbl.o): In functionstbl_module_init': asn_mstbl.c:(.text+0x105): undefined reference to strtoul' asn_mstbl.c:(.text+0x1cd): undefined reference tostrtoul' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(p5_pbev2.o): In function PKCS5_pbe2_set_iv': p5_pbev2.c:(.text+0x315): undefined reference tomemcpy_chk' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(p5_scrypt.o): In function PKCS5_pbe2_set_scrypt': p5_scrypt.c:(.text+0x10f): undefined reference tomemcpy_chk' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(cms_dd.o): In function cms_DigestedData_do_final': cms_dd.c:(.text+0x15b): undefined reference tomemcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(conf_api.o): In function conf_value_cmp': conf_api.c:(.text+0x68): undefined reference tostrcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(conf_api.o): In function _CONF_get_string': conf_api.c:(.text+0x363): undefined reference tosgxssl_getenv' conf_api.c:(.text+0x3a4): undefined reference to sgxssl_getenv' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(conf_api.o): In functionconf_value_cmp': conf_api.c:(.text+0x89): undefined reference to strcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(conf_def.o): In functiondef_load_bio': conf_def.c:(.text+0xed0): undefined reference to strcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(ocsp_ht.o): In functionOCSP_REQ_CTX_nbio': ocsp_ht.c:(.text+0x626): undefined reference to sgxssl___ctype_b_loc' ocsp_ht.c:(.text+0x68b): undefined reference tostrtoul' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(v3_bitst.o): In function v2i_ASN1_BIT_STRING': v3_bitst.c:(.text+0xe7): undefined reference tostrcmp' v3_bitst.c:(.text+0x104): undefined reference to strcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(ct_vfy.o): In functionSCT_CTX_verify': ct_vfy.c:(.text+0x6f): undefined reference to memcmp' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(ct_log.o): In functionCTLOG_STORE_load_default_file': ct_log.c:(.text+0x41c): undefined reference to sgxssl_getenv' ./sgxssl/lib64/release//libsgx_tsgxssl_crypto.a(ct_log.o): In functionCTLOG_STORE_get0_log_by_id': ct_log.c:(.text+0x611): undefined reference to `memcmp' collect2: error: ld returned 1 exit status Makefile:343: recipe for target 'public_enclave.so' failed make: *** [public_enclave.so] Error 1

在 2018年5月9日,下午6:12,akryeem-INTC notifications@github.com 写道:

SGXSSL does support calling EVP_* APIs.

Can you provide some additional info? maybe you're missing some library linkage? what errors are you getting? how your Makefile looks like?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/intel/intel-sgx-ssl/issues/22#issuecomment-387691544, or mute the thread https://github.com/notifications/unsubscribe-auth/AFyhC7hNZvtuZbmkRxF8QiPEfes4G13Kks5twsD7gaJpZM4T4Dks.

naishai commented 6 years ago

try to place the sgx-ssl libraries before the regular sgx libraries in the linker line also note the the tsgxssl library should be wrapped with 'whole-archive' flag (-Wl,--whole-archive -lsgx_tsgxssl -Wl,--no-whole-archive)

tyler-lee commented 6 years ago

It works now! Thanks for your help.

tyler-lee commented 6 years ago

One more question: EVPaes in OpenSSL enable AESNI by default. Does EVPaes in sgx ssl enable it by default too?

akryeem-INTC commented 6 years ago

Yeah

faysalhossain2007 commented 6 years ago

I am facing the same problem. Can you please tell me in details what should I do in Linker file?

chanheehan0630 commented 5 years ago

hello~~ may i ask u something??

I've run it in a linux environment and help me get something like this.

sed: can't read openssl_1.1.1.orig/Configure: No such file or directory sed: can't read openssl_1.1.1.orig/crypto/uid.c: No such file or directory Makefile:55: recipe for target '/home/sgx/intel-sgx-ssl/intel-sgx-ssl/Linux/sgx/../package/lib64//libsgx_tsgxssl_crypto.a' failed make[1]: [/home/sgx/intel-sgx-ssl/intel-sgx-ssl/Linux/sgx/../package/lib64//libsgx_tsgxssl_crypto.a] Error 1 make[1]: Leaving directory '/home/sgx/intel-sgx-ssl/intel-sgx-ssl/Linux/sgx' Makefile:39: recipe for target 'all' failed make: [all] Error 2

what should i do?

akryeem-INTC commented 5 years ago

Can you please make sure that openssl_source/ directory is clean, and it doesn't include any corrupted openssl packages?

chanheehan0630 commented 5 years ago

openssl_directory has like these file. "bypass_to_sgxssl.h, openssl-1.1.1, openssl_1.1.1.orig.tar.gz, rand_lib.c, sgx_config.conf" and how to check about corrupted openssl packages?

akryeem-INTC commented 5 years ago

openssl_1.1.1.orig.tar.gz name should be openssl_1.1.1.tar.gz