Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions wolfcrypt/src/port/Espressif/esp_crt_bundle/gen_crt_bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,14 @@ def main():

bundle = CertificateBundle()

_SHELL_META = re.compile(r'[;&|`$<>()\n\r]')
for path in args.input:
if _SHELL_META.search(path):
raise InputError('Unsafe characters in input path: %s' % path)
if os.path.isfile(path):
if os.path.basename(path) == 'cacrt_all.pem' and args.filter:
if _SHELL_META.search(args.filter):
raise InputError('Unsafe characters in filter path: %s' % args.filter)
bundle.add_with_filter(path, args.filter)
else:
bundle.add_from_file(path)
Expand Down