Skip to content

Commit

Permalink
Allow loading symlinked certificates
Browse files Browse the repository at this point in the history
When mbedtls_x509_crt_parse_path() checks each object in the supplied path, it only processes regular files. This change makes it also accept a symlink to a file. Fixes Mbed-TLS#3005.

This was observed to be a problem on Fedora/CentOS/RHEL systems, where the ca-bundle in the default location is actually a symlink.
  • Loading branch information
jp-bennett committed Jan 24, 2020
1 parent dbcb442 commit fdc16f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/x509_crt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1613,7 +1613,7 @@ int mbedtls_x509_crt_parse_path( mbedtls_x509_crt *chain, const char *path )
goto cleanup;
}

if( !S_ISREG( sb.st_mode ) )
if( !( S_ISREG( sb.st_mode ) || S_ISLNK( sb.st_mode ) ) )
continue;

// Ignore parse errors
Expand Down

0 comments on commit fdc16f3

Please sign in to comment.