File 1349-Fix-typos-in-lib-public_key.patch of Package erlang
From f816eeec5b74d54c87d7cab54d55a77adf69c5d4 Mon Sep 17 00:00:00 2001
From: "Kian-Meng, Ang" <kianmeng@cpan.org>
Date: Sun, 26 Dec 2021 15:48:35 +0800
Subject: [PATCH] Fix typos in lib/public_key
---
lib/public_key/asn1/ECPrivateKey.asn1 | 2 +-
lib/public_key/doc/src/notes.xml | 16 +++++++--------
lib/public_key/doc/src/public_key.xml | 2 +-
lib/public_key/doc/src/using_public_key.xml | 20 +++++++++----------
lib/public_key/src/pubkey_cert.erl | 6 +++---
lib/public_key/src/pubkey_cert_records.erl | 2 +-
lib/public_key/src/pubkey_crl.erl | 2 +-
lib/public_key/src/pubkey_ssh.erl | 2 +-
lib/public_key/src/public_key.erl | 4 ++--
lib/public_key/test/erl_make_certs.erl | 4 ++--
lib/public_key/test/pkits_SUITE.erl | 10 +++++-----
.../ssh_rsa_long_comment_pub | 2 +-
.../ssh_rsa_long_header_pub | 2 +-
lib/public_key/test/public_key_SUITE.erl | 10 +++++-----
14 files changed, 42 insertions(+), 42 deletions(-)
diff --git a/lib/public_key/doc/src/notes.xml b/lib/public_key/doc/src/notes.xml
index fed7505aba..8199277e25 100644
--- a/lib/public_key/doc/src/notes.xml
+++ b/lib/public_key/doc/src/notes.xml
@@ -873,7 +873,7 @@
</item>
<item>
<p>
- Add different upper bounds for diffrent string types as
+ Add different upper bounds for different string types as
suggested by comment in PKIX1Explicit88.</p>
<p>
Own Id: OTP-13132</p>
@@ -1077,7 +1077,7 @@
<item>
<p>
Add support for ISO oids 1.3.14.3.2.29 and 1.3.14.3.2.27
- that are somtimes used instead of the PKCS defined oids
+ that are sometimes used instead of the PKCS defined oids
1.2.840.113549.1.1.5 and 1.2.840.10040.4.3. Add function
pkix_sign_types:/1 that translates oids to to algorithm
atoms ex:</p>
@@ -1170,7 +1170,7 @@
<item>
<p>
ssh_decode now handles comments, at the end of the line,
- containing withe spaces correctly</p>
+ containing with spaces correctly</p>
<p>
Own Id: OTP-9361</p>
</item>
@@ -1188,7 +1188,7 @@
<list>
<item>
<p>
- public_key now supports PKCS-10 and includes exprimental
+ public_key now supports PKCS-10 and includes experimental
support for PKCS-7</p>
<p>
Own Id: OTP-10509 Aux Id: kunagi-291 [202] </p>
diff --git a/lib/public_key/doc/src/using_public_key.xml b/lib/public_key/doc/src/using_public_key.xml
index b783785347..1261971401 100644
--- a/lib/public_key/doc/src/using_public_key.xml
+++ b/lib/public_key/doc/src/using_public_key.xml
@@ -87,7 +87,7 @@
<p>An RSA private key encrypted with a password can look as follows:</p>
<code>1> {ok, PemBin} = file:read_file("rsa.pem").
-{ok,<<"Bag Attribut"...>>}</code>
+{ok,<<"Bag Attribute"...>>}</code>
<p>The following PEM file has only one entry, a private RSA key:</p>
<code>2>[RSAEntry] = public_key:pem_decode(PemBin).
@@ -382,7 +382,7 @@ Msg = public_key:decrypt_public(RsaEncrypted, PublicKey),</code>
Msg = public_key:decrypt_private(RsaEncrypted, PrivateKey),</code>
<note><p>You normally do only one of the encrypt or decrypt operations,
- and the peer does the other. This normaly used in legacy applications
+ and the peer does the other. This normally used in legacy applications
as a primitive digital signature.
</p></note>
@@ -426,12 +426,12 @@ true = public_key:verify(Digest, none, Signature, PublicKey),</code>
checks that the certificate is not revoked, not forged or not out-of-date.
</p>
<p>There are however attacks that are not detected by those checks. Suppose a bad guy has
- succeded with a DNS infection. Then the client could belive it is connecting to one host but
+ succeeded with a DNS infection. Then the client could believe it is connecting to one host but
ends up at another but evil one. Though it is evil, it could have a perfectly legal
certificate! The certificate has a valid signature, it is not revoked, the certificate chain
is not faked and has a trusted root and so on.
</p>
- <p>To detect that the server is not the intended one, the client must additionaly perform
+ <p>To detect that the server is not the intended one, the client must additionally perform
a <i>hostname verification</i>. This procedure is described in
<url href="https://tools.ietf.org/html/rfc6125">RFC 6125</url>. The idea is that the certificate
lists the hostnames it could be fetched from. This is checked by the certificate issuer when
@@ -447,13 +447,13 @@ true = public_key:verify(Digest, none, Signature, PublicKey),</code>
It is possible for a client to hook in modified rules using the options list.
</p>
<p>Some terminology is needed: the certificate presents hostname(s) on which it is valid.
- Those are called <i>Presented IDs</i>. The hostname(s) the client belives it connects to
+ Those are called <i>Presented IDs</i>. The hostname(s) the client believes it connects to
are called <i>Reference IDs</i>. The matching rules aims to verify that there is at least
one of the Reference IDs that matches one of the Presented IDs. If not, the verification fails.
</p>
<p>The IDs contains normal fully qualified domain names like e.g <c>foo.example.com</c>,
but IP addresses are not recommended. The rfc describes why this is not recommended as well
- as security considerations about how to aquire the Reference IDs.
+ as security considerations about how to acquire the Reference IDs.
</p>
<p>Internationalized domain names are not supported.
</p>
@@ -525,7 +525,7 @@ true = public_key:verify(Digest, none, Signature, PublicKey),</code>
field, the <c>Subject</c> field MUST NOT be used for host name checking, even if it contains
valid CN names.
Therefore only <c>kb.example.org</c> and <c>https://www.example.org</c> matches. The match fails
- both for <c>example.com</c> and <c>foo.example.com</c> becuase they are in the <c>Subject</c>
+ both for <c>example.com</c> and <c>foo.example.com</c> because they are in the <c>Subject</c>
field which is not checked because the <c>Subject Alternate Name</c> field is present.
</p>
</section>
@@ -599,7 +599,7 @@ true = public_key:verify(Digest, none, Signature, PublicKey),</code>
<section>
<title>Re-defining the match operations</title>
<p>The default matching handles dns_id and uri_id. In an uri_id the value is tested for
- equality with a value from the <c>Subject Alternate Name</c>. If som other kind of matching
+ equality with a value from the <c>Subject Alternate Name</c>. If some other kind of matching
is needed, use the <c>match_fun</c> option.
</p>
<p>The <c>match_fun</c> takes two arguments and returns either <c>true</c>,
@@ -626,8 +626,8 @@ true = public_key:verify(Digest, none, Signature, PublicKey),</code>
field and from the <c>Subject Alternate Name</c> field.
</p>
<p>The default matching transformes the ascii values in strings to lowercase before comparing.
- The <c>match_fun</c> is however called without any transfomation applied to the strings. The
- reason is to enable the user to do unforseen handling of the strings where the original format
+ The <c>match_fun</c> is however called without any transformation applied to the strings. The
+ reason is to enable the user to do unforeseen handling of the strings where the original format
is needed.
</p>
</section>
diff --git a/lib/public_key/src/pubkey_cert.erl b/lib/public_key/src/pubkey_cert.erl
index 9e3cc52d24..cf2a0cffd2 100644
--- a/lib/public_key/src/pubkey_cert.erl
+++ b/lib/public_key/src/pubkey_cert.erl
@@ -72,7 +72,7 @@ verify_data(DerCert) ->
-spec init_validation_state(#'OTPCertificate'{}, integer(), list()) ->
#path_validation_state{}.
%%
-%% Description: Creates inital version of path_validation_state for
+%% Description: Creates initial version of path_validation_state for
%% basic path validation of x509 certificates.
%%--------------------------------------------------------------------
init_validation_state(#'OTPCertificate'{} = OtpCert, DefaultPathLen,
@@ -247,7 +247,7 @@ validate_extensions(OtpCert, ValidationState, UserState, VerifyFun) ->
-spec normalize_general_name({rdnSequence, term()}) -> {rdnSequence, term()}.
%%
%% Description: Normalizes a general name so that it can be easily
-%% compared to another genral name.
+%% compared to another general name.
%%--------------------------------------------------------------------
normalize_general_name({rdnSequence, Issuer}) ->
NormIssuer = do_normalize_general_name(Issuer),
diff --git a/lib/public_key/src/pubkey_cert_records.erl b/lib/public_key/src/pubkey_cert_records.erl
index 592bd4c938..d837d8cf7b 100644
--- a/lib/public_key/src/pubkey_cert_records.erl
+++ b/lib/public_key/src/pubkey_cert_records.erl
@@ -44,7 +44,7 @@ decode_cert(DerCert) ->
%%--------------------------------------------------------------------
-spec transform(term(), encode | decode) ->term().
%%
-%% Description: Transforms between encoded and decode otp formated
+%% Description: Transforms between encoded and decode otp formatted
%% certificate parts.
%%--------------------------------------------------------------------
diff --git a/lib/public_key/src/pubkey_crl.erl b/lib/public_key/src/pubkey_crl.erl
index 7115424863..53c006ff13 100644
--- a/lib/public_key/src/pubkey_crl.erl
+++ b/lib/public_key/src/pubkey_crl.erl
@@ -298,7 +298,7 @@ is_all_reasons(Mask, AllReasonsFun) ->
%% As the "uspecified" reason should not
%% be explicitly used according to RFC 3280
%% and the conformance tests have test cases
- %% that should succed, and that does not specify
+ %% that should succeed, and that does not specify
%% "unspecified", we tolorate that it is not included.
sets:is_subset(sets:del_element(unspecified, AllReasons), Mask)
end.
diff --git a/lib/public_key/src/pubkey_ssh.erl b/lib/public_key/src/pubkey_ssh.erl
index 9a9505f558..2b802163aa 100644
--- a/lib/public_key/src/pubkey_ssh.erl
+++ b/lib/public_key/src/pubkey_ssh.erl
@@ -614,7 +614,7 @@ split_n(N, Bin, Acc) ->
split_n(0, <<>>, [Last | Acc])
end.
%% 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/public_key/src/public_key.erl b/lib/public_key/src/public_key.erl
index 0b5061f695..8352bc3802 100644
--- a/lib/public_key/src/public_key.erl
+++ b/lib/public_key/src/public_key.erl
@@ -2043,8 +2043,8 @@ match_wild(_, _) -> false.
%% Match the parts after the only wildcard by comparing them from the end
match_wild_suffixes(A, B) -> match_wild_sfx(lists:reverse(A), lists:reverse(B)).
-match_wild_sfx([$*|_], _) -> false; % Bad name (no wildcards alowed)
-match_wild_sfx(_, [$*|_]) -> false; % Bad pattern (no more wildcards alowed)
+match_wild_sfx([$*|_], _) -> false; % Bad name (no wildcards allowed)
+match_wild_sfx(_, [$*|_]) -> false; % Bad pattern (no more wildcards allowed)
match_wild_sfx([A|Ar], [A|Br]) -> match_wild_sfx(Ar, Br);
match_wild_sfx(Ar, []) -> not lists:member($*, Ar); % Chk for bad name (= wildcards)
match_wild_sfx(_, _) -> false.
diff --git a/lib/public_key/test/erl_make_certs.erl b/lib/public_key/test/erl_make_certs.erl
index e2a94dd886..a56c8e3691 100644
--- a/lib/public_key/test/erl_make_certs.erl
+++ b/lib/public_key/test/erl_make_certs.erl
@@ -47,7 +47,7 @@
%% {title, Title}
%% {dnQualifer, DnQ}
%% issuer = {Issuer, IssuerKey} true (i.e. a ca cert is created)
-%% (obs IssuerKey migth be {Key, Password}
+%% (obs IssuerKey might be {Key, Password}
%% key = KeyFile|KeyBin|rsa|dsa|ec Subject PublicKey rsa, dsa or ec generates key
%%
%%
diff --git a/lib/public_key/test/pkits_SUITE.erl b/lib/public_key/test/pkits_SUITE.erl
index ba3efdba09..9cd71adce1 100644
--- a/lib/public_key/test/pkits_SUITE.erl
+++ b/lib/public_key/test/pkits_SUITE.erl
@@ -300,24 +300,24 @@ end_per_testcase(_Func, Config) ->
%%--------------------------- signature_verification--------------------------------------------------
valid_rsa_signature() ->
- [{doc, "Test rsa signatur verification"}].
+ [{doc, "Test rsa signature verification"}].
valid_rsa_signature(Config) when is_list(Config) ->
run([{ "4.1.1", "Valid Certificate Path Test1 EE", ok}]).
invalid_rsa_signature() ->
- [{doc,"Test rsa signatur verification"}].
+ [{doc,"Test rsa signature verification"}].
invalid_rsa_signature(Config) when is_list(Config) ->
run([{ "4.1.2", "Invalid CA Signature Test2 EE", {bad_cert,invalid_signature}},
{ "4.1.3", "Invalid EE Signature Test3 EE", {bad_cert,invalid_signature}}]).
valid_dsa_signature() ->
- [{doc,"Test dsa signatur verification"}].
+ [{doc,"Test dsa signature verification"}].
valid_dsa_signature(Config) when is_list(Config) ->
run([{ "4.1.4", "Valid DSA Signatures Test4 EE", ok},
{ "4.1.5", "Valid DSA Parameter Inheritance Test5 EE", ok}]).
invalid_dsa_signature() ->
- [{doc,"Test dsa signatur verification"}].
+ [{doc,"Test dsa signature verification"}].
invalid_dsa_signature(Config) when is_list(Config) ->
run([{ "4.1.6", "Invalid DSA Signature Test6 EE",{bad_cert,invalid_signature}}]).
@@ -805,7 +805,7 @@ invalid_crl_issuer(Config) when is_list(Config) ->
]).
%% Although this test is valid it has a circular dependency. As a result
-%% an attempt is made to reursively checks a CRL path and rejected due to
+%% an attempt is made to recursively checks a CRL path and rejected due to
%% a CRL path validation error. PKITS notes suggest this test does not
%% need to be run due to this issue.
%% { "4.14.30", "Valid cRLIssuer Test30", 54 }
diff --git a/lib/public_key/test/public_key_SUITE.erl b/lib/public_key/test/public_key_SUITE.erl
index b176cbef6a..c9ba3e8c7e 100644
--- a/lib/public_key/test/public_key_SUITE.erl
+++ b/lib/public_key/test/public_key_SUITE.erl
@@ -662,7 +662,7 @@ pkix(Config) when is_list(Config) ->
true = lists:member(IssuerId, CaIds),
- %% Should be normalized allready
+ %% Should be normalized already
TestStr = {rdnSequence,
[[{'AttributeTypeAndValue', {2,5,4,3},{printableString,"ERLANGCA"}}],
[{'AttributeTypeAndValue', {2,5,4,3},{printableString," erlang ca "}}]]},
--
2.31.1