1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-04-20 12:07:51 +03:00

20 Commits

Author SHA1 Message Date
Dave Rodgman
75da313166 Pacify check_files
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:16 +00:00
Gilles Peskine
32ffbfd139 Pacify mypy
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-06 13:25:37 +01:00
Gilles Peskine
1b4f036dd4 Also complain if licenses are mentioned
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-06 13:25:37 +01:00
Gilles Peskine
15db6822a3 Check copyright statements and SPDX license identifier
Enforce a specific copyright statement and a specific SPDX license
identifier where they are present.

Binary files, third-party modules and a few other exceptions are not
checked.

There is currently no check that copyright statements and license
identifiers are present.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-06 13:25:37 +01:00
Gilles Peskine
5136156750 Sort imports
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-06 13:25:37 +01:00
Dave Rodgman
7ff7965561 Update headers
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-11-03 12:04:52 +00:00
Gilles Peskine
ba986f3725 PermissionIssueTracker is obsoleted by ShebangIssueTracker
ShebangIssueTracker implements the rule that scripts must be executable if
and only if they have a shebang line. By removing PermissionIssueTracker, we
now allow files with any extension to be executable (provided they have a
shebang line), and allow *.sh and *.pl to be non-executable modules if they
don't have a shebang line (as was already the case for *.py).

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-07-25 21:54:36 +02:00
Aditya Deshpande
a9186f37a8 Allow whole Box Drawings range
Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
2023-02-01 13:31:57 +00:00
Aditya Deshpande
e76dc39641 Modify comments to make them more inclusive
Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
2023-01-30 13:52:03 +00:00
Aditya Deshpande
ed514d3218 Allow specific Box Drawing UTF characters that are used in Markdown trees in check_files.py
Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
2023-01-30 13:24:11 +00:00
Gilles Peskine
b60b7a33c0 Reject invalid UTF-8 and weird characters in text files
Reject "weird" characters in text files, especially control characters that
might be escape sequences or that might cause other text to appear garbled
(as in https://trojansource.codes/).

Also reject byte sequences that aren't valid UTF-8.

Accept only ASCII (except most control characters), letters, some non-ASCII
punctuation and some mathematical and technical symbols. This covers
everything that's currently present in Mbed TLS ( §áèéëñóöüłŽ–—’“”…≥).

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-01-10 22:13:27 +01:00
Gilles Peskine
ff723d8649 Pass line number to issue_with_line
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-01-10 22:13:27 +01:00
Gilles Peskine
66548d1fa7 Treat more *.bin files as binary
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-01-10 22:13:27 +01:00
Gilles Peskine
7ff4766115 Unify check_repo_path
We had 4 identical copies of the check_repo_path function. Replace them by a
single copy in the build_tree module where it naturally belongs.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-10-14 15:34:06 +02:00
Shaun Case
0e7791ff07 Redo of PR#5345. Fixed spelling and typographical errors found by CodeSpell.
Signed-off-by: Shaun Case <warmsocks@gmail.com>
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-04-28 18:22:20 +01:00
Gilles Peskine
ac9e7c0b6e check_files.py: pass mypy
Add enough type annotations to pass mypy 0.782 with Python 3.5. The
source code will still run normally under older Python versions.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-12-10 21:30:01 +01:00
Gilles Peskine
4aebb8d936 Test shebang lines
Executable scripts must have shebang (#!) line to be effectively
executable on most Unix-like systems. Enforce this, and conversely
enforce that files with a shebang line are executable.

Check that the specified interperter is consistent with the file
extension.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-12-10 21:29:55 +01:00
Gilles Peskine
15898eec23 Allow Python files not to be executable
.py files may be modules which are not standalone program, so allow
them not to be executable.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-12-10 21:29:49 +01:00
Bence Szépkúti
1e14827beb Update copyright notices to use Linux Foundation guidance
As a result, the copyright of contributors other than Arm is now
acknowledged, and the years of publishing are no longer tracked in the
source files.

Also remove the now-redundant lines declaring that the files are part of
MbedTLS.

This commit was generated using the following script:

# ========================
#!/bin/sh

# Find files
find '(' -path './.git' -o -path './3rdparty' ')' -prune -o -type f -print | xargs sed -bi '

# Replace copyright attribution line
s/Copyright.*Arm.*/Copyright The Mbed TLS Contributors/I

# Remove redundant declaration and the preceding line
$!N
/This file is part of Mbed TLS/Id
P
D
'
# ========================

Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2020-08-19 10:35:41 +02:00
Gilles Peskine
fb4f933f8e Rename Python scripts to use '_' and not '-'
You can't import a Python script whose name includes '-'.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-06-25 14:22:06 +02:00