add codespell pre-commit check and fix found misspellings

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28436)
This commit is contained in:
Dmitry Misharov
2025-09-30 10:44:55 +02:00
committed by Tomas Mraz
parent 6cd7b9388f
commit 2ade36d6b9
13 changed files with 472 additions and 58 deletions

452
.codespellrc Normal file
View File

@@ -0,0 +1,452 @@
[codespell]
ignore-regex = \b[a-zA-Z][a-zA-Z]\b
uri-ignore-words-list =
standarts
ignore-words-list =
aas,
Aas,
AAS,
abd,
ABD,
accreting,
ADDAD,
addin,
adin,
AFAIR,
afile,
afterAll,
AfterAll,
Ake,
ALine,
allEdges,
alloced,
alloco,
allws,
alo,
Alo,
alow,
ALS,
alsptd,
ang,
ans,
anS,
ANS,
aNULL,
archType,
arithmetics,
assertIn,
ategory,
atLeast,
AtLeast,
atMost,
biom,
bion,
bootup,
BRE,
Buda,
buildd,
bve,
CAF,
cann,
CANN,
cant,
Chang,
checkin,
childs,
ciph,
circularly,
Circularly,
claus,
Claus,
clen,
CLOS,
co-ordinate,
co-ordinates,
Collet,
Collison,
compilability,
compileTime,
CompileTime,
complies,
COMPLIES,
configury,
consumation,
couldn,
crasher,
crashers,
crate,
Crate,
CRATE,
creat,
CREAT,
CrOS,
crypted,
CRYPTED,
currentY,
DAA,
datas,
debbugs,
Debbugs,
DELET,
dependancies,
dependancy,
dependant,
deque,
Deque,
dota,
doubleclick,
doubleClick,
DoubleClick,
dout,
Dout,
DOUT,
dum,
dur,
Dur,
Durin,
ect,
ECT,
ede,
EDE,
endianess,
endin,
engineerr,
ENGINEerr,
equest,
equests,
FileTest,
FILETEST,
filetests,
flate,
Flate,
FLATE,
fpr,
FPR,
FPT,
gord,
gost,
Gost,
GOST,
Hart,
hasTable,
hel,
hist,
HIST,
HSI,
htmp,
ifset,
igest,
iif,
IIF,
implementor,
Implementor,
implementors,
Implementors,
inactivate,
inbrace,
indention,
indx,
ine,
informat,
inh,
inout,
inOut,
InOut,
INOUT,
ISCONNECTION,
isnt,
ist,
IST,
keep-alives,
keypair,
keyPair,
Keypair,
KeyPair,
KEYPAIR,
keypairs,
keyPairs,
Keypairs,
KeyPairs,
keyserver,
LAMDA,
larg,
leapYear,
LOd,
LOD,
Maked,
Manger,
Manuel,
ment,
Merget,
minimise,
mis,
Mis,
MIS,
mitre,
Mitre,
MITRE,
mmaped,
msdos,
MSDOS,
nam,
Nam,
NAM,
nclusion,
Ned,
nin,
Nin,
nmake,
NMake,
NMAKE,
NOo,
notin,
Notin,
NotIn,
numer,
OCE,
offsetp,
ois,
onText,
OnText,
openin,
OptIn,
OPTIO,
origN,
outin,
paeth,
Paeth,
PAETH,
parm,
pARM,
Parm,
PARM,
parms,
pARMS,
Parms,
PARMs,
PARMS,
pass-thru,
passin,
poping,
pres,
Pres,
prevEnd,
pris,
PullRequest,
que,
re-usable,
Re-usable,
re-use,
Re-use,
re-used,
Re-used,
re-uses,
Re-uses,
re-using,
Re-using,
readd,
Readd,
readded,
Readded,
regArg,
regArgs,
requestor,
Requestor,
requestors,
rewinded,
roperties,
sav,
SEH,
ser,
Ser,
SER,
servent,
sHolder,
shouldBe,
shouldnot,
SHS,
siz,
SIZ,
SME,
SOM,
Sorce,
sover,
splitted,
statics,
Statics,
strRange,
succes,
technics,
testss,
therefor,
Therefor,
therefrom,
Thi,
thirdparty,
thirdParty,
Thirdparty,
ThirdParty,
THIRDPARTY,
thru,
Thur,
THUR,
tmplate,
tne,
tolen,
tthe,
ture,
uis,
UIs,
upto,
upTo,
uptodate,
upToDate,
UpToDate,
useable,
Useable,
userA,
UserA,
usign,
varN,
vertexes,
vew,
vor,
WAN,
wasn,
Widgits,
Wirth,
wont,
WRONLY,
WTH
skip =
[cC]hange.[lL]og*,
[cC]hange[lL]og*,
[cC]hanges,
[cC]hanges[._-]*,
*__*__*.html,
*_8h_source.html,
*_8h.html,
*.asc,
*.bin,
*.crt,
*.css.map,
*.eps,
*.fr.utf-8,
*.git,
*.html.de,
*.html.es,
*.html.fr,
*.html.ko.euc-kr,
*.html.pt-br,
*.info_[0-9],
*.ipynb,
*.ja.utf8,
*.js.map,
*.min.js,
*.pdf,
*.pem,
*.po,
*.ppm,
*.ps,
*.rtf,
*.sum,
*.svg,
*.svn,
*.tr.utf8,
*.xpm,
*.zh-cn.utf8,
*.zlib,
*[._-][cC]hanges,
*[._-]CHANGES,
*/.mailmap,
*/.versions/*,
*/[eE]ncode/*,
*/[eE]ncodings/*,
*/[lL]ang/*,
*/[lL]anguage/*,
*/[lL]anguages/*,
*/[lL]ocale,
*/[mM]ath[jJ]ax/*,
*/[tT]hird*[pP]arty/*,
*/[tT]ranslation/*,
*/[tT]ranslations/*,
*/*.desktop,
*/*.desktop.in,
*/*[^a/]test/*,
*/*[^a/]tests/*,
*/*[lL]ocal[ei]*/*,
*/3rd*[pP]arty/*,
*/aspell/*,
*/AUTHORS*,
*/charsets/*,
*/chrtrans/*,
*/codepage/*,
*/data/*,
*/deps/*,
*/dict/*,
*/dictionaries/*,
*/doc*/[a-df-z][a-z]/*,
*/doc*/[a-z][a-z][_-][a-zA-Z][a-zA-Z]/*,
*/doc*/e[a-mo-z]/*,
*/extern/*,
*/external/*,
*/externals/*,
*/help/[a-df-z][a-z]/*,
*/help/[a-z][a-z]_[A-Z][A-Z]/*,
*/help/es/*,
*/i18n/*,
*/icu/*,
*/info/[a-df-z][a-z]/*,
*/info/[a-z][a-z]_[A-Z][A-Z]/*,
*/info/es/*,
*/intl/*,
*/l10n/*,
*/langmap/*,
*/langs/*,
*/LICENSE,
*/man*/[a-df-z][a-z]/*,
*/man*/[a-z][a-z][_-][a-zA-Z][a-zA-Z]/*,
*/man*/e[a-mo-z]/*,
*/messages[_./][a-df-z][a-z][_./]*,
*/messages[_./][a-z][a-z]_[A-Z][A-Z][_./]*,
*/messages[_./]es[_./]*,
*/rfc[1-9]*.txt,
*/runtime/*,
*/searchindex.js,
*/test*/*,
*/test/danetest.in,
*/test/data2.bin,
*/test/recipes/30-test_evp_data/evppkey_kas.txt,
*/test/recipes/30-test_evp_data/evppkey.txt,
*/unicode/*,
*/Unicode/*,
*/unicore/*,
*/vendor/*,
*/vendors/*,
*/yarn.lock,
*codespell-check.sh,
*lorem-ipsum*,
*man[12345657]/*
/fonts/*,
ABOUT-NLS,
authors.xml,
CHANGE.log*,
CHANGELOG*,
CHANGES,
CHANGES[._-]*,
CONTRIBUTORS*,
CREDITS,
CREDITS.TXT,
DONATIONS,
jquery.js,
jquery.min.map,
localization*-[a-z][a-z]_[a-zA-Z][a-zA-Z].*,
localization*-[a-z][a-z].*,
MAINTAINERS,
NormalizationTest.txt,
package-lock.json,
THANKS*,
UnicodeData.txt

9
.pre-commit-config.yaml Normal file
View File

@@ -0,0 +1,9 @@
ci:
autofix_prs: false
repos:
- repo: "https://github.com/codespell-project/codespell"
rev: "v2.4.1"
hooks:
- id: "codespell"
args: ["--config=.codespellrc", "."]
pass_filenames: false

View File

@@ -1,8 +0,0 @@
ci:
autofix_prs: false
repos:
- repo: "https://github.com/pre-commit/mirrors-clang-format"
rev: "v21.1.0"
hooks:
- id: "clang-format"
types_or: ["c"]

View File

@@ -772,7 +772,7 @@ static int add_object(const ASN1_OBJECT *obj, int indirect)
/*
* Indirect calls leave the NID unspecified, in which case we generate a
* fresh NID here. Direct calls via `OBJ_add_object()` must explicity
* fresh NID here. Direct calls via `OBJ_add_object()` must explicitly
* specify the nid, and we then also check against the compile-time bsearch
* lists that the indirect calls have checked while holding a read lock.
*/

View File

@@ -19,7 +19,7 @@ and the private key I<priv>.
Each of the different key types has an associated security category.
This value is one of 2, 3 or 5 for key types B<ML-DSA-44>, B<ML-DSA-65>
and B<ML-DSA-87> respectively, which correspond to security strengths of
128, 192 and 256 repsectively.
128, 192 and 256 respectively.
=head2 Keygen Parameters

View File

@@ -110,7 +110,7 @@ configuration options programmatically.
=item C<ml-kem.import_pct_type> (B<OSSL_PKEY_PARAM_ML_KEM_IMPORT_PCT_TYPE>) <UTF8 string>
When an B<ML-KEM> key is imported as an explict FIPS 203 B<dk> decapsulation
When an B<ML-KEM> key is imported as an explicit FIPS 203 B<dk> decapsulation
key, rather than a seed, a pairwise consistency test (PCT) is optionally
performed.
By default, or when this parameter is set explicitly to C<random>, the PCT

View File

@@ -17,7 +17,7 @@ L<FIPS 204|https://csrc.nist.gov/pubs/fips/204/final> Section 4 Table 1.
(The signatures range in size from ~2.5K to ~4.5K depending on the type chosen).
There are 3 different security categories also depending on the type.
L<EVP_SIGNATURE_fetch(3)> can be used to explicitely fetch one of the 3
L<EVP_SIGNATURE_fetch(3)> can be used to explicitly fetch one of the 3
algorithms which can then be used with L<EVP_PKEY_sign_message_init(3)>,
L<EVP_PKEY_sign(3)>, L<EVP_PKEY_verify_message_init(3)>, and
L<EVP_PKEY_verify(3)> to perform one-shot message signing or signature verification.
@@ -87,7 +87,7 @@ See L<EVP_PKEY-ML-DSA(7)> for information related to B<ML-DSA> keys.
=head1 NOTES
For backwards compatability reasons EVP_DigestSignInit_ex(), EVP_DigestSign(),
For backwards compatibility reasons EVP_DigestSignInit_ex(), EVP_DigestSign(),
EVP_DigestVerifyInit_ex() and EVP_DigestVerify() may also be used, but the digest
passed in I<mdname> must be NULL.

View File

@@ -28,7 +28,7 @@ C<s> types have smaller signature sizes, and the C<f> variants are faster,
(The signatures range from ~8K to ~50K depending on the type chosen). There are
3 different security categories also depending on the type.
L<EVP_SIGNATURE_fetch(3)> can be used to explicitely fetch one of the 12
L<EVP_SIGNATURE_fetch(3)> can be used to explicitly fetch one of the 12
algorithms which can then be used with L<EVP_PKEY_sign_message_init(3)>,
L<EVP_PKEY_sign(3)>, L<EVP_PKEY_verify_message_init(3)>, and
L<EVP_PKEY_verify(3)> to perform one-shot message signing or verification.
@@ -38,7 +38,7 @@ encodes the message internally as 0x00 || len(ctx) || ctx || message.
where B<ctx> is some optional value of size 0x00..0xFF.
OpenSSL also allows the message to not be encoded which is required for
testing. OpenSSL does not support Pre Hash SLH-DSA Signature Generation, but this
may be done by the user by doing Pre hash encoding externally and then chosing
may be done by the user by doing Pre hash encoding externally and then choosing
the option to not encode the message.
=head2 SLH-DSA Signature Parameters

View File

@@ -196,7 +196,7 @@ Specifying this flag configures the Single-Threaded Concurrency Model (SCM).
=item B<SSL_DOMAIN_FLAG_MULTI_THREAD>
Speciyfing this flag configures the Contentive Concurrency Model (CCM) (unless
Specifying this flag configures the Contentive Concurrency Model (CCM) (unless
B<SSL_DOMAIN_FLAG_THREAD_ASSISTED> is also specified).
=item B<SSL_DOMAIN_FLAG_THREAD_ASSISTED>

View File

@@ -566,7 +566,7 @@ L<SSL_accept_connection(3)>.
=item L<SSL_accept_connection(3)>
Accepts a new incoming connection for a listner SSL object. A new SSL object
Accepts a new incoming connection for a listener SSL object. A new SSL object
representing the accepted connection is created and returned on success. If no
incoming connection is available and the listener SSL object is configured in
nonblocking mode, NULL is returned.

View File

@@ -504,7 +504,7 @@ Generation".
The FIPS provider does not support deterministic digital signature generation
for DSA.
The FIPS provider supports determinisitic digital signature generation for
The FIPS provider supports deterministic digital signature generation for
ECDSA.
=item "kat" (B<OSSL_SIGNATURE_PARAM_KAT>) <unsigned integer>

View File

@@ -1,39 +0,0 @@
#!/bin/sh
# Run codespell on the OpenSSL tree.
# If you get a false positive here, the usual fix is to
# add it to the end of the -L list of ignored words, below.
#
# Any arguments provided (such as -w) are added to the
# codespell invocation.
#
# You can add this check to your git pre-commit hooks
# with something akin to the following:
# --------8<----------
#check_codespell_diff() {
# spelling_mistakes=""
# while read -r -d '' path; do
# spelling_mistakes="`util/codespell-check.sh $path`"
# done
# if [ -n "$spelling_mistakes" ]; then
# cat >&2 <<EOF
# -- Spelling Mistakes --
#The code you want to commit has spelling mistakes:
#
#$spelling_mistakes
#
#Fix them and then commit. See util/codespell-check.sh
#for more information
#EOF
# exit 1
# fi
#}
#git diff-index --cached -z --name-only "$against" \
# | check_codespell_diff \
# || exit 1
# ---------8<-----------
codespell --ignore-regex '\b[a-zA-Z][a-zA-Z]\b' \
-L 'ADDAD, addin, adin, allws, alo, Alo, alow, anS, Buda, buildd, bve, cann, CANN, ciph, Collison, consumation, DELET, dota, Durin, ect, ede, endianess, endin, engineerr, ENGINEerr, FILETEST, filetests, htmp, inbrace, ine, informat, ISCONNECTION, isnt, KEYPAIR, keyserver, larg, LOd, Manger, Merget, nclusion, NOo, OPTIO, outin, passin, poping, pris, rewinded, shouldnot, SHS, Sorce, sover, succes, testss, Thi, tmplate, tne, uis, usign, vew, Widgits, aas, Aas, AAS, abd, ABD, accreting, AFAIR, afile, afterAll, AfterAll, Ake, ALine, allEdges, alloced, alloco, ALS, alsptd, ang, ans, ANS, aNULL, archType, arithmetics, assertIn, atLeast, AtLeast, atMost, bootup, BRE, CAF, cant, Chang, checkin, childs, circularly, Circularly, claus, Claus, clen, CLOS, Collet, compilability, compileTime, CompileTime, complies, COMPLIES, configury, co-ordinate, co-ordinates, crasher, crashers, crate, Crate, CRATE, creat, CREAT, CrOS, crypted, CRYPTED, currentY, DAA, datas, debbugs, Debbugs, dependancies, dependancy, dependant, deque, Deque, doubleclick, doubleClick, DoubleClick, dout, Dout, DOUT, dum, dur, Dur, ECT, EDE, FileTest, flate, Flate, FLATE, fpr, FPR, FPT, gord, gost, Gost, GOST, Hart, hasTable, hel, hist, HIST, HSI, ifset, iif, IIF, implementor, Implementor, implementors, Implementors, inactivate, indention, indx, inh, inout, inOut, InOut, INOUT, ist, IST, keep-alives, keypair, keyPair, Keypair, KeyPair, keypairs, keyPairs, Keypairs, KeyPairs, LAMDA, leapYear, LOD, Maked, Manuel, ment, minimise, mis, Mis, MIS, mitre, Mitre, MITRE, mmaped, msdos, MSDOS, nam, Nam, NAM, Ned, nin, Nin, nmake, NMake, NMAKE, notin, Notin, NotIn, numer, OCE, offsetp, ois, onText, OnText, openin, OptIn, origN, paeth, Paeth, PAETH, parm, pARM, Parm, PARM, parms, pARMS, Parms, PARMs, PARMS, pass-thru, pres, Pres, prevEnd, PullRequest, que, readd, Readd, readded, Readded, regArg, regArgs, requestor, Requestor, requestors, re-usable, Re-usable, re-use, Re-use, re-used, Re-used, re-uses, Re-uses, re-using, Re-using, sav, SEH, ser, Ser, SER, servent, shouldBe, siz, SIZ, SME, SOM, splitted, statics, Statics, strRange, technics, therefor, Therefor, therefrom, thirdparty, thirdParty, Thirdparty, ThirdParty, THIRDPARTY, thru, Thur, THUR, tolen, tthe, UIs, upto, upTo, uptodate, upToDate, UpToDate, useable, Useable, userA, UserA, varN, vertexes, vor, WAN, Wirth, wont, WRONLY, WTH, roperties, igest, equest, equests, ategory, couldn, wasn, ture, biom, bion, sHolder' \
-S '*codespell-check.sh, */LICENSE, */test/danetest.in, */test/data2.bin, */test/recipes/30-test_evp_data/evppkey_kas.txt, */test/recipes/30-test_evp_data/evppkey.txt, */3rd*[pP]arty/*, */aspell/*, */charsets/*, */chrtrans/*, */codepage/*, */data/*, */deps/*, */dict/*, */dictionaries/*, */doc*/[a-df-z][a-z]/*, */doc*/[a-z][a-z][_-][a-zA-Z][a-zA-Z]/*, */doc*/e[a-mo-z]/*, */[eE]ncode/*, */[eE]ncodings/*, */extern/*, */external/*, */externals/*, */help/[a-df-z][a-z]/*, */help/[a-z][a-z]_[A-Z][A-Z]/*, */help/es/*, */i18n/*, */icu/*, */info/[a-df-z][a-z]/*, */info/[a-z][a-z]_[A-Z][A-Z]/*, */info/es/*, */intl/*, */l10n/*, */langmap/*, */langs/*, */[lL]ang/*, */[lL]anguage/*, */[lL]anguages/*, */*[lL]ocal[ei]*/*, */man*/[a-df-z][a-z]/*, */man*/[a-z][a-z][_-][a-zA-Z][a-zA-Z]/*, */man*/e[a-mo-z]/*, */messages[_./][a-df-z][a-z][_./]*, */messages[_./][a-z][a-z]_[A-Z][A-Z][_./]*, */messages[_./]es[_./]*, */[mM]ath[jJ]ax/*, */runtime/*, */[tT]hird*[pP]arty/*, */[tT]ranslation/*, */[tT]ranslations/*, */unicode/*, */Unicode/*, */unicore/*, */vendor/*, */vendors/*, */.versions/*, *_8h.html, *_8h_source.html, *.asc, */AUTHORS*, CONTRIBUTORS*, *.crt, *.css.map, */*.desktop, */*.desktop.in, *.eps, /fonts/*, *.fr.utf-8, *.git, *__*__*.html, *.html.de, *.html.es, *.html.fr, *.html.ko.euc-kr, *.html.pt-br, *.info_[0-9], *.ipynb, *.ja.utf8, *.js.map, */[lL]ocale, localization*-[a-z][a-z].*, localization*-[a-z][a-z]_[a-zA-Z][a-zA-Z].*, *lorem-ipsum*, */.mailmap, *.min.js, *.pdf, *.pem, *.po, *.ppm, *.ps, */rfc[1-9]*.txt, *.rtf, */searchindex.js, *.sum, *.svg, *.svn, THANKS*, *.tr.utf8, *.xpm, */yarn.lock, *.zh-cn.utf8, *.zlib, ABOUT-NLS, authors.xml, CREDITS, CREDITS.TXT, DONATIONS, jquery.js, jquery.min.map, MAINTAINERS, NormalizationTest.txt, package-lock.json, UnicodeData.txt, */*[^a/]test/*, */*[^a/]tests/*, */test*/*, [cC]hange.[lL]og*, [cC]hange[lL]og*, *[._-][cC]hanges, [cC]hanges[._-]*, CHANGE.log*, CHANGELOG*, *[._-]CHANGES, CHANGES[._-]*, [cC]hanges, CHANGES, *man[12345657]/*' \
$@

View File

@@ -280,7 +280,7 @@ sub start
# the covers when computing MACs, and in so doing avoids the use of the
# needed ossltest provider when computing the underlying digest. Since
# TLSProxy needs the ossltest provider to compute reliable known data in
# the digest, we disable MAC hw accleration here to ensure that the provider
# the digest, we disable MAC hw acceleration here to ensure that the provider
# gets used, just as it does with other architectures.
#
$ENV{OPENSSL_s390xcap} = "kmac:~0:~f000";