Browse Source

Fix typos found by codespell

Dimitri Papadopoulos 9 months ago
parent
commit
6d9c85a762

+ 1 - 1
IDE/SimplicityStudio/user_settings.h

@@ -173,7 +173,7 @@ extern "C" {
             /* use heap allocation for ECC points */
             #define ALT_ECC_SIZE
 
-            /* wolfSSL will compute the FP_MAX_BITS_ECC, but it can be overriden */
+            /* wolfSSL will compute the FP_MAX_BITS_ECC, but it can be overridden */
             //#define FP_MAX_BITS_ECC (256 * 2)
         #endif
 

+ 1 - 1
IDE/apple-universal/README.md

@@ -56,7 +56,7 @@ In order to add the framework to any Xcode project, you can simply drag-and-drop
 # Technical Details
 
 ## Cross compilation
-If you are developing on a macOS machine and want to compile wolfSSL to run on macOS, then you can simply use `configure` without further customisation. However, if you wish to build wolfSSL to run on a different Apple device, then you need to cross-compile wolfSSL. Thankfully, `configure` makes cross compilation relatively straightforward by using the `--host` argument to pass the "[target triple](https://wiki.osdev.org/Target_Triplet)" describing the platform of the system on which you wish the binary to run, as well as a few other options which will are described below. For more details on cross-compilation, please see the [GNU cross-compilation documentation](https://www.gnu.org/software/automake/manual/html_node/Cross_002dCompilation.html) and the [wolfSSL manual page on cross-compiling with configure](https://www.wolfssl.com/documentation/manuals/wolfssl/chapter02.html#building-with-configure-with-cross-compile). Note that `clang` is the default compiler on macOS (symlinked to `/usr/bin/gcc`) and natively supports cross compilation for all Apple devices without requiring you to download a separate compiler. This means you do not need to overide the system `CC`/`AR`/`RANLIB` etc. when using configure.
+If you are developing on a macOS machine and want to compile wolfSSL to run on macOS, then you can simply use `configure` without further customisation. However, if you wish to build wolfSSL to run on a different Apple device, then you need to cross-compile wolfSSL. Thankfully, `configure` makes cross compilation relatively straightforward by using the `--host` argument to pass the "[target triple](https://wiki.osdev.org/Target_Triplet)" describing the platform of the system on which you wish the binary to run, as well as a few other options which will are described below. For more details on cross-compilation, please see the [GNU cross-compilation documentation](https://www.gnu.org/software/automake/manual/html_node/Cross_002dCompilation.html) and the [wolfSSL manual page on cross-compiling with configure](https://www.wolfssl.com/documentation/manuals/wolfssl/chapter02.html#building-with-configure-with-cross-compile). Note that `clang` is the default compiler on macOS (symlinked to `/usr/bin/gcc`) and natively supports cross compilation for all Apple devices without requiring you to download a separate compiler. This means you do not need to override the system `CC`/`AR`/`RANLIB` etc. when using configure.
 
 The generic `configure` invocation required to cross compile a static library for an Apple device is as follows:
 

+ 1 - 1
doc/QUIC.md

@@ -57,7 +57,7 @@ The separation of HTTP/3 and QUIC is natural when you think about the relationsh
 
 The separation of QUIC's "crypto" parts from its other protocol enabling functions is a matter of security. In its experimental beginnings, QUIC had its own security design. With the emerging TLSv1.3 and all it improvements, plus decades of experience, it seemed rather unwise to have something separate in QUIC.
 
-Therefore, the complete TLSv1.3 handshake became part of the QUIC protocol, with some restrictions and simplifications (UDP based QUIC does not accommodate broken TCP middle boxes). With the need for a complete TLSv1.3 stack, QUIC implementors happily make use of existing TLS libraries. 
+Therefore, the complete TLSv1.3 handshake became part of the QUIC protocol, with some restrictions and simplifications (UDP based QUIC does not accommodate broken TCP middle boxes). With the need for a complete TLSv1.3 stack, QUIC implementers happily make use of existing TLS libraries. 
 
 ## wolfSSL API
 

+ 4 - 4
src/internal.c

@@ -6309,7 +6309,7 @@ static void InitSuites_EitherSide(Suites* suites, ProtocolVersion pv, int keySz,
         word16 haveFalconSig, word16 haveDilithiumSig, word16 haveAnon,
         int side)
 {
-    /* make sure server has DH parms, and add PSK if there */
+    /* make sure server has DH params, and add PSK if there */
     if (side == WOLFSSL_SERVER_END) {
         InitSuites(suites, pv, keySz, haveRSA, havePSK, haveDH, haveECDSAsig,
                    haveECC, TRUE, haveStaticECC, haveFalconSig,
@@ -6939,7 +6939,7 @@ int InitHandshakeHashesAndCopy(WOLFSSL* ssl, HS_Hashes* source,
     return ret;
 }
 
-/* called if user attempts to re-use WOLFSSL object for a new session.
+/* called if user attempts to reuse WOLFSSL object for a new session.
  * For example wolfSSL_clear() is called then wolfSSL_connect or accept */
 int ReinitSSL(WOLFSSL* ssl, WOLFSSL_CTX* ctx, int writeDup)
 {
@@ -26430,7 +26430,7 @@ int PickHashSigAlgo(WOLFSSL* ssl, const byte* hashSigAlgo, word32 hashSigAlgoSz)
                 if (hashAlgo < ssl->options.hashAlgo)
                     break;
             #else
-                /* Is hash algorithm stonger than last chosen? */
+                /* Is hash algorithm stronger than last chosen? */
                 if (ret == 0 && hashAlgo > ssl->options.hashAlgo)
                     break;
             #endif
@@ -27252,7 +27252,7 @@ exit_dpk:
  *
  * @param [in] sigAlgo  Signature algorithm.
  * @return  1 when caching required.
- * @return  0 when cacheing not required.
+ * @return  0 when caching not required.
  */
 static int SigAlgoCachesMsgs(int sigAlgo)
 {

+ 7 - 7
src/pk.c

@@ -7955,10 +7955,10 @@ void wolfSSL_DH_get0_pqg(const WOLFSSL_DH *dh, const WOLFSSL_BIGNUM **p,
  * free'd with a call to wolfSSL_DH_free -- not individually.
  *
  * @param [in, out] dh   DH key to set.
- * @parma [in]      p    Prime value to set. May be NULL when value already
+ * @param [in]      p    Prime value to set. May be NULL when value already
  *                       present.
- * @parma [in]      q    Order value to set. May be NULL.
- * @parma [in]      g    Generator value to set. May be NULL when value already
+ * @param [in]      q    Order value to set. May be NULL.
+ * @param [in]      g    Generator value to set. May be NULL when value already
  *                       present.
  * @return  1 on success.
  * @return  0 on failure.
@@ -8258,7 +8258,7 @@ int wolfSSL_DH_check(const WOLFSSL_DH *dh, int *codes)
 /* Generate DH parameters.
  *
  * @param [in] prime_len  Length of prime in bits.
- * @param [in] generator  Gnerator value to use.
+ * @param [in] generator  Generator value to use.
  * @param [in] callback   Called with progress information. Unused.
  * @param [in] cb_arg     User callback argument. Unused.
  * @return  NULL on failure.
@@ -8293,7 +8293,7 @@ WOLFSSL_DH *wolfSSL_DH_generate_parameters(int prime_len, int generator,
  *
  * @param [in] dh         DH key to generate parameters into.
  * @param [in] prime_len  Length of prime in bits.
- * @param [in] generator  Gnerator value to use.
+ * @param [in] generator  Generator value to use.
  * @param [in] callback   Called with progress information. Unused.
  * @param [in] cb_arg     User callback argument. Unused.
  * @return  0 on failure.
@@ -10464,7 +10464,7 @@ int wolfSSL_EC_POINT_set_affine_coordinates_GFp(const WOLFSSL_EC_GROUP* group,
 /* Add two points on the same together.
  *
  * @param [in]  curveIdx  Index of curve in ecc_set.
- * @oaram [out] r         Result point.
+ * @param [out] r         Result point.
  * @param [in]  p1        First point to add.
  * @param [in]  p2        Second point to add.
  * @return  1 on success.
@@ -13446,7 +13446,7 @@ int wolfSSL_i2d_ECDSA_SIG(const WOLFSSL_ECDSA_SIG *sig, unsigned char **pp)
     return (int)len;
 }
 
-/* Get the pointer to the feilds of the ECDSA signature.
+/* Get the pointer to the fields of the ECDSA signature.
  *
  * r and s untouched when sig is NULL.
  *

+ 6 - 6
src/ssl.c

@@ -4481,7 +4481,7 @@ int wolfSSL_shutdown(WOLFSSL* ssl)
     }
 
 #if defined(OPENSSL_EXTRA) || defined(WOLFSSL_WPAS_SMALL)
-    /* reset WOLFSSL structure state for possible re-use */
+    /* reset WOLFSSL structure state for possible reuse */
     if (ret == WOLFSSL_SUCCESS) {
         if (wolfSSL_clear(ssl) != WOLFSSL_SUCCESS) {
             WOLFSSL_MSG("could not clear WOLFSSL");
@@ -12079,7 +12079,7 @@ int wolfSSL_DTLS_SetCookieSecret(WOLFSSL* ssl,
         WOLFSSL_ENTER("wolfSSL_connect");
 
         /* make sure this wolfSSL object has arrays and rng setup. Protects
-         * case where the WOLFSSL object is re-used via wolfSSL_clear() */
+         * case where the WOLFSSL object is reused via wolfSSL_clear() */
         if ((ret = ReinitSSL(ssl, ssl->ctx, 0)) != 0) {
             return ret;
         }
@@ -12567,7 +12567,7 @@ int wolfSSL_DTLS_SetCookieSecret(WOLFSSL* ssl,
         WOLFSSL_ENTER("wolfSSL_accept");
 
         /* make sure this wolfSSL object has arrays and rng setup. Protects
-         * case where the WOLFSSL object is re-used via wolfSSL_clear() */
+         * case where the WOLFSSL object is reused via wolfSSL_clear() */
         if ((ret = ReinitSSL(ssl, ssl->ctx, 0)) != 0) {
             return ret;
         }
@@ -14358,7 +14358,7 @@ int AddSessionToCache(WOLFSSL_CTX* ctx, WOLFSSL_SESSION* addSession,
     cacheSession->peer = NULL;
 #endif
 #ifdef HAVE_SESSION_TICKET
-    /* If we can re-use the existing buffer in cacheSession then we won't touch
+    /* If we can reuse the existing buffer in cacheSession then we won't touch
      * ticBuff at all making it a very cheap malloc/free. The page on a modern
      * OS will most likely not even be allocated to the process. */
     if (ticBuff != NULL && cacheSession->ticketLenAlloc < ticLen) {
@@ -20142,8 +20142,8 @@ static int wolfSSL_DupSessionEx(const WOLFSSL_SESSION* input,
     }
 #if defined(WOLFSSL_TLS13) && defined(WOLFSSL_TICKET_NONCE_MALLOC) &&          \
     (!defined(HAVE_FIPS) || (defined(FIPS_VERSION_GE) && FIPS_VERSION_GE(5,3)))
-        /* free the data, it would be better to re-use the buffer but this
-         * maintain the code simpler. A smart allocator should re-use the free'd
+        /* free the data, it would be better to reuse the buffer but this
+         * maintain the code simpler. A smart allocator should reuse the free'd
          * buffer in the next malloc without much performance penalties. */
     if (output->ticketNonce.data != output->ticketNonce.dataStatic) {
 

+ 8 - 8
src/ssl_certman.c

@@ -188,7 +188,7 @@ void wolfSSL_CertManagerFree(WOLFSSL_CERT_MANAGER* cm)
         #ifdef HAVE_CRL
             /* Dispose of CRL handler. */
             if (cm->crl != NULL) {
-                /* Dispose of CRL object - indicating dynamicly allocated. */
+                /* Dispose of CRL object - indicating dynamically allocated. */
                 FreeCRL(cm->crl, 1);
             }
         #endif
@@ -618,7 +618,7 @@ int CM_VerifyBuffer_ex(WOLFSSL_CERT_MANAGER* cm, const unsigned char* buff,
     if (ret == 0)
 #endif
     {
-        /* Reset fields of decoded certifcate. */
+        /* Reset fields of decoded certificate. */
         XMEMSET(cert, 0, sizeof(DecodedCert));
 
         if (format == WOLFSSL_FILETYPE_PEM) {
@@ -1590,7 +1590,7 @@ int wolfSSL_CertManagerEnableCRL(WOLFSSL_CERT_MANAGER* cm, int options)
                 /* Initialize CRL object. */
                 if (InitCRL(cm->crl, cm) != 0) {
                     WOLFSSL_MSG("Init CRL failed");
-                    /* Dispose of CRL object - indicating dynamicly allocated.
+                    /* Dispose of CRL object - indicating dynamically allocated.
                      */
                     FreeCRL(cm->crl, 1);
                     cm->crl = NULL;
@@ -1707,7 +1707,7 @@ int wolfSSL_CertManagerFreeCRL(WOLFSSL_CERT_MANAGER* cm)
     }
     /* Check whether CRL object exists. */
     if ((ret == WOLFSSL_SUCCESS) && (cm->crl != NULL)) {
-        /* Dispose of CRL object - indicating dynamicly allocated. */
+        /* Dispose of CRL object - indicating dynamically allocated. */
         FreeCRL(cm->crl, 1);
         cm->crl = NULL;
     }
@@ -1943,7 +1943,7 @@ int wolfSSL_CertManagerEnableOCSP(WOLFSSL_CERT_MANAGER* cm, int options)
     }
 #else
     if (ret == WOLFSSL_SUCCESS) {
-        /* Check wheter OCSP object is available. */
+        /* Check whether OCSP object is available. */
         if (cm->ocsp == NULL) {
             /* Allocate memory for OCSP object. */
             cm->ocsp = (WOLFSSL_OCSP*)XMALLOC(sizeof(WOLFSSL_OCSP), cm->heap,
@@ -1957,7 +1957,7 @@ int wolfSSL_CertManagerEnableOCSP(WOLFSSL_CERT_MANAGER* cm, int options)
                 /* Initialize the OCSP object. */
                 if (InitOCSP(cm->ocsp, cm) != 0) {
                     WOLFSSL_MSG("Init OCSP failed");
-                    /* Dispose of OCSP object - indicating dynamicly allocated.
+                    /* Dispose of OCSP object - indicating dynamically allocated.
                      */
                     FreeOCSP(cm->ocsp, 1);
                     cm->ocsp = NULL;
@@ -2048,7 +2048,7 @@ int wolfSSL_CertManagerEnableOCSPStapling(WOLFSSL_CERT_MANAGER* cm)
 #else
 #ifndef NO_WOLFSSL_SERVER
     if (ret == WOLFSSL_SUCCESS) {
-        /* Check wheter OCSP object is available. */
+        /* Check whether OCSP object is available. */
         if (cm->ocsp_stapling == NULL) {
             /* Allocate memory for OCSP stapling object. */
             cm->ocsp_stapling = (WOLFSSL_OCSP*)XMALLOC(sizeof(WOLFSSL_OCSP),
@@ -2062,7 +2062,7 @@ int wolfSSL_CertManagerEnableOCSPStapling(WOLFSSL_CERT_MANAGER* cm)
                 /* Initialize the OCSP stapling object. */
                 if (InitOCSP(cm->ocsp_stapling, cm) != 0) {
                     WOLFSSL_MSG("Init OCSP failed");
-                    /* Dispose of OCSP stapling object - indicating dynamicly
+                    /* Dispose of OCSP stapling object - indicating dynamically
                      * allocated. */
                     FreeOCSP(cm->ocsp_stapling, 1);
                     cm->ocsp_stapling = NULL;

+ 3 - 3
tests/api.c

@@ -7746,7 +7746,7 @@ static int test_wolfSSL_reuse_WOLFSSLobj(void)
 #if defined(OPENSSL_EXTRA) && !defined(NO_SESSION_CACHE) && \
     !defined(WOLFSSL_NO_TLS12)
     /* The unit test for session resumption by re-using WOLFSSL object.
-     * WOLFSSL object is not cleared after first session. It re-use the object
+     * WOLFSSL object is not cleared after first session. It reuse the object
      * for second connection.
     */
     tcp_ready ready;
@@ -51728,7 +51728,7 @@ static int test_wolfssl_EVP_aes_gcm_AAD_2_parts(void)
 
     ExpectIntEQ(XMEMCMP(decryptBuf, cleartext, len), 0);
 
-    /* Test AAD re-use */
+    /* Test AAD reuse */
     EVP_CIPHER_CTX_free(ctx);
 #endif
     return EXPECT_RESULT();
@@ -62888,7 +62888,7 @@ static int test_dtls_ipv6_check(void)
 
     ExpectIntEQ(wolfSSL_dtls_set_peer(ssl_s, &fake_addr6, sizeof(fake_addr6)),
         WOLFSSL_SUCCESS);
-    /* re-use the socket */
+    /* reuse the socket */
     ExpectIntEQ(wolfSSL_set_fd(ssl_c, sockfd), WOLFSSL_SUCCESS);
     wolfSSL_dtls_set_using_nonblock(ssl_s, 1);
     ExpectIntNE(wolfSSL_accept(ssl_s), WOLFSSL_SUCCESS);

+ 1 - 1
testsuite/testsuite.c

@@ -724,7 +724,7 @@ void join_thread(THREAD_TYPE thread)
 /* Create SHA-256 hash of the file based on filename.
  *
  * @param [in]  file   Name of file.
- * @parma [out] check  Buffer to hold SHA-256 hash.
+ * @param [out] check  Buffer to hold SHA-256 hash.
  */
 void file_test(const char* file, byte* check)
 {

+ 1 - 1
wolfcrypt/src/asn.c

@@ -18265,7 +18265,7 @@ static int DecodeAltNames(const byte* input, word32 sz, DecodedCert* cert)
             rid->name[strLen] = '\0';
 
             if (GenerateDNSEntryRIDString(rid, cert->heap) != 0) {
-                WOLFSSL_MSG("\tOut of Memory for registerd Id string");
+                WOLFSSL_MSG("\tOut of Memory for registered Id string");
                 XFREE(rid->name, cert->heap, DYNAMIC_TYPE_ALTNAME);
                 XFREE(rid, cert->heap, DYNAMIC_TYPE_ALTNAME);
                 return MEMORY_E;

+ 1 - 1
wolfcrypt/src/port/nxp/README_SE050.md

@@ -382,7 +382,7 @@ set to the number of bytes written into “out”.
 wolfSSL will not auto-delete generated keys associated with wolfCrypt
 structures (ex: `RsaKey`, `ecc_key`, etc) when the respective key free function
 is called (ex: `wc_ecc_free()`, `wc_FreeRsaKey()`). This is done by design in
-case the application wants to re-use that key that has been generated and
+case the application wants to reuse that key that has been generated and
 stored in the SE050.
 
 Credentials can be deleted from the SE050 storage by calling the wolfSSL helper

+ 1 - 1
wolfcrypt/src/port/silabs/README.md

@@ -17,7 +17,7 @@ To enable support define the following:
 
 ## Simplicity Studio Example
 
-For the Silicon Labs Simplicity Studio exmaple see [/IDE/SimplicityStudio/README.md](/IDE/SimplicityStudio/README.md).
+For the Silicon Labs Simplicity Studio example see [/IDE/SimplicityStudio/README.md](/IDE/SimplicityStudio/README.md).
 
 ## Caveats
 

+ 2 - 2
wolfcrypt/src/port/xilinx/xil-aesgcm.c

@@ -277,7 +277,7 @@ int wc_AesGcmEncrypt(       Aes* aes, byte* out,
 
     if (NEEDS_ALIGNMENT(out, XIL_AESGCM_ALIGN)) {
         if (in != in_aligned) {
-            /* In case `in` has been copied already, re-use that buffer
+            /* In case `in` has been copied already, reuse that buffer
              * and also write to it instead of allocating another one.
              */
             out_aligned = in_aligned;
@@ -392,7 +392,7 @@ int  wc_AesGcmDecrypt(       Aes* aes, byte* out,
 
     if (NEEDS_ALIGNMENT(out, XIL_AESGCM_ALIGN)) {
         if (in != in_aligned) {
-            /* In case `in` has been copied already, re-use that buffer
+            /* In case `in` has been copied already, reuse that buffer
              * and also write to it instead of allocating another one.
              */
             out_aligned = in_aligned;

+ 1 - 1
wolfcrypt/src/wolfevent.c

@@ -205,7 +205,7 @@ int wolfEventQueue_Poll(WOLF_EVENT_QUEUE* queue, void* context_filter,
     }
 #endif
 
-    /* iterrate event queue */
+    /* iterate event queue */
     for (event = queue->head; event != NULL; event = event->next)
     {
         /* optional filter based on context */

+ 1 - 1
wolfssl/internal.h

@@ -5307,7 +5307,7 @@ typedef struct Dtls13Rtx {
 typedef struct CIDInfo CIDInfo;
 #endif /* WOLFSSL_DTLS_CID */
 
-/* The idea is to re-use the context suites object whenever possible to save
+/* The idea is to reuse the context suites object whenever possible to save
  * space. */
 #define WOLFSSL_SUITES(ssl) \
     ((const Suites*) ((ssl)->suites != NULL ? \