Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion lib/crypto/c_src/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/crypto/c_src/api_ng.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/crypto/c_src/dh.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions lib/crypto/c_src/mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion lib/crypto/c_src/openssl_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions lib/crypto/configure
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/crypto/configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/crypto/doc/src/algorithm_details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
<seetype marker="crypto#cipher_iv">cipher_iv()</seetype> or
<seetype marker="crypto#cipher_aead">cipher_aead()</seetype>.
The letters IV are short for <i>Initialization Vector</i> and
AEAD is an abreviation of <i>Authenticated Encryption with Associated Data</i>.
AEAD is an abbreviation of <i>Authenticated Encryption with Associated Data</i>.
</p>
<p>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
<seeguide marker="crypto:new_api#retired-cipher-names">Retired cipher names</seeguide>.
</p>
<p>To dynamically check availability, check that the name in the <i>Cipher and Mode</i> column is present in the
Expand Down
18 changes: 9 additions & 9 deletions lib/crypto/doc/src/crypto.xml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
<p></p>
</item>

<tag>Asymetric Ciphers - Public Key Techniques</tag>
<tag>Asymmetric Ciphers - Public Key Techniques</tag>
<item>
<p></p>
<taglist>
Expand Down Expand Up @@ -662,7 +662,7 @@
The <seetype marker="#otp_padding">otp_padding</seetype> is not
removed - it has to be done elsewhere.
</p>
<p>If padding is <c>{padding,none}</c> or not specifed and the total data from all subsequent
<p>If padding is <c>{padding,none}</c> or not specified and the total data from all subsequent
<seemfa marker="crypto#crypto_update/2">crypto_updates</seemfa> does
not fill the last block fully, that last data is lost. In case of <c>{padding,none}</c> there will
be an error in this case. If padding is not specified, the bytes of the unfilled block is silently
Expand Down Expand Up @@ -744,7 +744,7 @@
the number of bytes padded. Otherwise 0.
</item>
<tag><c>padding_type</c></tag>
<item>The type of the padding as provided in the call ot
<item>The type of the padding as provided in the call to
<seemfa marker="#crypto_init/3">crypto_init/3,4</seemfa>.
</item>
<tag><c>encrypt</c></tag>
Expand Down Expand Up @@ -1144,7 +1144,7 @@
<p>Enables (<c>Enable = true</c>) or disables (<c>Enable = false</c>) FIPS mode. Returns <c>true</c> if
the operation was successful or <c>false</c> otherwise.
</p>
<p>Note that to enable FIPS mode succesfully, OTP must be built with the configure option <c>--enable-fips</c>,
<p>Note that to enable FIPS mode successfully, OTP must be built with the configure option <c>--enable-fips</c>,
and the underlying libcrypto must also support FIPS.
</p>
<p>See also <seemfa marker="#info_fips/0">info_fips/0</seemfa>.
Expand Down Expand Up @@ -1217,7 +1217,7 @@
<p>The ciphers <c>aes_cbc</c>, <c>aes_cfb8</c>, <c>aes_cfb128</c>, <c>aes_ctr</c>,
<c>aes_ecb</c>, <c>aes_gcm</c> and <c>aes_ccm</c>
has no keylength in the <c>Type</c> as opposed to for example <c>aes_128_ctr</c>. 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.</p>
<p>Always use a <c>Type</c> with an explicit key length,
</p>
Expand Down Expand Up @@ -1392,11 +1392,11 @@ _FloatValue = rand:uniform(). % [0.0; 1.0[</pre>
<note>
<p>
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
<seeerl marker="stdlib:rand">rand</seeerl>
functions,
since reproducability does not match cryptographically safe.
since reproducibility does not match cryptographically safe.
</p>
<p>
The only supported usage is to generate one distinct
Expand Down Expand Up @@ -1511,11 +1511,11 @@ FloatValue = rand:uniform(). % again
<note>
<p>
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
<seeerl marker="stdlib:rand">rand</seeerl>
functions,
since reproducability does not match cryptographically safe.
since reproducibility does not match cryptographically safe.
</p>
<p>
In fact since random data is cached some numbers may
Expand Down
6 changes: 3 additions & 3 deletions lib/crypto/doc/src/licenses.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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.]
Expand Down
4 changes: 2 additions & 2 deletions lib/crypto/doc/src/new_api.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

<section>
<title>The old API</title>
<p>The old functions - deprecated from 23.0 and removed from OTP 24.0 - are for chipers:</p>
<p>The old functions - deprecated from 23.0 and removed from OTP 24.0 - are for ciphers:</p>
<list>
<item><c>block_encrypt/3</c></item>
<item><c>block_encrypt/4</c></item>
Expand Down Expand Up @@ -111,7 +111,7 @@
<item><seemfa marker="crypto#crypto_final/1">crypto_final/1</seemfa></item>
</list>
<p>The <c>crypto_init</c> initialies an internal cipher state, and one or more calls of
<c>crypto_update</c> does the acual encryption or decryption. Note that AEAD ciphers
<c>crypto_update</c> does the actual encryption or decryption. Note that AEAD ciphers
can't be handled this way due to their nature.
</p>
<p>For repeated encryption or decryption of a text divided in parts where the
Expand Down
16 changes: 8 additions & 8 deletions lib/crypto/doc/src/notes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -735,15 +735,15 @@
<list>
<item>
<p>
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.</p>
<p>
Own Id: OTP-16133 Aux Id: PR-2407 </p>
</item>
<item>
<p>
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.</p>
<p>
Own Id: OTP-16134 Aux Id: PR-2407 </p>
Expand Down Expand Up @@ -852,7 +852,7 @@
<list>
<item>
<p>
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.</p>
<p>
Expand Down Expand Up @@ -1030,15 +1030,15 @@
<list>
<item>
<p>
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.</p>
<p>
Own Id: OTP-16133 Aux Id: PR-2407 </p>
</item>
<item>
<p>
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.</p>
<p>
Own Id: OTP-16134 Aux Id: PR-2407 </p>
Expand Down Expand Up @@ -1359,7 +1359,7 @@
<list>
<item>
<p>
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.</p>
<p>
Expand Down Expand Up @@ -2494,7 +2494,7 @@
Own Id: OTP-8551</p>
</item>
<item>
<p>The undocumented, unsupport, and deprecated function
<p>The undocumented, unsupported, and deprecated function
<c>lists:flat_length/1</c> has been removed.</p>
<p>
Own Id: OTP-8584</p>
Expand Down Expand Up @@ -2777,7 +2777,7 @@
<list>
<item>
<p>
crypto and zlib drivers improved to allow concurent smp
crypto and zlib drivers improved to allow concurrent smp
access.</p>
<p>
Own Id: OTP-7262</p>
Expand Down
4 changes: 2 additions & 2 deletions lib/crypto/src/crypto.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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() .

Expand Down Expand Up @@ -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).

Expand Down
2 changes: 1 addition & 1 deletion lib/crypto/test/crypto_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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]),
Expand Down
12 changes: 6 additions & 6 deletions lib/crypto/test/engine_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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) ->
Expand All @@ -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) ->
Expand Down
4 changes: 2 additions & 2 deletions lib/crypto/test/property_test/crypto_prop_generators.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down