Introduced POLARSSL_HAVE_READDIR_R for systems without it

This commit is contained in:
Paul Bakker 2014-07-07 13:43:31 +02:00
parent ff6e24710a
commit 9ccb2116a7
3 changed files with 22 additions and 1 deletions

View file

@ -1,5 +1,9 @@
PolarSSL ChangeLog PolarSSL ChangeLog
= Branch 1.2
Changes
* Introduced POLARSSL_HAVE_READDIR_R for systems without it
= Version 1.2.10 released 2013-10-07 = Version 1.2.10 released 2013-10-07
Changes Changes
* Changed RSA blinding to a slower but thread-safe version * Changed RSA blinding to a slower but thread-safe version

View file

@ -94,6 +94,17 @@
* *
#define POLARSSL_HAVE_SSE2 #define POLARSSL_HAVE_SSE2
*/ */
/**
* \def POLARSSL_HAVE_READDIR_R
*
* (Non Windows) System has readdir_r().
*
* Required for x509_crt_parse_path() in non-Windows systems.
*
* Comment if your system does not have support.
*/
#define POLARSSL_HAVE_READDIR_R
/* \} name */ /* \} name */
/** /**

View file

@ -1948,6 +1948,7 @@ int x509parse_crtpath( x509_cert *chain, const char *path )
cleanup: cleanup:
FindClose( hFind ); FindClose( hFind );
#else #else
#if defined(POLARSSL_HAVE_READDIR_R)
int t_ret, i; int t_ret, i;
struct stat sb; struct stat sb;
struct dirent entry, *result = NULL; struct dirent entry, *result = NULL;
@ -1984,7 +1985,12 @@ cleanup:
ret += t_ret; ret += t_ret;
} }
closedir( dir ); closedir( dir );
#endif #else /* POLARSSL_HAVE_READDIR_R */
((void) chain);
((void) path);
ret = POLARSSL_ERR_X509_FEATURE_UNAVAILABLE;
#endif /* POLARSSL_HAVE_READDIR_R */
#endif /* _WIN32 */
return( ret ); return( ret );
} }