From f35ec9771ed95aa373a5c1b6fba6bf780a163037 Mon Sep 17 00:00:00 2001 From: Rafael Fontenelle Date: Sat, 21 Jul 2018 07:24:20 -0300 Subject: [PATCH] Fix typos A bunch of typos reported by codespell, most of them comments in the code --- FAQ | 2 +- docs/doxygen_index.h | 2 +- docs/v2.0.2-ReleaseNotes | 2 +- lib/crypto_backend/argon2/argon2.h | 2 +- lib/crypto_backend/crypto_cipher_kernel.c | 2 +- lib/libcryptsetup.h | 8 ++++---- lib/luks1/af.c | 2 +- lib/luks1/af.h | 2 +- lib/luks2/luks2_keyslot.c | 2 +- lib/utils_device.c | 2 +- lib/utils_device_locking.c | 2 +- man/cryptsetup.8 | 2 +- misc/dict_search/crypt_dict.c | 2 +- src/cryptsetup_reencrypt.c | 2 +- tests/api-test-2.c | 2 +- tests/blockwise-compat | 4 ++-- tests/reencryption-compat-test | 2 +- tests/reencryption-compat-test2 | 2 +- tests/verity-compat-test | 2 +- 19 files changed, 23 insertions(+), 23 deletions(-) diff --git a/FAQ b/FAQ index b296b06a..ce9c6329 100644 --- a/FAQ +++ b/FAQ @@ -128,7 +128,7 @@ A. Contributors recommended to not install Ubuntu on a system with existing LUKS containers without complete backups. - Update 11/2014: There seem to be other problems withe existing LUKS + Update 11/2014: There seem to be other problems with existing LUKS containers and Ubuntu as well, be extra careful when using LUKS on Ubuntu in any way, but exactly as the Ubuntu installer does. diff --git a/docs/doxygen_index.h b/docs/doxygen_index.h index 75c5f097..8bdf05f1 100644 --- a/docs/doxygen_index.h +++ b/docs/doxygen_index.h @@ -40,7 +40,7 @@ * @subsection cformat crypt_format() - header and payload on mutual device * This section covers basic use cases for formatting LUKS devices. Format operation * sets device type in context and in case of LUKS header is written at the beginning - * of block device. In the example bellow we use the scenario where LUKS header and data + * of block device. In the example below we use the scenario where LUKS header and data * are both stored on the same device. There's also a possibility to store header and * data separately. * diff --git a/docs/v2.0.2-ReleaseNotes b/docs/v2.0.2-ReleaseNotes index cf9bd5aa..a85a2489 100644 --- a/docs/v2.0.2-ReleaseNotes +++ b/docs/v2.0.2-ReleaseNotes @@ -30,7 +30,7 @@ Changes since version 2.0.1 * Add LUKS2 specific options for cryptsetup-reencrypt. Tokens and persistent flags are now transferred during reencryption; - change of PBKDF keyslot parameters is now supported and alllows + change of PBKDF keyslot parameters is now supported and allows to set precalculated values (no benchmarks). * Do not allow LUKS2 --persistent and --test-passphrase cryptsetup flags diff --git a/lib/crypto_backend/argon2/argon2.h b/lib/crypto_backend/argon2/argon2.h index 61cea72e..fc8682c2 100644 --- a/lib/crypto_backend/argon2/argon2.h +++ b/lib/crypto_backend/argon2/argon2.h @@ -93,7 +93,7 @@ extern "C" { #define ARGON2_FLAG_CLEAR_SECRET (UINT32_C(1) << 1) /* Global flag to determine if we are wiping internal memory buffers. This flag - * is defined in core.c and deafults to 1 (wipe internal memory). */ + * is defined in core.c and defaults to 1 (wipe internal memory). */ extern int FLAG_clear_internal_memory; /* Error codes */ diff --git a/lib/crypto_backend/crypto_cipher_kernel.c b/lib/crypto_backend/crypto_cipher_kernel.c index 78a90919..57f7a8a7 100644 --- a/lib/crypto_backend/crypto_cipher_kernel.c +++ b/lib/crypto_backend/crypto_cipher_kernel.c @@ -49,7 +49,7 @@ struct crypt_cipher { * * ENOENT - algorithm not available * ENOTSUP - AF_ALG family not available - * (but cannot check specificaly for skcipher API) + * (but cannot check specifically for skcipher API) */ int crypt_cipher_init(struct crypt_cipher **ctx, const char *name, const char *mode, const void *key, size_t key_length) diff --git a/lib/libcryptsetup.h b/lib/libcryptsetup.h index 3f08270e..86671253 100644 --- a/lib/libcryptsetup.h +++ b/lib/libcryptsetup.h @@ -546,8 +546,8 @@ int crypt_format(struct crypt_device *cd, * * @note Currently, only LUKS1->LUKS2 and LUKS2->LUKS1 conversions are supported. * Not all LUKS2 devices may be converted back to LUKS1. To make such a conversion - * posible all active LUKS2 keyslots must be in LUKS1 compatible mode (i.e. pbkdf - * type must be PBKDF2) and device cannot be formated with any authenticated + * possible all active LUKS2 keyslots must be in LUKS1 compatible mode (i.e. pbkdf + * type must be PBKDF2) and device cannot be formatted with any authenticated * encryption mode. * * @note Device must be offline for conversion. UUID change is not possible for active @@ -1886,7 +1886,7 @@ typedef void (*crypt_token_buffer_free_func) (void *buffer, size_t buffer_len); /** * Token handler validate function prototype. - * This fuction validates JSON representation of user defined token for additional data + * This function validates JSON representation of user defined token for additional data * specific for its token type. If defined in the handler, it's called * during @link crypt_activate_by_token @endlink. It may also be called during * @link crypt_token_json_set @endlink when appropriate token handler was registered before @@ -1899,7 +1899,7 @@ typedef int (*crypt_token_validate_func) (struct crypt_device *cd, const char *j /** * Token handler dump function prototype. - * This fuction is supposed to print token implementation specific details. It gets + * This function is supposed to print token implementation specific details. It gets * called during @link crypt_dump @endlink if token handler was registered before. * * @param cd crypt device handle diff --git a/lib/luks1/af.c b/lib/luks1/af.c index fcb335c2..af6c1af3 100644 --- a/lib/luks1/af.c +++ b/lib/luks1/af.c @@ -5,7 +5,7 @@ * Copyright (C) 2009-2018, Red Hat, Inc. All rights reserved. * * AFsplitter diffuses information over a large stripe of data, - * therefor supporting secure data destruction. + * therefore supporting secure data destruction. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/lib/luks1/af.h b/lib/luks1/af.h index 3f981286..2de48e35 100644 --- a/lib/luks1/af.h +++ b/lib/luks1/af.h @@ -5,7 +5,7 @@ * Copyright (C) 2009-2018, Red Hat, Inc. All rights reserved. * * AFsplitter diffuses information over a large stripe of data, - * therefor supporting secure data destruction. + * therefore supporting secure data destruction. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/lib/luks2/luks2_keyslot.c b/lib/luks2/luks2_keyslot.c index acbe6c6c..90060983 100644 --- a/lib/luks2/luks2_keyslot.c +++ b/lib/luks2/luks2_keyslot.c @@ -539,7 +539,7 @@ int placeholder_keyslot_alloc(struct crypt_device *cd, json_object_object_add(jobj_keyslot, "type", json_object_new_string("placeholder")); /* * key_size = -1 makes placeholder keyslot impossible to pass validation. - * It's a safeguard against accidentaly storing temporary conversion + * It's a safeguard against accidentally storing temporary conversion * LUKS2 header. */ json_object_object_add(jobj_keyslot, "key_size", json_object_new_int(-1)); diff --git a/lib/utils_device.c b/lib/utils_device.c index 93310f9e..1f3a1688 100644 --- a/lib/utils_device.c +++ b/lib/utils_device.c @@ -573,7 +573,7 @@ static int device_info(struct crypt_device *cd, } else { /* If the device can be opened read-write, i.e. readonly is still 0, then * check whether BKROGET says that it is read-only. E.g. read-only loop - * devices may be openend read-write but are read-only according to BLKROGET + * devices may be opened read-write but are read-only according to BLKROGET */ if (real_readonly == 0 && (r = ioctl(fd, BLKROGET, &real_readonly)) < 0) goto out; diff --git a/lib/utils_device_locking.c b/lib/utils_device_locking.c index e90d263b..f51cc810 100644 --- a/lib/utils_device_locking.c +++ b/lib/utils_device_locking.c @@ -178,7 +178,7 @@ static void release_lock_handle(struct crypt_lock_handle *h) !flock(h->flock_fd, LOCK_EX | LOCK_NB) && /* lock to drop the file */ !resource_by_devno(res, sizeof(res), h->devno, 1) && /* acquire lock resource name */ !fstat(h->flock_fd, &buf_a) && /* read inode id referred by fd */ - !stat(res, &buf_b) && /* does path file stil exist? */ + !stat(res, &buf_b) && /* does path file still exist? */ same_inode(buf_a, buf_b)) { /* is it same id as the one referenced by fd? */ /* coverity[toctou] */ if (unlink(res)) /* yes? unlink the file */ diff --git a/man/cryptsetup.8 b/man/cryptsetup.8 index 0234c596..d15881a7 100644 --- a/man/cryptsetup.8 +++ b/man/cryptsetup.8 @@ -477,7 +477,7 @@ type from token slot specified by \-\-token\-id option. Action \fIimport\fR can store arbitrary valid token json in LUKS2 header. It may be passed via standard input or via file passed in \-\-json\-file option. If you specify \-\-key\-slot then -successfuly imported token is also assigned to the key slot. +successfully imported token is also assigned to the key slot. Action \fIexport\fR writes requested token json to a file passed with \-\-json\-file or to standard output. diff --git a/misc/dict_search/crypt_dict.c b/misc/dict_search/crypt_dict.c index 68116623..c80d502b 100644 --- a/misc/dict_search/crypt_dict.c +++ b/misc/dict_search/crypt_dict.c @@ -123,7 +123,7 @@ int main(int argc, char *argv[]) /* * Need to create temporary keyslot device-mapper devices and allocate loop if needed, - * so root is requried here. + * so root is required here. */ if (getuid() != 0) { printf("You must be root to run this program.\n"); diff --git a/src/cryptsetup_reencrypt.c b/src/cryptsetup_reencrypt.c index 7a39fc81..0d010007 100644 --- a/src/cryptsetup_reencrypt.c +++ b/src/cryptsetup_reencrypt.c @@ -1552,7 +1552,7 @@ static int run_reencrypt(const char *device) log_dbg("Storing backup of LUKS headers."); if (rc.reencrypt_mode == ENCRYPT) { - /* Create fake header for exising device */ + /* Create fake header for existing device */ if ((r = backup_fake_header(&rc))) goto out; } else { diff --git a/tests/api-test-2.c b/tests/api-test-2.c index 2b93ac20..9514d785 100644 --- a/tests/api-test-2.c +++ b/tests/api-test-2.c @@ -2307,7 +2307,7 @@ static void Pbkdf(void) pbkdf2.flags &= ~CRYPT_PBKDF_NO_BENCHMARK; FAIL_(crypt_set_pbkdf_type(cd, &pbkdf2), "Illegal time value."); - // hash is relevent ony with pbkdf2 + // hash is relevant only with pbkdf2 pbkdf2.time_ms = 9; pbkdf2.hash = NULL; FAIL_(crypt_set_pbkdf_type(cd, &pbkdf2), "Hash is mandatory for pbkdf2"); diff --git a/tests/blockwise-compat b/tests/blockwise-compat index df349194..da94ce87 100755 --- a/tests/blockwise-compat +++ b/tests/blockwise-compat @@ -185,7 +185,7 @@ run_all() { # length = 0 is significant here RUN "P" $1 read_lseek_blockwise 0 $BSIZE $((DEVSIZE+1)) - # begining of device + # beginning of device RUN "P" $1 read_lseek_blockwise 1 $BSIZE 0 RUN "P" $1 read_lseek_blockwise 1 $BSIZE 1 RUN "P" $1 read_lseek_blockwise 1 $BSIZE $((BSIZE-1)) @@ -239,7 +239,7 @@ run_all() { RUN "P" $1 write_lseek_blockwise 0 $BSIZE 1 RUN "P" $1 write_lseek_blockwise 0 $BSIZE $BSIZE - # begining of device + # beginning of device RUN "P" $1 write_lseek_blockwise 1 $BSIZE 0 RUN "P" $1 write_lseek_blockwise 1 $BSIZE 1 RUN "P" $1 write_lseek_blockwise 1 $BSIZE $((BSIZE-1)) diff --git a/tests/reencryption-compat-test b/tests/reencryption-compat-test index 4b667df3..7458f4a2 100755 --- a/tests/reencryption-compat-test +++ b/tests/reencryption-compat-test @@ -130,7 +130,7 @@ function rollback() losetup $LOOPDEV1 $IMG } -function check_slot() #space separeted list of ENABLED key slots +function check_slot() #space separated list of ENABLED key slots { local _KS0=DISABLED local _KS1=$_KS0 _KS2=$_KS0 _KS3=$_KS0 _KS4=$_KS0 _KS5=$_KS0 _KS6=$_KS0 _KS7=$_KS0 diff --git a/tests/reencryption-compat-test2 b/tests/reencryption-compat-test2 index 90719739..beed3201 100755 --- a/tests/reencryption-compat-test2 +++ b/tests/reencryption-compat-test2 @@ -137,7 +137,7 @@ function rollback() cp $ORIG_IMG $IMG } -function check_slot() #space separeted list of active key slots +function check_slot() #space separated list of active key slots { local _out=$($CRYPTSETUP luksDump $IMG | grep -e ": luks2" | sed -e 's/[[:space:]]*\([0-9]\+\):.*/\1/g') diff --git a/tests/verity-compat-test b/tests/verity-compat-test index be6dc0b9..8814c64c 100755 --- a/tests/verity-compat-test +++ b/tests/verity-compat-test @@ -320,7 +320,7 @@ function checkUserSpaceRepair() PARAMS="--data-block-size=$2 --hash-block-size=$2 --fec-roots=$3" [ "$1" -gt 0 ] && PARAMS="$PARAMS --data-blocks=$1" && BS=$2 && COUNT=$1 - # different parameters for diffrent number of devices + # different parameters for different number of devices [ "$6" -eq 1 ] && HASH_DEV=$IMG && FEC=$IMG && PARAMS="$PARAMS --hash-offset=$4 --fec-offset=$5" && echo -n "[One device]" [ "$6" -eq 2 ] && HASH_DEV=$IMG && FEC=$FEC_DEV && PARAMS="$PARAMS --hash-offset=$4" && echo -n "[Two separate data/hash and fec devices]" [ "$6" -eq 3 ] && HASH_DEV=$IMG_HASH && FEC=$FEC_DEV && echo -n "[Three separate devices]"