Topic: Cannot use X509 calls in TI_RTOS
Hey Kaleb, (or anyone else...)
In the TI_RTOS world, using CCS, I am trying to load an X509 cert just to examine it. Logically the functions are:
wolfSSL_X509_load_certificate_buffer() wolfSSL_X509_get_subject_name() wolfSSL_X509_NAME_get_entry()
Except these were unresolved at the linker stage.
So the next logical step was to see what needs to be defined:
#if defined(OPENSSL_EXTRA_X509_SMALL) || defined(KEEP_PEER_CERT) || \ defined(SESSION_CERTS) wolfSSL_X509_get_subject_name( X509)
Okay, so I need OPENSSL_EXTRA_X509_SMALL
#if defined(OPENSSL_EXTRA) || defined(WOLFSSL_WPAS_SMALL) || \ defined(KEEP_PEER_CERT) || defined(SESSION_CERTS) WOLFSSL_X509* wolfSSL_X509_load_certificate_buffer(...)
This needs OPENSSL_EXTRA
So that looks weird... You define OPENSSL_EXTRA_X509_SMALL to get the subject name from an X509... But you can't load an X509 unless you define OPENSSL_EXTRA ??
But that's not what is broken...
In Wolf/src/ssl.c : Line 310087 (in version 4-7)
/* These constant values are protocol values made by egd */ #if defined(USE_WOLFSSL_IO) && !defined(USE_WINDOWS_API) #define WOLFSSL_EGD_NBLOCK 0x01 #include <sys/un.h> #endif
Well, TI/CCS has never heard of the header file "un.h". It's not included in any of the NDK 2-25 or 3-61. Nor is it in any of the TI compilers, or the GNU compilers they package with CCS.
What am I supposed to do? I can't comment it out, as there are several functions that use the sockaddr_un structure which is unheard of. I imagine (but haven't tried) if I try to take that header from from a unix/linux environment, there will be additional conflict and missing declarations.
So as it stands now, the X509 functions can't be used in TI-RTOS because the library wants to include support for Unix local interprocess functions (which are not used in TI_RTOS)
<Code shown is not to scale>