crypto: Fix various typos, repeated words, align some spelling to LDP.
authorFdaSilvaYY <fdasilvayy@gmail.com>
Tue, 23 Aug 2022 18:33:58 +0000 (20:33 +0200)
committerPauli <pauli@openssl.org>
Wed, 12 Oct 2022 05:55:01 +0000 (16:55 +1100)
partially revamped from #16712
- fall thru -> fall through
- time stamp -> timestamp
- file name -> filename
- host name -> hostname

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19059)

20 files changed:
crypto/asn1/a_time.c
crypto/bf/bf_local.h
crypto/bio/bio_addr.c
crypto/bio/bio_print.c
crypto/bio/bss_fd.c
crypto/bio/bss_file.c
crypto/bn/bn_mul.c
crypto/cast/cast_local.h
crypto/cmp/cmp_ctx.c
crypto/cmp/cmp_local.h
crypto/cms/cms_asn1.c
crypto/des/des_local.h
crypto/ec/ec2_smpl.c
crypto/ec/ecp_mont.c
crypto/ec/ecp_smpl.c
crypto/engine/eng_init.c
crypto/evp/ctrl_params_translate.c
crypto/evp/e_aes.c
crypto/evp/e_aria.c
crypto/o_fopen.c

index 4459a68156ae4907b61deab492fc4dbac7e213e0..4f51a6bc4ab3c9eceec58e51f3d5dd0b00a0cc03 100644 (file)
@@ -92,7 +92,7 @@ int ossl_asn1_time_to_tm(struct tm *tm, const ASN1_TIME *d)
      *
      * 1. "seconds" is a 'MUST'
      * 2. "Zulu" timezone is a 'MUST'
-     * 3. "+|-" is not allowed to indicate a time zone
+     * 3. "+|-" is not allowed to indicate a timezone
      */
     if (d->type == V_ASN1_UTCTIME) {
         if (d->flags & ASN1_STRING_FLAG_X509_TIME) {
index 080f37a5f94cb5821c80f0ba60ac602689140046..53c6963e6b08f1f491bc1fa461b9bd1a24364221 100644 (file)
                         l1=l2=0; \
                         switch (n) { \
                         case 8: l2 =((unsigned long)(*(--(c))))    ; \
-                        /* fall thru */                              \
+                        /* fall through */                              \
                         case 7: l2|=((unsigned long)(*(--(c))))<< 8; \
-                        /* fall thru */                              \
+                        /* fall through */                              \
                         case 6: l2|=((unsigned long)(*(--(c))))<<16; \
-                        /* fall thru */                              \
+                        /* fall through */                              \
                         case 5: l2|=((unsigned long)(*(--(c))))<<24; \
-                        /* fall thru */                              \
+                        /* fall through */                              \
                         case 4: l1 =((unsigned long)(*(--(c))))    ; \
-                        /* fall thru */                              \
+                        /* fall through */                              \
                         case 3: l1|=((unsigned long)(*(--(c))))<< 8; \
-                        /* fall thru */                              \
+                        /* fall through */                              \
                         case 2: l1|=((unsigned long)(*(--(c))))<<16; \
-                        /* fall thru */                              \
+                        /* fall through */                              \
                         case 1: l1|=((unsigned long)(*(--(c))))<<24; \
                                 } \
                         }
                         c+=n; \
                         switch (n) { \
                         case 8: *(--(c))=(unsigned char)(((l2)    )&0xff); \
-                        /* fall thru */                                    \
+                        /* fall through */                                    \
                         case 7: *(--(c))=(unsigned char)(((l2)>> 8)&0xff); \
-                        /* fall thru */                                    \
+                        /* fall through */                                    \
                         case 6: *(--(c))=(unsigned char)(((l2)>>16)&0xff); \
-                        /* fall thru */                                    \
+                        /* fall through */                                    \
                         case 5: *(--(c))=(unsigned char)(((l2)>>24)&0xff); \
-                        /* fall thru */                                    \
+                        /* fall through */                                    \
                         case 4: *(--(c))=(unsigned char)(((l1)    )&0xff); \
-                        /* fall thru */                                    \
+                        /* fall through */                                    \
                         case 3: *(--(c))=(unsigned char)(((l1)>> 8)&0xff); \
-                        /* fall thru */                                    \
+                        /* fall through */                                    \
                         case 2: *(--(c))=(unsigned char)(((l1)>>16)&0xff); \
-                        /* fall thru */                                    \
+                        /* fall through */                                    \
                         case 1: *(--(c))=(unsigned char)(((l1)>>24)&0xff); \
                                 } \
                         }
index 3c095431943b66472a049a92f3b5ecc934ac9125..aec94237fc8c8815b6049895019145341e84600f 100644 (file)
@@ -203,7 +203,7 @@ unsigned short BIO_ADDR_rawport(const BIO_ADDR *ap)
  * @numeric: 0 if actual names should be returned, 1 if the numeric
  * representation should be returned.
  * @hostname: a pointer to a pointer to a memory area to store the
- * host name or numeric representation.  Unused if NULL.
+ * hostname or numeric representation.  Unused if NULL.
  * @service: a pointer to a pointer to a memory area to store the
  * service name or numeric representation.  Unused if NULL.
  *
index f573514f1fcde9adc7dd862fe9a648d342eab645..34787a29a7b7a973099c26a03541e54d0403fd75 100644 (file)
@@ -276,7 +276,7 @@ _dopr(char **sbuffer,
                 break;
             case 'E':
                 flags |= DP_F_UP;
-                /* fall thru */
+                /* fall through */
             case 'e':
                 if (cflags == DP_C_LDOUBLE)
                     fvalue = va_arg(args, LDOUBLE);
@@ -288,7 +288,7 @@ _dopr(char **sbuffer,
                 break;
             case 'G':
                 flags |= DP_F_UP;
-                /* fall thru */
+                /* fall through */
             case 'g':
                 if (cflags == DP_C_LDOUBLE)
                     fvalue = va_arg(args, LDOUBLE);
index f756225edb21c62c8c582e0cb183bb7f09547c26..41514589a5dda1a6d9b6d00066edaaedb13bcae2 100644 (file)
@@ -149,7 +149,7 @@ static long fd_ctrl(BIO *b, int cmd, long num, void *ptr)
     switch (cmd) {
     case BIO_CTRL_RESET:
         num = 0;
-        /* fall thru */
+        /* fall through */
     case BIO_C_FILE_SEEK:
         ret = (long)UP_lseek(b->num, num, 0);
         break;
index a6143b6abcf6648b326299ae09274764e9901617..05d87cfe90faee8a9a191ad97d9fc86d7a5036ea 100644 (file)
@@ -11,7 +11,7 @@
 /*
  * Following definition aliases fopen to fopen64 on above mentioned
  * platforms. This makes it possible to open and sequentially access files
- * larger than 2GB from 32-bit application. It does not allow to traverse
+ * larger than 2GB from 32-bit application. It does not allow one to traverse
  * them beyond 2GB with fseek/ftell, but on the other hand *no* 32-bit
  * platform permits that, not with fseek/ftell. Not to mention that breaking
  * 2GB limit for seeking would require surgery to *our* API. But sequential
index dc6b6f5a1215a2cfaf1eb946bbe7507639f2378f..c3864b8c691ab12b3bedd26dae51f1cc63df3568 100644 (file)
@@ -115,12 +115,12 @@ BN_ULONG bn_sub_part_words(BN_ULONG *r,
                     r[1] = a[1];
                     if (--dl <= 0)
                         break;
-                    /* fall thru */
+                    /* fall through */
                 case 2:
                     r[2] = a[2];
                     if (--dl <= 0)
                         break;
-                    /* fall thru */
+                    /* fall through */
                 case 3:
                     r[3] = a[3];
                     if (--dl <= 0)
index 4434a342002aa987f56ba11047ff97480f9ae0f4..c0ab35562ee51d68bb686096673b035194e5146d 100644 (file)
                         l1=l2=0; \
                         switch (n) { \
                         case 8: l2 =((unsigned long)(*(--(c))))    ; \
-                        /* fall thru */                              \
+                        /* fall through */                              \
                         case 7: l2|=((unsigned long)(*(--(c))))<< 8; \
-                        /* fall thru */                              \
+                        /* fall through */                              \
                         case 6: l2|=((unsigned long)(*(--(c))))<<16; \
-                        /* fall thru */                              \
+                        /* fall through */                              \
                         case 5: l2|=((unsigned long)(*(--(c))))<<24; \
-                        /* fall thru */                              \
+                        /* fall through */                              \
                         case 4: l1 =((unsigned long)(*(--(c))))    ; \
-                        /* fall thru */                              \
+                        /* fall through */                              \
                         case 3: l1|=((unsigned long)(*(--(c))))<< 8; \
-                        /* fall thru */                              \
+                        /* fall through */                              \
                         case 2: l1|=((unsigned long)(*(--(c))))<<16; \
-                        /* fall thru */                              \
+                        /* fall through */                              \
                         case 1: l1|=((unsigned long)(*(--(c))))<<24; \
                                 } \
                         }
                         c+=n; \
                         switch (n) { \
                         case 8: *(--(c))=(unsigned char)(((l2)    )&0xff); \
-                        /* fall thru */                                    \
+                        /* fall through */                                    \
                         case 7: *(--(c))=(unsigned char)(((l2)>> 8)&0xff); \
-                        /* fall thru */                                    \
+                        /* fall through */                                    \
                         case 6: *(--(c))=(unsigned char)(((l2)>>16)&0xff); \
-                        /* fall thru */                                    \
+                        /* fall through */                                    \
                         case 5: *(--(c))=(unsigned char)(((l2)>>24)&0xff); \
-                        /* fall thru */                                    \
+                        /* fall through */                                    \
                         case 4: *(--(c))=(unsigned char)(((l1)    )&0xff); \
-                        /* fall thru */                                    \
+                        /* fall through */                                    \
                         case 3: *(--(c))=(unsigned char)(((l1)>> 8)&0xff); \
-                        /* fall thru */                                    \
+                        /* fall through */                                    \
                         case 2: *(--(c))=(unsigned char)(((l1)>>16)&0xff); \
-                        /* fall thru */                                    \
+                        /* fall through */                                    \
                         case 1: *(--(c))=(unsigned char)(((l1)>>24)&0xff); \
                                 } \
                         }
index b1088009f17295a57544c6bbcbaf64f22dc5e393..4b639c164536880ab58db5a4d5f9eaf214797bce 100644 (file)
@@ -774,7 +774,7 @@ DEFINE_set1_ASN1_OCTET_STRING(OSSL_CMP_CTX, senderNonce)
 /* Set the proxy server to use for HTTP(S) connections */
 DEFINE_OSSL_CMP_CTX_set1(proxy, char)
 
-/* Set the (HTTP) host name of the CMP server */
+/* Set the (HTTP) hostname of the CMP server */
 DEFINE_OSSL_CMP_CTX_set1(server, char)
 
 /* Set the server exclusion list of the HTTP proxy server */
index 3718970ff86b8caa255f27bf9ae91763129cd87d..f51247077d91b614879f46c146a1f41680cd935b 100644 (file)
@@ -78,7 +78,7 @@ struct ossl_cmp_ctx_st {
     X509 *cert; /* protection cert used to identify and sign for MSG_SIG_ALG */
     STACK_OF(X509) *chain; /* (cached) chain of protection cert including it */
     EVP_PKEY *pkey; /* the key pair corresponding to cert */
-    ASN1_OCTET_STRING *referenceValue; /* optional user name for MSG_MAC_ALG */
+    ASN1_OCTET_STRING *referenceValue; /* optional username for MSG_MAC_ALG */
     ASN1_OCTET_STRING *secretValue; /* password/shared secret for MSG_MAC_ALG */
     /* PBMParameters for MSG_MAC_ALG */
     size_t pbm_slen; /* salt length, currently fixed to 16 */
index 785743163cf0a50dcb403827a2159966306d85f2..bc6b2769f98cdff629cc3fef7170778f6f69d74b 100644 (file)
@@ -305,7 +305,7 @@ static int cms_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
     case ASN1_OP_STREAM_PRE:
         if (CMS_stream(&sarg->boundary, cms) <= 0)
             return 0;
-        /* fall thru */
+        /* fall through */
     case ASN1_OP_DETACHED_PRE:
         sarg->ndef_bio = CMS_dataInit(cms, sarg->out);
         if (!sarg->ndef_bio)
index 5b02822952748c60ae7993f671c03b8f5e227eb1..09099a97dcb7aa7b884d72527e2512d65408b8eb 100644 (file)
                         l1=l2=0; \
                         switch (n) { \
                         case 8: l2 =((DES_LONG)(*(--(c))))<<24L; \
-                        /* fall thru */                          \
+                        /* fall through */                          \
                         case 7: l2|=((DES_LONG)(*(--(c))))<<16L; \
-                        /* fall thru */                          \
+                        /* fall through */                          \
                         case 6: l2|=((DES_LONG)(*(--(c))))<< 8L; \
-                        /* fall thru */                          \
+                        /* fall through */                          \
                         case 5: l2|=((DES_LONG)(*(--(c))));      \
-                        /* fall thru */                          \
+                        /* fall through */                          \
                         case 4: l1 =((DES_LONG)(*(--(c))))<<24L; \
-                        /* fall thru */                          \
+                        /* fall through */                          \
                         case 3: l1|=((DES_LONG)(*(--(c))))<<16L; \
-                        /* fall thru */                          \
+                        /* fall through */                          \
                         case 2: l1|=((DES_LONG)(*(--(c))))<< 8L; \
-                        /* fall thru */                          \
+                        /* fall through */                          \
                         case 1: l1|=((DES_LONG)(*(--(c))));      \
                                 } \
                         }
                         c+=n; \
                         switch (n) { \
                         case 8: *(--(c))=(unsigned char)(((l2)>>24L)&0xff); \
-                        /* fall thru */                                     \
+                        /* fall through */                                     \
                         case 7: *(--(c))=(unsigned char)(((l2)>>16L)&0xff); \
-                        /* fall thru */                                     \
+                        /* fall through */                                     \
                         case 6: *(--(c))=(unsigned char)(((l2)>> 8L)&0xff); \
-                        /* fall thru */                                     \
+                        /* fall through */                                     \
                         case 5: *(--(c))=(unsigned char)(((l2)     )&0xff); \
-                        /* fall thru */                                     \
+                        /* fall through */                                     \
                         case 4: *(--(c))=(unsigned char)(((l1)>>24L)&0xff); \
-                        /* fall thru */                                     \
+                        /* fall through */                                     \
                         case 3: *(--(c))=(unsigned char)(((l1)>>16L)&0xff); \
-                        /* fall thru */                                     \
+                        /* fall through */                                     \
                         case 2: *(--(c))=(unsigned char)(((l1)>> 8L)&0xff); \
-                        /* fall thru */                                     \
+                        /* fall through */                                     \
                         case 1: *(--(c))=(unsigned char)(((l1)     )&0xff); \
                                 } \
                         }
index d9fee26612e2b8098216f0e6b023177cfb2892a7..13e702684eab9501998b4e05bf17b481c85a5398 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 /*
- * ECDSA low level APIs are deprecated for public use, but still ok for
+ * ECDSA low-level APIs are deprecated for public use, but still ok for
  * internal use.
  */
 #include "internal/deprecated.h"
@@ -923,7 +923,7 @@ int ec_GF2m_simple_points_mul(const EC_GROUP *group, EC_POINT *r,
 
 /*-
  * Computes the multiplicative inverse of a in GF(2^m), storing the result in r.
- * If a is zero (or equivalent), you'll get a EC_R_CANNOT_INVERT error.
+ * If a is zero (or equivalent), you'll get an EC_R_CANNOT_INVERT error.
  * SCA hardening is with blinding: BN_GF2m_mod_inv does that.
  */
 static int ec_GF2m_simple_field_inv(const EC_GROUP *group, BIGNUM *r,
index 35b492453f57f501e34a6d97ea34643f33f4c47e..12750b6003da0da3babb8dd6b61c23cccdd1321d 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 /*
- * ECDSA low level APIs are deprecated for public use, but still ok for
+ * ECDSA low-level APIs are deprecated for public use, but still ok for
  * internal use.
  */
 #include "internal/deprecated.h"
@@ -217,7 +217,7 @@ int ossl_ec_GFp_mont_field_sqr(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a
 
 /*-
  * Computes the multiplicative inverse of a in GF(p), storing the result in r.
- * If a is zero (or equivalent), you'll get a EC_R_CANNOT_INVERT error.
+ * If a is zero (or equivalent), you'll get an EC_R_CANNOT_INVERT error.
  * We have a Mont structure, so SCA hardening is FLT inversion.
  */
 int ossl_ec_GFp_mont_field_inv(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a,
index b9c675971bd669142588b5a11053e80012362b7f..8732fddebf32afb1f39bc2575ae9a80baf184083 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 /*
- * ECDSA low level APIs are deprecated for public use, but still ok for
+ * ECDSA low-level APIs are deprecated for public use, but still ok for
  * internal use.
  */
 #include "internal/deprecated.h"
@@ -1376,7 +1376,7 @@ int ossl_ec_GFp_simple_field_sqr(const EC_GROUP *group, BIGNUM *r, const BIGNUM
 
 /*-
  * Computes the multiplicative inverse of a in GF(p), storing the result in r.
- * If a is zero (or equivalent), you'll get a EC_R_CANNOT_INVERT error.
+ * If a is zero (or equivalent), you'll get an EC_R_CANNOT_INVERT error.
  * Since we don't have a Mont structure here, SCA hardening is with blinding.
  * NB: "a" must be in _decoded_ form. (i.e. field_decode must precede.)
  */
index d262b16917563f49577a2df64d7b63b81b9108c3..a146a3983565fd6a80f0c66ca6bd6e373971aa08 100644 (file)
@@ -14,7 +14,7 @@
 #include "eng_local.h"
 
 /*
- * Initialise a engine type for use (or up its functional reference count if
+ * Initialise an engine type for use (or up its functional reference count if
  * it's already in use). This version is only used internally.
  */
 int engine_unlocked_init(ENGINE *e)
@@ -41,7 +41,7 @@ int engine_unlocked_init(ENGINE *e)
 }
 
 /*
- * Free a functional reference to a engine type. This version is only used
+ * Free a functional reference to an engine type. This version is only used
  * internally.
  */
 int engine_unlocked_finish(ENGINE *e, int unlock_for_handlers)
index c6446fb82c65decbc949cffef1656b83869d6025..023a130fdc2c7518b78f2b78bd38ec64be5d5b16 100644 (file)
@@ -2483,7 +2483,7 @@ lookup_translation(struct translation_st *tmpl,
             tmpl->ctrl_hexstr = ctrl_hexstr;
         } else if (tmpl->param_key != NULL) {
             /*
-             * Search criteria that originates from a OSSL_PARAM setter or
+             * Search criteria that originates from an OSSL_PARAM setter or
              * getter.
              *
              * Ctrls were fundamentally bidirectional, with only the ctrl
index 868c7e5bf7f83c9fcbb2a904355e1c105160aba8..450ebe8a0d37dd4dcc95e4f387a03eb331cddd90 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 /*
- * This file uses the low level AES functions (which are deprecated for
+ * This file uses the low-level AES functions (which are deprecated for
  * non-internal use) in order to implement the EVP AES ciphers.
  */
 #include "internal/deprecated.h"
@@ -3434,7 +3434,7 @@ static int aes_ccm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
 
     case EVP_CTRL_AEAD_SET_IVLEN:
         arg = 15 - arg;
-        /* fall thru */
+        /* fall through */
     case EVP_CTRL_CCM_SET_L:
         if (arg < 2 || arg > 8)
             return 0;
@@ -4013,7 +4013,7 @@ static int aes_ocb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
 
     if (in != NULL) {
         /*
-         * Need to ensure we are only passing full blocks to low level OCB
+         * Need to ensure we are only passing full blocks to low-level OCB
          * routines. We do it here rather than in EVP_EncryptUpdate/
          * EVP_DecryptUpdate because we need to pass full blocks of AAD too
          * and those routines don't support that
index e2a421b43d00c2e21bf17fe7e6a453235d168cd8..5a894fbb9be2cd8abc9b4abbc4e847c0006748ba 100644 (file)
@@ -589,7 +589,7 @@ static int aria_ccm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
 
     case EVP_CTRL_AEAD_SET_IVLEN:
         arg = 15 - arg;
-        /* fall thru */
+        /* fall through */
     case EVP_CTRL_CCM_SET_L:
         if (arg < 2 || arg > 8)
             return 0;
index 24912bb7d897f0f6e7d1e93444ddf6f80bbf1583..09c28e0bf7574a8c821803a7f83be098a645ba9e 100644 (file)
@@ -11,7 +11,7 @@
 /*
  * Following definition aliases fopen to fopen64 on above mentioned
  * platforms. This makes it possible to open and sequentially access files
- * larger than 2GB from 32-bit application. It does not allow to traverse
+ * larger than 2GB from 32-bit application. It does not allow one to traverse
  * them beyond 2GB with fseek/ftell, but on the other hand *no* 32-bit
  * platform permits that, not with fseek/ftell. Not to mention that breaking
  * 2GB limit for seeking would require surgery to *our* API. But sequential