diff --git a/lib/crypto/c_src/Makefile.in b/lib/crypto/c_src/Makefile.in index 8ad5c7889eee..417a5ee8658d 100644 --- a/lib/crypto/c_src/Makefile.in +++ b/lib/crypto/c_src/Makefile.in @@ -126,7 +126,7 @@ CALLBACK_LIB = $(LIBDIR)/crypto_callback$(TYPEMARKER).@DED_EXT@ TEST_ENGINE_LIB = $(LIBDIR)/otp_test_engine$(TYPEMARKER).@DED_EXT@ DYNAMIC_CRYPTO_LIB=@SSL_DYNAMIC_ONLY@ -# Wierd that we compile as if dynamically linking when statically +# Weird that we compile as if dynamically linking when statically # linking on windows... ifeq ($(DYNAMIC_CRYPTO_LIB),yes) DYNAMIC_OR_WIN_CRYPTO_LIB=yes diff --git a/lib/crypto/c_src/api_ng.c b/lib/crypto/c_src/api_ng.c index b745974d14f0..15da0e7bd1fb 100644 --- a/lib/crypto/c_src/api_ng.c +++ b/lib/crypto/c_src/api_ng.c @@ -116,7 +116,7 @@ static ERL_NIF_TERM get_opts(ErlNifEnv* env, const ERL_NIF_TERM opts, int opts_a } if (!enif_is_list(env, opts) || !enif_get_list_length(env, opts, &list_len)) - /* Not a boolean() and not a list, definitly an error */ + /* Not a boolean() and not a list, definitely an error */ return EXCP_BADARG_N(env, opts_arg_num, "Options are not a boolean or a proper list"); /* A list, might be a property list, as it should */ @@ -211,7 +211,7 @@ static int get_init_args(ErlNifEnv* env, ctx_res->padded_size = -1; ctx_res->size = 0; - /* Two initializations to make CodeChecker happy: it gets a bit desoriented + /* Two initializations to make CodeChecker happy: it gets a bit disoriented by the NIF Exception model */ ctx_res->encflag = 0; ctx_res->padding = atom_error; diff --git a/lib/crypto/c_src/dh.c b/lib/crypto/c_src/dh.c index 52d1023e8cf9..b226e8dfb4a9 100644 --- a/lib/crypto/c_src/dh.c +++ b/lib/crypto/c_src/dh.c @@ -71,7 +71,7 @@ ERL_NIF_TERM dh_generate_key_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM ar goto bad_arg; /* Load dh_params with values to use by the generator. - Mem mgmnt transfered from dh_p etc to dh_params */ + Mem mgmnt transferred from dh_p etc to dh_params */ if ((dh_params = DH_new()) == NULL) goto bad_arg; if (priv_key_in) { diff --git a/lib/crypto/c_src/mac.c b/lib/crypto/c_src/mac.c index 8ce54c1b9e9b..bd76fa209a9c 100644 --- a/lib/crypto/c_src/mac.c +++ b/lib/crypto/c_src/mac.c @@ -269,7 +269,7 @@ ERL_NIF_TERM mac_one_time(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]) #if defined(HAS_EVP_PKEY_CTX) && (! DISABLE_EVP_HMAC) # ifdef HAVE_PKEY_new_raw_private_key - /* Prefered for new applications according to EVP_PKEY_new_mac_key(3) */ + /* Preferred for new applications according to EVP_PKEY_new_mac_key(3) */ pkey = EVP_PKEY_new_raw_private_key(EVP_PKEY_HMAC, /*engine*/ NULL, key_bin.data, key_bin.size); # else /* Available in older versions */ @@ -555,7 +555,7 @@ ERL_NIF_TERM mac_init_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]) md = digp->md.p; # ifdef HAVE_PKEY_new_raw_private_key - /* Prefered for new applications according to EVP_PKEY_new_mac_key(3) */ + /* Preferred for new applications according to EVP_PKEY_new_mac_key(3) */ pkey = EVP_PKEY_new_raw_private_key(EVP_PKEY_HMAC, /*engine*/ NULL, key_bin.data, key_bin.size); # else /* Available in older versions */ diff --git a/lib/crypto/c_src/openssl_config.h b/lib/crypto/c_src/openssl_config.h index 49627f17e7c6..94a7a8d96323 100644 --- a/lib/crypto/c_src/openssl_config.h +++ b/lib/crypto/c_src/openssl_config.h @@ -58,7 +58,7 @@ * LibreSSL has the same names on include files and symbols as OpenSSL, but defines * the OPENSSL_VERSION_NUMBER to be >= 2.0.0 * - * Therefor works tests like this as intendend: + * Therefore works tests like this as intendend: * OPENSSL_VERSION_NUMBER >= PACKED_OPENSSL_VERSION_PLAIN(1,0,0) * (The test is for example "2.4.2" >= "1.0.0" although the test * with the cloned OpenSSL test would be "1.0.1" >= "1.0.0") diff --git a/lib/crypto/configure b/lib/crypto/configure index fdeba8fc08fe..6b7bb6327e39 100755 --- a/lib/crypto/configure +++ b/lib/crypto/configure @@ -1462,7 +1462,7 @@ Some influential environment variables: CXX C++ compiler CXXFLAGS C++ compiler flags LD linker (is often overridden by configure) - LDFLAGS linker flags (can be risky to set since LD may be overriden by + LDFLAGS linker flags (can be risky to set since LD may be overridden by configure) LIBS libraries DED_LD linker for Dynamic Erlang Drivers (set all DED_LD* variables or @@ -6071,7 +6071,7 @@ $as_echo "" >&6; } test $dir_lib32 = yes && libdirs="/lib32 $libdirs" # - # We try the follwing runtime paths in the + # We try the following runtime paths in the # following order: # 1. Standard ssl locations with all variations # of lib subdirectories that we know of diff --git a/lib/crypto/configure.in b/lib/crypto/configure.in index 16bdecda7334..0e20b75ff38e 100644 --- a/lib/crypto/configure.in +++ b/lib/crypto/configure.in @@ -660,7 +660,7 @@ yes | default) # Use standard lib locations for ssl runtime library path test $dir_lib32 = yes && libdirs="/lib32 $libdirs" # - # We try the follwing runtime paths in the + # We try the following runtime paths in the # following order: # 1. Standard ssl locations with all variations # of lib subdirectories that we know of diff --git a/lib/crypto/doc/src/algorithm_details.xml b/lib/crypto/doc/src/algorithm_details.xml index f8b88a4e2e89..dce04a1409ef 100644 --- a/lib/crypto/doc/src/algorithm_details.xml +++ b/lib/crypto/doc/src/algorithm_details.xml @@ -44,10 +44,10 @@ cipher_iv() or cipher_aead(). The letters IV are short for Initialization Vector and - AEAD is an abreviation of Authenticated Encryption with Associated Data. + AEAD is an abbreviation of Authenticated Encryption with Associated Data.

Due to irregular naming conventions, some cipher names in the old api are - substitued by new names in the new api. For a list of retired names, see + substituted by new names in the new api. For a list of retired names, see Retired cipher names.

To dynamically check availability, check that the name in the Cipher and Mode column is present in the diff --git a/lib/crypto/doc/src/crypto.xml b/lib/crypto/doc/src/crypto.xml index 3155f94e468a..3c85bbdbea86 100644 --- a/lib/crypto/doc/src/crypto.xml +++ b/lib/crypto/doc/src/crypto.xml @@ -143,7 +143,7 @@

- Asymetric Ciphers - Public Key Techniques + Asymmetric Ciphers - Public Key Techniques

@@ -662,7 +662,7 @@ The otp_padding is not removed - it has to be done elsewhere.

-

If padding is {padding,none} or not specifed and the total data from all subsequent +

If padding is {padding,none} or not specified and the total data from all subsequent crypto_updates does not fill the last block fully, that last data is lost. In case of {padding,none} there will be an error in this case. If padding is not specified, the bytes of the unfilled block is silently @@ -744,7 +744,7 @@ the number of bytes padded. Otherwise 0. padding_type - The type of the padding as provided in the call ot + The type of the padding as provided in the call to crypto_init/3,4. encrypt @@ -1144,7 +1144,7 @@

Enables (Enable = true) or disables (Enable = false) FIPS mode. Returns true if the operation was successful or false otherwise.

-

Note that to enable FIPS mode succesfully, OTP must be built with the configure option --enable-fips, +

Note that to enable FIPS mode successfully, OTP must be built with the configure option --enable-fips, and the underlying libcrypto must also support FIPS.

See also info_fips/0. @@ -1217,7 +1217,7 @@

The ciphers aes_cbc, aes_cfb8, aes_cfb128, aes_ctr, aes_ecb, aes_gcm and aes_ccm has no keylength in the Type as opposed to for example aes_128_ctr. They adapt to the length of - the key provided in the encrypt and decrypt function. Therefor it is impossible to return a valid keylength + the key provided in the encrypt and decrypt function. Therefore it is impossible to return a valid keylength in the map.

Always use a Type with an explicit key length,

@@ -1392,11 +1392,11 @@ _FloatValue = rand:uniform(). % [0.0; 1.0[

The state returned from this function cannot be used - to get a reproducable random sequence as from + to get a reproducible random sequence as from the other rand functions, - since reproducability does not match cryptographically safe. + since reproducibility does not match cryptographically safe.

The only supported usage is to generate one distinct @@ -1511,11 +1511,11 @@ FloatValue = rand:uniform(). % again

The state returned from this function cannot be used - to get a reproducable random sequence as from + to get a reproducible random sequence as from the other rand functions, - since reproducability does not match cryptographically safe. + since reproducibility does not match cryptographically safe.

In fact since random data is cached some numbers may diff --git a/lib/crypto/doc/src/licenses.xml b/lib/crypto/doc/src/licenses.xml index e5c06cf7cea4..e0e1bf629fc4 100644 --- a/lib/crypto/doc/src/licenses.xml +++ b/lib/crypto/doc/src/licenses.xml @@ -103,7 +103,7 @@ This chapter contains in extenso versions * The implementation was written so as to conform with Netscapes SSL. * * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions + * the following conditions are adhered to. The following conditions * apply to all code found in this distribution, be it the RC4, RSA, * lhash, DES, etc., code; not just the SSL code. The SSL documentation * included with this distribution is covered by the same copyright terms @@ -128,7 +128,7 @@ This chapter contains in extenso versions * must display the following acknowledgement: * "This product includes cryptographic software written by * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library + * The word 'cryptographic' can be left out if the routines from the library * being used are not cryptographic related :-). * 4. If you include any Windows specific code (or a derivative thereof) from * the apps directory (application code) you must include an acknowledgement: @@ -146,7 +146,7 @@ This chapter contains in extenso versions * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * The licence and distribution terms for any publically available version or + * The licence and distribution terms for any publicly available version or * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] diff --git a/lib/crypto/doc/src/new_api.xml b/lib/crypto/doc/src/new_api.xml index ccd80eca8b99..520c259ebb1b 100644 --- a/lib/crypto/doc/src/new_api.xml +++ b/lib/crypto/doc/src/new_api.xml @@ -49,7 +49,7 @@

The old API -

The old functions - deprecated from 23.0 and removed from OTP 24.0 - are for chipers:

+

The old functions - deprecated from 23.0 and removed from OTP 24.0 - are for ciphers:

block_encrypt/3 block_encrypt/4 @@ -111,7 +111,7 @@ crypto_final/1

The crypto_init initialies an internal cipher state, and one or more calls of - crypto_update does the acual encryption or decryption. Note that AEAD ciphers + crypto_update does the actual encryption or decryption. Note that AEAD ciphers can't be handled this way due to their nature.

For repeated encryption or decryption of a text divided in parts where the diff --git a/lib/crypto/doc/src/notes.xml b/lib/crypto/doc/src/notes.xml index 66d9477f35f3..e50312951194 100644 --- a/lib/crypto/doc/src/notes.xml +++ b/lib/crypto/doc/src/notes.xml @@ -735,7 +735,7 @@

- The chipers aes_cfb8 and aes_cfb128 are now using the EVP + The ciphers aes_cfb8 and aes_cfb128 are now using the EVP interface. The supported key lengths are 128, 192 and 256 bits.

@@ -743,7 +743,7 @@

- The chipers aes_cfb8 and aes_cfb128 are now available in + The ciphers aes_cfb8 and aes_cfb128 are now available in FIPS enabled mode.

Own Id: OTP-16134 Aux Id: PR-2407

@@ -852,7 +852,7 @@

- The cipher aes-ctr was disabled by misstake in + The cipher aes-ctr was disabled by mistake in crypto:supports for cryptolibs before 1.0.1. It worked however in the encrypt and decrypt functions.

@@ -1030,7 +1030,7 @@

- The chipers aes_cfb8 and aes_cfb128 are now using the EVP + The ciphers aes_cfb8 and aes_cfb128 are now using the EVP interface. The supported key lengths are 128, 192 and 256 bits.

@@ -1038,7 +1038,7 @@

- The chipers aes_cfb8 and aes_cfb128 are now available in + The ciphers aes_cfb8 and aes_cfb128 are now available in FIPS enabled mode.

Own Id: OTP-16134 Aux Id: PR-2407

@@ -1359,7 +1359,7 @@

- The chipers aes_cfb8 and aes_cfb128 are now using the EVP + The ciphers aes_cfb8 and aes_cfb128 are now using the EVP interface. The supported key lengths are 128, 192 and 256 bits.

@@ -2494,7 +2494,7 @@ Own Id: OTP-8551

-

The undocumented, unsupport, and deprecated function +

The undocumented, unsupported, and deprecated function lists:flat_length/1 has been removed.

Own Id: OTP-8584

@@ -2777,7 +2777,7 @@

- crypto and zlib drivers improved to allow concurent smp + crypto and zlib drivers improved to allow concurrent smp access.

Own Id: OTP-7262

diff --git a/lib/crypto/src/crypto.erl b/lib/crypto/src/crypto.erl index b291f7a420fe..07f33d18f8b7 100644 --- a/lib/crypto/src/crypto.erl +++ b/lib/crypto/src/crypto.erl @@ -1745,7 +1745,7 @@ mod_pow(Base, Exponent, Prime) -> %%% %%%====================================================================== -%%%---- Refering to keys stored in an engine: +%%%---- Referring to keys stored in an engine: -type key_id() :: string() | binary() . -type password() :: string() | binary() . @@ -2407,7 +2407,7 @@ format_pwd(M) -> M. %% %% large integer in a binary with 32bit length -%% MP representaion (SSH2) +%% MP representation (SSH2) mpint(X) when X < 0 -> mpint_neg(X); mpint(X) -> mpint_pos(X). diff --git a/lib/crypto/test/crypto_SUITE.erl b/lib/crypto/test/crypto_SUITE.erl index 3f6ec81794a6..2bd75a59ca72 100644 --- a/lib/crypto/test/crypto_SUITE.erl +++ b/lib/crypto/test/crypto_SUITE.erl @@ -1276,7 +1276,7 @@ info(_Config) -> ok; Other -> ct:log("Ver = ~p~ncrypto:info() -> ~p", [Ver,Other]), - ct:fail("Version missmatch", []) + ct:fail("Version mismatch", []) catch C:E -> ct:log("Exception ~p:~p", [C,E]), diff --git a/lib/crypto/test/engine_SUITE.erl b/lib/crypto/test/engine_SUITE.erl index 2f6017e1bf6a..cab519fdb960 100644 --- a/lib/crypto/test/engine_SUITE.erl +++ b/lib/crypto/test/engine_SUITE.erl @@ -552,7 +552,7 @@ bad_arguments(Config) when is_list(Config) -> <<"LOAD">>], []) of - {error,bad_engine_id} -> % should have happend in the previous try...catch end! + {error,bad_engine_id} -> % should have happened in the previous try...catch end! throw(dynamic_engine_unsupported); X3 -> ct:fail("3 Got ~p",[X3]) @@ -655,7 +655,7 @@ failed_engine_init(Config) when is_list(Config) -> %%------------------------------------------------------------------------- %% Test the optional flag in ctrl comands ctrl_cmd_string()-> - [{doc, "Test that a not known optional ctrl comand do not fail"}]. + [{doc, "Test that a not known optional ctrl command do not fail"}]. ctrl_cmd_string(Config) when is_list(Config) -> try case crypto:get_test_engine() of @@ -685,7 +685,7 @@ ctrl_cmd_string(Config) when is_list(Config) -> end. ctrl_cmd_string_optional()-> - [{doc, "Test that a not known optional ctrl comand do not fail"}]. + [{doc, "Test that a not known optional ctrl command do not fail"}]. ctrl_cmd_string_optional(Config) when is_list(Config) -> try case crypto:get_test_engine() of @@ -831,7 +831,7 @@ sign_verify_rsa_pwd_bad_pwd(Config) -> Pub = #{engine => engine_ref(Config), key_id => key_id(Config, "rsa_public_key_pwd.pem")}, try sign_verify(rsa, sha, Priv, Pub) of - _ -> {fail, "PWD prot pubkey sign succeded with no pwd!"} + _ -> {fail, "PWD prot pubkey sign succeeded with no pwd!"} catch error:badarg -> ok end. @@ -909,7 +909,7 @@ get_pub_from_priv_key_rsa_pwd_no_pwd(Config) -> {fail, {wrong_error,Error}}; Pub -> ct:log("rsa Pub = ~p",[Pub]), - {fail, "PWD prot pubkey fetch succeded although no pwd!"} + {fail, "PWD prot pubkey fetch succeeded although no pwd!"} end. get_pub_from_priv_key_rsa_pwd_bad_pwd(Config) -> @@ -925,7 +925,7 @@ get_pub_from_priv_key_rsa_pwd_bad_pwd(Config) -> {fail, {wrong_error,Error}}; Pub -> ct:log("rsa Pub = ~p",[Pub]), - {fail, "PWD prot pubkey fetch succeded with bad pwd!"} + {fail, "PWD prot pubkey fetch succeeded with bad pwd!"} end. get_pub_from_priv_key_dsa(Config) -> diff --git a/lib/crypto/test/property_test/crypto_prop_generators.erl b/lib/crypto/test/property_test/crypto_prop_generators.erl index 094d7360f9ae..2dd69cff4c7f 100644 --- a/lib/crypto/test/property_test/crypto_prop_generators.erl +++ b/lib/crypto/test/property_test/crypto_prop_generators.erl @@ -44,11 +44,11 @@ text_plain() -> iolist(). cipher() -> oneof(non_aead_ciphers()). key(Cipher) -> - %% Can't be shrinked + %% Can't be shrunk crypto:strong_rand_bytes( key_length(Cipher) ). iv(Cipher) -> - %% Can't be shrinked + %% Can't be shrunk crypto:strong_rand_bytes( iv_length(Cipher) ). iolist() -> frequency([{5, list( oneof([list(byte()),