From 1567a821a4616f59748fa8982724f88e542867d6 Mon Sep 17 00:00:00 2001 From: FdaSilvaYY Date: Tue, 23 Aug 2022 20:33:58 +0200 Subject: [PATCH] crypto: Fix various typos, repeated words, align some spelling to LDP. partially revamped from #16712 - fall thru -> fall through - time stamp -> timestamp - file name -> filename - host name -> hostname Reviewed-by: Tomas Mraz Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/19059) --- crypto/asn1/a_time.c | 2 +- crypto/bf/bf_local.h | 28 ++++++++++++++-------------- crypto/bio/bio_addr.c | 2 +- crypto/bio/bio_print.c | 4 ++-- crypto/bio/bss_fd.c | 2 +- crypto/bio/bss_file.c | 2 +- crypto/bn/bn_mul.c | 4 ++-- crypto/cast/cast_local.h | 28 ++++++++++++++-------------- crypto/cmp/cmp_ctx.c | 2 +- crypto/cmp/cmp_local.h | 2 +- crypto/cms/cms_asn1.c | 2 +- crypto/des/des_local.h | 28 ++++++++++++++-------------- crypto/ec/ec2_smpl.c | 4 ++-- crypto/ec/ecp_mont.c | 4 ++-- crypto/ec/ecp_smpl.c | 4 ++-- crypto/engine/eng_init.c | 4 ++-- crypto/evp/ctrl_params_translate.c | 2 +- crypto/evp/e_aes.c | 6 +++--- crypto/evp/e_aria.c | 2 +- crypto/o_fopen.c | 2 +- 20 files changed, 67 insertions(+), 67 deletions(-) diff --git a/crypto/asn1/a_time.c b/crypto/asn1/a_time.c index 4459a68156..4f51a6bc4a 100644 --- a/crypto/asn1/a_time.c +++ b/crypto/asn1/a_time.c @@ -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) { diff --git a/crypto/bf/bf_local.h b/crypto/bf/bf_local.h index 080f37a5f9..53c6963e6b 100644 --- a/crypto/bf/bf_local.h +++ b/crypto/bf/bf_local.h @@ -17,19 +17,19 @@ 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; \ } \ } @@ -39,19 +39,19 @@ 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); \ } \ } diff --git a/crypto/bio/bio_addr.c b/crypto/bio/bio_addr.c index 3c09543194..aec94237fc 100644 --- a/crypto/bio/bio_addr.c +++ b/crypto/bio/bio_addr.c @@ -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. * diff --git a/crypto/bio/bio_print.c b/crypto/bio/bio_print.c index f573514f1f..34787a29a7 100644 --- a/crypto/bio/bio_print.c +++ b/crypto/bio/bio_print.c @@ -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); diff --git a/crypto/bio/bss_fd.c b/crypto/bio/bss_fd.c index f756225edb..41514589a5 100644 --- a/crypto/bio/bss_fd.c +++ b/crypto/bio/bss_fd.c @@ -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; diff --git a/crypto/bio/bss_file.c b/crypto/bio/bss_file.c index a6143b6abc..05d87cfe90 100644 --- a/crypto/bio/bss_file.c +++ b/crypto/bio/bss_file.c @@ -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 diff --git a/crypto/bn/bn_mul.c b/crypto/bn/bn_mul.c index dc6b6f5a12..c3864b8c69 100644 --- a/crypto/bn/bn_mul.c +++ b/crypto/bn/bn_mul.c @@ -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) diff --git a/crypto/cast/cast_local.h b/crypto/cast/cast_local.h index 4434a34200..c0ab35562e 100644 --- a/crypto/cast/cast_local.h +++ b/crypto/cast/cast_local.h @@ -62,19 +62,19 @@ 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; \ } \ } @@ -84,19 +84,19 @@ 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); \ } \ } diff --git a/crypto/cmp/cmp_ctx.c b/crypto/cmp/cmp_ctx.c index b1088009f1..4b639c1645 100644 --- a/crypto/cmp/cmp_ctx.c +++ b/crypto/cmp/cmp_ctx.c @@ -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 */ diff --git a/crypto/cmp/cmp_local.h b/crypto/cmp/cmp_local.h index 3718970ff8..f51247077d 100644 --- a/crypto/cmp/cmp_local.h +++ b/crypto/cmp/cmp_local.h @@ -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 */ diff --git a/crypto/cms/cms_asn1.c b/crypto/cms/cms_asn1.c index 785743163c..bc6b2769f9 100644 --- a/crypto/cms/cms_asn1.c +++ b/crypto/cms/cms_asn1.c @@ -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) diff --git a/crypto/des/des_local.h b/crypto/des/des_local.h index 5b02822952..09099a97dc 100644 --- a/crypto/des/des_local.h +++ b/crypto/des/des_local.h @@ -37,19 +37,19 @@ 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)))); \ } \ } @@ -79,19 +79,19 @@ 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); \ } \ } diff --git a/crypto/ec/ec2_smpl.c b/crypto/ec/ec2_smpl.c index d9fee26612..13e702684e 100644 --- a/crypto/ec/ec2_smpl.c +++ b/crypto/ec/ec2_smpl.c @@ -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, diff --git a/crypto/ec/ecp_mont.c b/crypto/ec/ecp_mont.c index 35b492453f..12750b6003 100644 --- a/crypto/ec/ecp_mont.c +++ b/crypto/ec/ecp_mont.c @@ -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, diff --git a/crypto/ec/ecp_smpl.c b/crypto/ec/ecp_smpl.c index b9c675971b..8732fddebf 100644 --- a/crypto/ec/ecp_smpl.c +++ b/crypto/ec/ecp_smpl.c @@ -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.) */ diff --git a/crypto/engine/eng_init.c b/crypto/engine/eng_init.c index d262b16917..a146a39835 100644 --- a/crypto/engine/eng_init.c +++ b/crypto/engine/eng_init.c @@ -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) diff --git a/crypto/evp/ctrl_params_translate.c b/crypto/evp/ctrl_params_translate.c index c6446fb82c..023a130fdc 100644 --- a/crypto/evp/ctrl_params_translate.c +++ b/crypto/evp/ctrl_params_translate.c @@ -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 diff --git a/crypto/evp/e_aes.c b/crypto/evp/e_aes.c index 868c7e5bf7..450ebe8a0d 100644 --- a/crypto/evp/e_aes.c +++ b/crypto/evp/e_aes.c @@ -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 diff --git a/crypto/evp/e_aria.c b/crypto/evp/e_aria.c index e2a421b43d..5a894fbb9b 100644 --- a/crypto/evp/e_aria.c +++ b/crypto/evp/e_aria.c @@ -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; diff --git a/crypto/o_fopen.c b/crypto/o_fopen.c index 24912bb7d8..09c28e0bf7 100644 --- a/crypto/o_fopen.c +++ b/crypto/o_fopen.c @@ -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