Backport 1.3: Wrong preproccessor condition fix

Fix for issue #696
Change #if defined(MBEDTLS_THREADING_PTHREAD)
to #if defined(MBEDTLS_THREADING_C)
This commit is contained in:
Ron Eldor 2017-01-09 19:27:59 +02:00 committed by Simon Butcher
parent 4f1e64ed4b
commit 7771824235
2 changed files with 7 additions and 4 deletions

View File

@ -5,6 +5,9 @@ mbed TLS ChangeLog (Sorted per branch, date)
Bugfix Bugfix
* Add a check if iv_len is zero, and return an error if it is zero. reported * Add a check if iv_len is zero, and return an error if it is zero. reported
by roberto. #716 by roberto. #716
* Replace preproccessor condition from #if defined(MBEDTLS_THREADING_PTHREAD)
to #if defined(MBEDTLS_THREADING_C) as the library cannot assume they will
always be implemented by pthread support. Fix for #696
= mbed TLS 1.3.20 branch released 2017-06-21 = mbed TLS 1.3.20 branch released 2017-06-21

View File

@ -1038,10 +1038,10 @@ int x509_crt_parse_path( x509_crt *chain, const char *path )
if( dir == NULL ) if( dir == NULL )
return( POLARSSL_ERR_X509_FILE_IO_ERROR ); return( POLARSSL_ERR_X509_FILE_IO_ERROR );
#if defined(POLARSSL_THREADING_PTHREAD) #if defined(POLARSSL_THREADING_C)
if( ( ret = polarssl_mutex_lock( &readdir_mutex ) ) != 0 ) if( ( ret = polarssl_mutex_lock( &readdir_mutex ) ) != 0 )
return( ret ); return( ret );
#endif #endif /* POLARSSL_THREADING_C */
while( ( entry = readdir( dir ) ) != NULL ) while( ( entry = readdir( dir ) ) != NULL )
{ {
@ -1068,10 +1068,10 @@ int x509_crt_parse_path( x509_crt *chain, const char *path )
closedir( dir ); closedir( dir );
cleanup: cleanup:
#if defined(POLARSSL_THREADING_PTHREAD) #if defined(POLARSSL_THREADING_C)
if( polarssl_mutex_unlock( &readdir_mutex ) != 0 ) if( polarssl_mutex_unlock( &readdir_mutex ) != 0 )
ret = POLARSSL_ERR_THREADING_MUTEX_ERROR; ret = POLARSSL_ERR_THREADING_MUTEX_ERROR;
#endif #endif /* POLARSSL_THREADING_C */
#endif /* _WIN32 */ #endif /* _WIN32 */