Skip to content

Commit cb02efe

Browse files
authored
Fix Typos in documentation and comments (#852)
* Update README.md rephrase warning message in README.md * EncodingPatternPreservation: fix typo * AbstractCodec: fix typo * AbstractCodec: there is no such thing as a footgun usage * AbstractPushbackSequence: fix typo. see https://languagetool.org/insights/post/regard/ * Base64: fix typo * HashTrie: fix typo * HashTrie: fix typo * HTMLEntityCodec: fix typo * MySQLCodec: fix typo * MySQLCodec: fix typo * PushBackSequenceImpl: fix typo * PushbackString: fix typo * EsapiConfiguration: fix typo * AbstractPrioritizedPropertyLoader: fix typo * AbstractPrioritizedPropertyLoader: fix grammar * CipherText: fix typo * CipherTextSerializer: fix typo * CryptoHelper: fix typo * CryptoHelper: fix typo * CryptoHelper: fix grammar * CryptoToken: fix typo * CryptoToken: fix typo * PlainText: fix typo * RequestRateThrottleFilter: fix typo * SecurityWrapperRequest: fix typo * CompositeLogScrubber: fix typo * JavaLogBridge: fix typo * Authenticator: fix typo * Encoder: fix typo * Encryptor: untangle unclear sentence * ESAPI: fix typo * HTTPUtilities: fix typo * HTTPUtilities: fix typo * Logger: fix typo * Logger: fix typo * SecurityConfiguration: fix typo * StringUtilities: correct javadoc * User: fix typo * Validator: fix typo * Validator: fix typo * CollectionsUtil: fix typo * ObjFactory: fix typo * EncodeForBase64Tag: fix typo * EncodeForCSSTag: fix typo * EncodeForHTMLAttributeTag: fix typo * EncodeForHTMLTag: fix typo * EncodeForJavaScriptTag: fix typo * EncodeForURLTag: fix typo * EncodeForVBScriptTag: fix typo * EncodeForXMLAttributeTag: fix typo * EncodeForXMLTag: fix typo * EncodeForXPathTag: fix typo * AbstractAccessReferenceMap: fix typo * StringUtilities: replaceNull: rephrase javadoc using @code * Encryptor: decrypt: fix typo, use expression from before f5e138c * User: setLastFailedLoginTime: use "authenticate" instead of "log in"
1 parent 3a78d6d commit cb02efe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+74
-74
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ OWASP® ESAPI (The OWASP Enterprise Security API) is a free, open source, web ap
1717
# Jakarta EE Support
1818
**IMPORTANT:**
1919
ESAPI has supported the Jakarta Servlet API (i.e., **jakarta.servlet.api**) since release
20-
2.5.3.0. (Unfortunately, we were just forgot to note that in this **README** file. Duh!)
20+
2.5.3.0. (Unfortunately, this information was previously missing in this **README** file.)
2121

2222
Therefore, for release 2.5.3.0 and later versions of ESAPI, ESAPI ought to be able to support Spring Boot 3, Spring 6, Tomcat 10,
2323
and other applications or libraries requiring Jarkata EE. (If you find a case where it does

src/main/java/org/owasp/esapi/Authenticator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public interface Authenticator {
148148
* <p>
149149
* <b>WARNING:</b> The implementation of this method as defined in the
150150
* default reference implementation class, {@code FileBasedAuthenticator},
151-
* uses a password hash algorthim that is known to be weak. You are advised
151+
* uses a password hash algorithm that is known to be weak. You are advised
152152
* to replace the default reference implementation class with your own custom
153153
* implementation that uses a stronger password hashing algorithm.
154154
* See class comments in * {@code FileBasedAuthenticator} for further details.

src/main/java/org/owasp/esapi/ESAPI.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public static Authenticator authenticator() {
9393
}
9494

9595
/**
96-
* The ESAPI Encoder is primarilly used to provide <i>output</i> encoding to
96+
* The ESAPI Encoder is primarily used to provide <i>output</i> encoding to
9797
* prevent Cross-Site Scripting (XSS).
9898
* @return the current ESAPI Encoder object being used to encode and decode data for this application.
9999
*/

src/main/java/org/owasp/esapi/Encoder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ public interface Encoder {
519519
*
520520
* NB: The reference implementation encodes almost everything and may over-encode.
521521
*
522-
* The difficulty with XPath encoding is that XPath has no built in mechanism for escaping
522+
* The difficulty with XPath encoding is that XPath has no built-in mechanism for escaping
523523
* characters. It is possible to use XQuery in a parameterized way to
524524
* prevent injection.
525525
*

src/main/java/org/owasp/esapi/Encryptor.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ CipherText encrypt(SecretKey key, PlainText plaintext)
162162
* </p>
163163
* @param ciphertext The {@code CipherText} object to be decrypted.
164164
* @return The {@code PlainText} object resulting from decrypting the specified
165-
* ciphertext. Note that it it is desired to convert the returned
166-
* plaintext byte array to a Java String is should be done using
165+
* ciphertext. Note that if it is desired to convert the returned
166+
* plaintext byte array to a Java String it should be done using
167167
* {@code new String(byte[], "UTF-8");} rather than simply using
168168
* {@code new String(byte[]);} which uses native encoding and may
169169
* not be portable across hardware and/or OS platforms.
@@ -186,8 +186,8 @@ CipherText encrypt(SecretKey key, PlainText plaintext)
186186
* @param key The {@code SecretKey} to use for encrypting the plaintext.
187187
* @param ciphertext The {@code CipherText} object to be decrypted.
188188
* @return The {@code PlainText} object resulting from decrypting the specified
189-
* ciphertext. Note that it it is desired to convert the returned
190-
* plaintext byte array to a Java String is should be done using
189+
* ciphertext. Note that if it is desired to convert the returned
190+
* plaintext byte array to a Java String it should be done using
191191
* {@code new String(byte[], "UTF-8");} rather than simply using
192192
* {@code new String(byte[]);} which uses native encoding and may
193193
* not be portable across hardware and/or OS platforms.

src/main/java/org/owasp/esapi/HTTPUtilities.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ public interface HTTPUtilities
377377
* everything to keey your application and environment secure. Some of the more obvious omissions are the
378378
* absence of examining the actual file content to determine the actual file type or running some AV scan
379379
* on the uploaded files. You have to add that functionality to you if you want or need that. Some
380-
* reasource that you may find usefule are:
380+
* resource that you may find useful are:
381381
* <ul>
382382
* <li><a href="https://cheatsheetseries.owasp.org/cheatsheets/File_Upload_Cheat_Sheet.html">OWASP File Upload Cheat Sheet</a></li>
383383
* <li><a href="https://cheatsheetseries.owasp.org/cheatsheets/Denial_of_Service_Cheat_Sheet.html">OWASP Denial of Service Cheat Sheet</a></li>

src/main/java/org/owasp/esapi/Logger.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@
8989
* the basis for its logging implementation. Both provided implementations implement requirements #1 through #5 above.
9090
* </p><p>
9191
* <i>Customization</i>: It is expected that most organizations may wish to implement their own custom {@code Logger} class in
92-
* order to integrate ESAPI logging with their specific logging infrastructure. The ESAPI feference implementations
92+
* order to integrate ESAPI logging with their specific logging infrastructure. The ESAPI reference implementations
9393
* can serve as a useful starting point to intended to provide a simple functional example of an implementation, but
94-
* they are also largely usuable out-of-the-box with some additional minimal log configuration.
94+
* they are also largely usable out-of-the-box with some additional minimal log configuration.
9595
*
9696
* @author Jeff Williams (jeff.williams .at. aspectsecurity.com) <a
9797
* href="http://www.aspectsecurity.com">Aspect Security</a>

src/main/java/org/owasp/esapi/SecurityConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public interface SecurityConfiguration extends EsapiPropertyLoader {
179179
* considered the <i>default</i> key size that ESAPI will use for symmetric
180180
* ciphers supporting multiple key sizes. (Note that there is also an <b>Encryptor.MinEncryptionKeyLength</b>,
181181
* which is the <i>minimum</i> key size (in bits) that ESAPI will support
182-
* for encryption. (There is no miminimum for decryption.)
182+
* for encryption. (There is no minimum for decryption.)
183183
*
184184
* @return the key length (in bits)
185185
* @deprecated Use SecurityConfiguration.getIntProp("appropriate_esapi_prop_name") instead.

src/main/java/org/owasp/esapi/StringUtilities.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public static boolean contains(StringBuilder input, char c) {
9090
}
9191

9292
/**
93-
* Returns the replace value if the value of test is null, "null", or ""
93+
* Returns {@code replace} if {@code test} is null, "null" (case-insensitive), or blank, otherwise {@code test}
9494
*
9595
* @param test The value to test
9696
* @param replace The replacement value

src/main/java/org/owasp/esapi/User.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ public interface User extends Principal, Serializable {
380380
/**
381381
* Set the time of the last failed login for this user.
382382
*
383-
* @param lastFailedLoginTime the date and time when the user just failed to login correctly.
383+
* @param lastFailedLoginTime the date and time when the user just failed to authenticate correctly.
384384
*/
385385
void setLastFailedLoginTime(Date lastFailedLoginTime);
386386

src/main/java/org/owasp/esapi/Validator.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,10 +384,10 @@ public interface Validator {
384384
boolean isValidSafeHTML(String context, String input, int maxLength, boolean allowNull, ValidationErrorList errorList) throws IntrusionException;
385385

386386
/**
387-
* Canonicalize and then sanitize the input so that it is "safe" for renderinger in an HTML context (i.e., that
387+
* Canonicalize and then sanitize the input so that it is "safe" for rendering in an HTML context (i.e., that
388388
* it does not contain unwanted scripts in the body, attributes, CSS, URLs, or anywhere else). Note that the resulting
389389
* returned value may omit input that is considered dangerous and cannot be safely sanitized and other input
390-
* that gets HTML encoded (e.g., a single quote (') might get chaged to "&quot;").
390+
* that gets HTML encoded (e.g., a single quote (') might get changed to "&quot;").
391391
* <p>
392392
* The default behavior of this check depends on the {@code antisamy-esapi.xml} AntiSamy policy configuration file
393393
* (or an alternate filename, specified via the "Validator.HtmlValidationConfigurationFile" property in your
@@ -414,10 +414,10 @@ public interface Validator {
414414
String getValidSafeHTML(String context, String input, int maxLength, boolean allowNull) throws ValidationException, IntrusionException;
415415

416416
/**
417-
* Canonicalize and then sanitize the input so that it is "safe" for renderinger in an HTML context (i.e., that
417+
* Canonicalize and then sanitize the input so that it is "safe" for rendering in an HTML context (i.e., that
418418
* it does not contain unwanted scripts in the body, attributes, CSS, URLs, or anywhere else). Note that the resulting
419419
* returned value may omit input that is considered dangerous and cannot be safely sanitized and other input
420-
* that gets HTML encoded (e.g., a single quote (') might get chaged to "&quot;").
420+
* that gets HTML encoded (e.g., a single quote (') might get changed to "&quot;").
421421
* <p>
422422
* The default behavior of this check depends on the {@code antisamy-esapi.xml} AntiSamy policy configuration file
423423
* (or an alternate filename, specified via the "Validator.HtmlValidationConfigurationFile" property in your

src/main/java/org/owasp/esapi/codecs/AbstractCodec.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
* <p>
2626
* Be sure to see the several <b>WARNING</b>s associated with the detailed
2727
* method descriptions. You will not find that in the "Method Summary" section
28-
* of the javadoc because that only shows the intial sentence.
28+
* of the javadoc because that only shows the initial sentence.
2929
*
3030
* @author Jeff Williams (jeff.williams .at. aspectsecurity.com) <a
3131
* href="http://www.aspectsecurity.com">Aspect Security</a>
@@ -96,7 +96,7 @@ public String encodeCharacter( char[] immune, Character c ) {
9696

9797

9898
/**
99-
* To prevent accidental footgun usage and calling
99+
* To prevent accidental usage and calling
100100
* {@link #encodeCharacter( char[], int)} when called with {@code char} and
101101
* {@code char} is first silently converted to {@code int} and then the
102102
* unexpected method is called.

src/main/java/org/owasp/esapi/codecs/AbstractPushbackSequence.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
/**
2121
* This Abstract class provides the generic logic for using a {@link PushbackSequence}
22-
* in regards to iterating strings. The final Impl is intended for the user to supply
22+
* in regard to iterating strings. The final Impl is intended for the user to supply
2323
* a type T such that the pushback interface can be utilized for sequences
2424
* of type T. Presently this generic class is limited by the fact that
2525
* input is a String.

src/main/java/org/owasp/esapi/codecs/Base64.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
* Added the ability to "suspend" encoding in the Output Stream so
7373
* you can turn on and off the encoding if you need to embed base64
7474
* data in an otherwise "normal" stream (like an XML file).</li>
75-
* <li>v1.5 - Output stream pases on flush() command but doesn't do anything itself.
75+
* <li>v1.5 - Output stream passes on flush() command but doesn't do anything itself.
7676
* This helps when using GZIP streams.
7777
* Added the ability to GZip-compress objects before encoding them.</li>
7878
* <li>v1.4 - Added helper methods to read/write files.</li>

src/main/java/org/owasp/esapi/codecs/HTMLEntityCodec.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public String encodeCharacter( char[] immune, int codePoint ) {
119119
* Returns the decoded version of the character starting at index, or
120120
* null if no decoding is possible.
121121
*
122-
* Formats all are legal both with and without semi-colon, upper/lower case:
122+
* Formats all are legal both with and without semicolon, upper/lower case:
123123
* &#dddd;
124124
* &#xhhhh;
125125
* &name;
@@ -198,7 +198,7 @@ private Integer parseNumber( PushbackSequence<Integer> input ) {
198198
sb.appendCodePoint( c );
199199
input.next();
200200

201-
// if character is a semi-colon, eat it and quit
201+
// if character is a semicolon, eat it and quit
202202
} else if (c == ';' ) {
203203
input.next();
204204
break;
@@ -239,7 +239,7 @@ private Integer parseHex( PushbackSequence<Integer> input ) {
239239
sb.appendCodePoint( c );
240240
input.next();
241241

242-
// if character is a semi-colon, eat it and quit
242+
// if character is a semicolon, eat it and quit
243243
} else if (c == ';' ) {
244244
input.next();
245245
break;
@@ -312,7 +312,7 @@ private Integer getNamedEntity( PushbackSequence<Integer> input ) {
312312
for(int i=0;i<len;i++)
313313
input.next();
314314

315-
// check for a trailing semicolen
315+
// check for a trailing semicolon
316316
if(input.peek(Integer.valueOf(';')))
317317
input.next();
318318

src/main/java/org/owasp/esapi/codecs/HashTrie.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ public HashTrie()
396396
}
397397

398398
/**
399-
* Get the key value entry who's key is the longest prefix match.
399+
* Get the key value entry whose key is the longest prefix match.
400400
* @param key The key to lookup
401401
* @return Entry with the longest matching key.
402402
*/
@@ -408,7 +408,7 @@ public Map.Entry<CharSequence,T> getLongestMatch(CharSequence key)
408408
}
409409

410410
/**
411-
* Get the key value entry who's key is the longest prefix match.
411+
* Get the key value entry whose key is the longest prefix match.
412412
* @param keyIn Pushback reader to read the key from. This should
413413
* have a buffer at least as large as {@link #getMaxKeyLength()}
414414
* or an IOException may be thrown backing up.
@@ -549,7 +549,7 @@ public T get(Object key)
549549

550550
/**
551551
* Get the number of entries.
552-
* @return the number or entries.
552+
* @return the number of entries.
553553
*/
554554
public int size()
555555
{

src/main/java/org/owasp/esapi/codecs/MySQLCodec.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public class MySQLCodec extends AbstractCharacterCodec {
6363
* please see the Manual at
6464
* @link http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html#sqlmode_ansi
6565
*
66-
* Currently the only supported modes are:
66+
* Currently, the only supported modes are:
6767
* ANSI
6868
* STANDARD
6969
*/
@@ -195,7 +195,7 @@ private String encodeCharacterMySQL( Character c ) {
195195
* Returns the decoded version of the character starting at index, or
196196
* null if no decoding is possible.
197197
*
198-
* Formats all are legal (case sensitive)
198+
* Formats all are legal (case-sensitive)
199199
* In ANSI_MODE '' decodes to '
200200
* In MYSQL_MODE \x decodes to x (or a small list of specials)
201201
*/

src/main/java/org/owasp/esapi/codecs/PushBackSequenceImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ public Integer nextOctal() {
6060
}
6161

6262
/**
63-
* Returns true if the parameter character is a hexidecimal digit 0 through 9, a through f, or A through F.
63+
* Returns true if the parameter character is a hexadecimal digit 0 through 9, a through f, or A through F.
6464
* @param c
65-
* @return true if it is a hexidecimal digit, false otherwise.
65+
* @return true if it is a hexadecimal digit, false otherwise.
6666
*/
6767
public static boolean isHexDigit( Integer c ) {
6868
if ( c == null ) return false;

src/main/java/org/owasp/esapi/codecs/PushbackString.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,11 @@ public Character nextOctal() {
124124
}
125125

126126
/**
127-
* Returns true if the parameter character is a hexidecimal digit 0 through
127+
* Returns true if the parameter character is a hexadecimal digit 0 through
128128
* 9, a through f, or A through F.
129129
*
130130
* @param c
131-
* @return true if it is a hexidecimal digit, false otherwise.
131+
* @return true if it is a hexadecimal digit, false otherwise.
132132
*/
133133
public static boolean isHexDigit(Character c) {
134134
if (c == null){

src/main/java/org/owasp/esapi/codecs/ref/EncodingPatternPreservation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public String restoreOriginalContent(String input) {
8989
/**
9090
* Allows the marker used as a replacement to be altered.
9191
*
92-
* @param marker String replacment to use for regex matches.
92+
* @param marker String replacement to use for regex matches.
9393
*/
9494
public void setReplacementMarker(String marker) {
9595
if (!replacedContentList.isEmpty()) {

src/main/java/org/owasp/esapi/configuration/AbstractPrioritizedPropertyLoader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import java.util.Properties;
88

99
/**
10-
* Abstrace class that supports two "levels" of priorities for ESAPI properties.
10+
* Abstract class that supports two "levels" of priorities for ESAPI properties.
1111
* The higher level is the property file supported by an "operations" team and
1212
* the lower level is the property file intended to be supported by the
1313
* "development" team. ESAPI properties defined in the lower level properties
@@ -42,7 +42,7 @@ public AbstractPrioritizedPropertyLoader(String filename, int priority) throws I
4242

4343
/**
4444
* Get priority of this property loader. If two and more loaders can return value for the same property key,
45-
* the one with highest priority will be chosen.
45+
* the one with the highest priority will be chosen.
4646
* @return priority of this property loader
4747
*/
4848
public int priority() {

src/main/java/org/owasp/esapi/configuration/consts/EsapiConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public enum EsapiConfiguration {
1616
String configName;
1717

1818
/**
19-
* Priority of configuration (higher numer - higher priority).
19+
* Priority of configuration (higher number - higher priority).
2020
*/
2121
int priority;
2222

src/main/java/org/owasp/esapi/crypto/CipherText.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ public boolean validateMAC(SecretKey authKey) {
494494
/**
495495
* Return this {@code CipherText} object as a portable (i.e., network byte
496496
* ordered) serialized byte array. Note this is <b>not</b> the same as
497-
* returning a serialized object using Java serialization. Instead this
497+
* returning a serialized object using Java serialization. Instead, this
498498
* is a representation that all ESAPI implementations will use to pass
499499
* ciphertext between different programming language implementations.
500500
*

src/main/java/org/owasp/esapi/crypto/CipherTextSerializer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* and do not have extensive support for the various implementation languages which ESAPI
2727
* supports. (Perhaps wishful thinking that other ESAPI implementations such as
2828
* ESAPI for .NET, ESAPI for C, ESAPI for C++, etc. will all support a single, common
29-
* serialization technique so they could exchange encrypted data.)
29+
* serialization technique, so they could exchange encrypted data.)
3030
*
3131
3232
* @since 2.0
@@ -207,7 +207,7 @@ private byte[] computeSerialization(int kdfInfo, long timestamp,
207207

208208
// All strings are written as UTF-8 encoded byte streams with the
209209
// length prepended before it as a short. The prepended length is
210-
// more for the benefit of languages like C so they can pre-allocate
210+
// more for the benefit of languages like C, so they can pre-allocate
211211
// char arrays without worrying about buffer overflows.
212212
private void writeString(ByteArrayOutputStream baos, String str) {
213213
byte[] bytes;
@@ -405,7 +405,7 @@ private CipherText convertToCipherText(byte[] cipherTextSerializedBytes)
405405
// Fixed in ESAPI crypto version 20130839. Previously is didn't really matter
406406
// because there was only one version (20110203) and it defaulted to that
407407
// version, which was the current version. But we don't want that as now there
408-
// are two versions and we could be decrypting data encrypted using the previous
408+
// are two versions, and we could be decrypting data encrypted using the previous
409409
// version.
410410
ct.setKDF_PRF(kdfPrf);
411411
ct.setKDFVersion(kdfVers);

0 commit comments

Comments
 (0)