-
Notifications
You must be signed in to change notification settings - Fork 2.7k
x509.c & x509_crt.c do not guard use of some POSIX <sys/*> and other headers #992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @eschaton Thanks for raising this! |
ARM Internal Ref: IOTSSL-1504 |
… (tracked as upstream issue Mbed-TLS#992)
I looked into this further. The includes in In I'm not sure of the best way to resolve this. It would be possible to create an In searching, I did find two other reports of this function being problematic because of how platform-specific it is, on both bare-metal ARM and Windows UWP: |
My personal preference would be for indirecting through other functions to perform directory iteration so that something like For example, a bare-metal platform could have one or several certificate stores in flash RAM while a platform like classic Mac OS could use its own iteration to do something equivalent to |
…ath() which uses POSIX readdir(). Tracking issue in upstream issue Mbed-TLS#992
True, I think that would be a good solution. Similar to TIMING_ALT, have a define that triggers usage of a platform-provided function that iterates through a given directory and calls a provided callback for each file. |
|
In
library/x509.c
andlibrary/x509_crt.c
there are includes of<sys/types.h>
,<sys/stat.h>
, and<dirent.h>
that are only guarded byMBEDTLS_FS_IO
and not by aHAVE_…
macro. This means that the file won’t compile on a system that might not have POSIX headers but where a developer might still want to access the filesystem via C Standard I/O. (An example of such a system would be Mac OS 9.)The text was updated successfully, but these errors were encountered: