Skip to content

Commit

Permalink
Fix typos in codebase and documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
ni4 committed Sep 18, 2024
1 parent 112fcf4 commit e70225b
Show file tree
Hide file tree
Showing 22 changed files with 45 additions and 45 deletions.
6 changes: 3 additions & 3 deletions ci-legacy/lib/install_functions.inc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ linux_prepare_ribose_yum_repo() {

# Prepare the system by updating and optionally installing repos
yum_prepare_repos() {
yum_install "${util_depedencies_yum[@]}"
yum_install "${util_dependencies_yum[@]}"
linux_prepare_ribose_yum_repo
"${SUDO}" "${YUM}" -y update
if [[ $# -gt 0 ]]; then
Expand Down Expand Up @@ -141,7 +141,7 @@ linux_install_centos() {
esac
}

declare util_depedencies_yum=(
declare util_dependencies_yum=(
sudo
wget
git
Expand Down Expand Up @@ -421,7 +421,7 @@ build_and_install_python() {

# Make sure automake is at least $MINIMUM_AUTOMAKE_VERSION (1.16.3) as required by GnuPG 2.3
# - We assume that on fedora/centos ribose rpm was used (see basic_build_dependencies_yum)
# - If automake version is less then reuired automake build it from source
# - If automake version is less then required automake build it from source
ensure_automake() {

local using_ribose_automake=
Expand Down
2 changes: 1 addition & 1 deletion ci/build_tarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ cmake -B "${RNP_BLD}" -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF "${RNP_PATH}"
cpack -B "${RNP_BLD}" -G TGZ --config "${RNP_BLD}/CPackSourceConfig.cmake"

# Check whether tarball builds
# cpack would use symantic versioning for file names, i.e. rnp-v0.17.1
# cpack would use semantic versioning for file names, i.e. rnp-v0.17.1
RNP_TGZ=$(find "${RNP_BLD}" -maxdepth 1 -type f -name '*.tar.gz' | head -n 1)
RNP_CHK="/opt/rnp-check"
rm -rf "${RNP_CHK}"
Expand Down
2 changes: 1 addition & 1 deletion cmake/CTestCostData.txt
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ rnp_tests.rnpkeys_generatekey_verifykeyHomeDirNoPermission 1 0.156128
rnp_tests.rnpkeys_generatekey_testExpertMode 1 3.81493
rnp_tests.generatekeyECDSA_explicitlySetSmallOutputDigest_DigestAlgAdjusted 1 0.0674681
rnp_tests.generatekey_multipleUserIds_ShouldFail 1 0.0532007
rnp_tests.generatekeyECDSA_explicitlySetBiggerThanNeededDigest_ShouldSuceed 1 0.0640942
rnp_tests.generatekeyECDSA_explicitlySetBiggerThanNeededDigest_ShouldSucceed 1 0.0640942
rnp_tests.generatekeyECDSA_explicitlySetUnknownDigest_ShouldFail 1 0.0544535
rnp_tests.test_generated_key_sigs 1 0.18236
rnp_tests.test_kbx_nsigs 1 1.03666
Expand Down
4 changes: 2 additions & 2 deletions cmake/rnp_tests_discover.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function(add_command NAME)
endfunction()

if(NOT EXISTS "${TEST_EXECUTABLE}")
message(FATAL_ERROR "Executable does not exist: ${TEST_EXECUTABE}")
message(FATAL_ERROR "Executable does not exist: ${TEST_EXECUTABLE}")
endif()
execute_process(
COMMAND "${TEST_EXECUTABLE}" list-tests
Expand All @@ -18,7 +18,7 @@ execute_process(
RESULT_VARIABLE result
)
if(NOT ${result} EQUAL 0)
message(FATAL_ERROR "Error running executable: ${TEST_EXECUTABE}")
message(FATAL_ERROR "Error running executable: ${TEST_EXECUTABLE}")
endif()

string(REPLACE "\n" ";" output "${output}")
Expand Down
2 changes: 1 addition & 1 deletion docs/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ CREATE_SUBDIRS = NO
# level increment doubles the number of directories, resulting in 4096
# directories at level 8 which is the default and also the maximum value. The
# sub-directories are organized in 2 levels, the first level always has a fixed
# numer of 16 directories.
# number of 16 directories.
# Minimum value: 0, maximum value: 8, default value: 8.
# This tag requires that the tag CREATE_SUBDIRS is set to YES.

Expand Down
4 changes: 2 additions & 2 deletions docs/installation.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ make && make install

=== Using Microsoft Visual Studio 2019 and vcpkg

Use appropriate command propmpt for your target platform, for example "x64 Native Tools Command Prompt for VS 2019"
Use appropriate command prompt for your target platform, for example "x64 Native Tools Command Prompt for VS 2019"
```
cmd /k "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
```
Expand Down Expand Up @@ -225,7 +225,7 @@ Ensure that the following dependencies are available on path:

=== Using Microsoft Visual Studio 2019 and pre-installed libraries

Use appropriate command propmpt for your target platform, for example "x64 Native Tools Command Prompt for VS 2019"
Use appropriate command prompt for your target platform, for example "x64 Native Tools Command Prompt for VS 2019"
```
cmd /k "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
```
Expand Down
10 changes: 5 additions & 5 deletions include/rekey/rnp_key_store.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,13 @@ class KeyStore {

/**
* @brief Add signature of the specific key to the keystore, revalidating and refresing
* key's data. Currently supports only direct-key or subkey binding signature.
* key's data. Currently supports only direct-key or subkey binding signature.
*
* @param keyfp key's fingerprint.
* @param sig signature packet.
* @param front set to true if signature should be added to the beggining of the signature
* list.
* @return pgp_subsig_t*
* @param front set to true if signature should be added to the beginning of the signature
* list.
* @return pointer to the newly added signature or NULL if failed.
*/
pgp_subsig_t *add_key_sig(const pgp_fingerprint_t &keyfp,
const pgp_signature_t & sig,
Expand Down Expand Up @@ -238,7 +238,7 @@ class KeyStore {
*
* @param key key to remove. Must be from this keystore.
* @param subkeys remove subkeys or not.
* @return true if key was succesfully removed, or false if key was not found in keystore.
* @return true if key was successfully removed, or false if key was not found in keystore.
*/
bool remove_key(const pgp_key_t &key, bool subkeys = false);

Expand Down
16 changes: 8 additions & 8 deletions include/rnp/rnp.h
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,7 @@ RNP_API rnp_result_t rnp_generate_key_ex(rnp_ffi_t ffi,
* @param op pointer to opaque key generation context.
* @param ffi
* @param alg key algorithm as string. Must be able to sign. Currently the following algorithms
* are supported (case-insensetive) : 'rsa', 'dsa', 'ecdsa', 'eddsa', 'sm2'.
* are supported (case-insensitive) : 'rsa', 'dsa', 'ecdsa', 'eddsa', 'sm2'.
* @return RNP_SUCCESS or error code if failed.
*/
RNP_API rnp_result_t rnp_op_generate_create(rnp_op_generate_t *op,
Expand All @@ -976,7 +976,7 @@ RNP_API rnp_result_t rnp_op_generate_create(rnp_op_generate_t *op,
* @param ffi
* @param primary primary key handle, must have secret part.
* @param alg key algorithm as string. Currently the following algorithms are supported
* (case-insensetive) : 'rsa', 'dsa', 'elgamal', 'ecdsa', 'eddsa', 'ecdh', 'sm2'.
* (case-insensitive) : 'rsa', 'dsa', 'elgamal', 'ecdsa', 'eddsa', 'ecdh', 'sm2'.
* @return RNP_SUCCESS or error code if failed.
*/
RNP_API rnp_result_t rnp_op_generate_subkey_create(rnp_op_generate_t *op,
Expand Down Expand Up @@ -1190,7 +1190,7 @@ RNP_API rnp_result_t rnp_op_generate_set_pref_keyserver(rnp_op_generate_t op,

#if defined(RNP_EXPERIMENTAL_CRYPTO_REFRESH)
/** Set the generated key version to v6.
* NOTE: This is an experimantal feature and this function can be replaced (or removed) at any
* NOTE: This is an experimental feature and this function can be replaced (or removed) at any
* time.
*
* @param op pointer to opaque key generation context.
Expand All @@ -1201,7 +1201,7 @@ RNP_API rnp_result_t rnp_op_generate_set_v6_key(rnp_op_generate_t op);

#if defined(RNP_EXPERIMENTAL_PQC)
/** Set the SPHINCS+ parameter set
* NOTE: This is an experimantal feature and this function can be replaced (or removed) at any
* NOTE: This is an experimental feature and this function can be replaced (or removed) at any
* time.
*
* @param op pointer to opaque key generation context.
Expand Down Expand Up @@ -1686,7 +1686,7 @@ RNP_API rnp_result_t rnp_uid_get_signature_at(rnp_uid_handle_t uid,
* - 'certification revocation' : certification revocation signature
* - 'timestamp' : timestamp signature
* - 'third-party' : third party confirmation signature
* - 'uknown: 0..255' : unknown signature with its type specified as number
* - 'unknown: 0..255' : unknown signature with its type specified as number
*
* @return RNP_SUCCESS or error code if failed.
*/
Expand Down Expand Up @@ -2685,7 +2685,7 @@ RNP_API rnp_result_t rnp_op_verify_set_flags(rnp_op_verify_t op, uint32_t flags)
* @return RNP_SUCCESS if data was processed successfully and output may be used. By default
* this means at least one valid signature for the signed data, or successfully
* decrypted data if no signatures are present.
* This behaviour may be overriden via rnp_op_verify_set_flags() call.
* This behaviour may be overridden via rnp_op_verify_set_flags() call.
*
* To check number of signatures and their verification status use functions
* rnp_op_verify_get_signature_count() and rnp_op_verify_get_signature_at().
Expand Down Expand Up @@ -3327,7 +3327,7 @@ RNP_API rnp_result_t rnp_op_encrypt_set_compression(rnp_op_encrypt_t op,
* RNP_ENCRYPT_NOWRAP - do not wrap the data in a literal data packet. This
* would allow to encrypt already signed data.
*
* @return RNP_SUCESS or error code if failed.
* @return RNP_SUCCESS or error code if failed.
*/
RNP_API rnp_result_t rnp_op_encrypt_set_flags(rnp_op_encrypt_t op, uint32_t flags);

Expand Down Expand Up @@ -3462,7 +3462,7 @@ RNP_API rnp_result_t rnp_get_secret_key_data(rnp_key_handle_t handle,
* The format of the "mpis" object in the "signatures", "public key" and
* "secret key" members may vary and depends on the key algorithm.
* But generally they contain hexadecimal strings representing
* MPI-s (multi-presicion integers) of the key or signature.\n
* MPI-s (multi-precision integers) of the key or signature.\n
* "mpis" objects are present if the flags argument contains
* RNP_JSON_SIGNATURE_MPIS,RNP_JSON_PUBLIC_MPIS and RNP_JSON_SECRET_MPIS
* flag respectively.\n
Expand Down
2 changes: 1 addition & 1 deletion src/lib/crypto/elgamal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ elgamal_encrypt_pkcs1(rnp::RNG * rng,
/*
* Botan's ElGamal formats the g^k and msg*(y^k) together into a single byte string.
* We have to parse out the two values after encryption, as rnp stores those values
* separatelly.
* separately.
*
* We don't trim zeros from octet string as it is done before final marshalling
* (add_packet_body_mpi)
Expand Down
4 changes: 2 additions & 2 deletions src/lib/rnp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ try {
}
}

// set pathes
// set paths
*pub_path = strdup(pub.c_str());
*sec_path = strdup(sec.c_str());

Expand Down Expand Up @@ -4746,7 +4746,7 @@ gen_json_primary_key(rnp_ffi_t ffi,
rnp_keygen_primary_desc_t desc = {};
// desc.crypto is a union
// so at least Clang 12 on Windows zero-initializes the first union member only
// keeping the "larger" member partially unintialized
// keeping the "larger" member partially uninitialized
desc.crypto.dsa.q_bitlen = 0;

desc.cert.key_expiration = DEFAULT_KEY_EXPIRATION;
Expand Down
4 changes: 2 additions & 2 deletions src/librekey/key_store_g10.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ lookup_var(const sexp_list_t *list, const std::string &name) noexcept
// We are looking for a list element (condition 1)
// that:
// -- has at least two SEXP elements (condition 2)
// -- has a SEXP string at 0 postion (condition 3)
// -- has a SEXP string at 0 position (condition 3)
// matching given name (condition 4)
auto match = [name](const std::shared_ptr<sexp_object_t> &ptr) {
bool r = false;
Expand Down Expand Up @@ -515,7 +515,7 @@ decrypt_protected_section(const sexp_simple_string_t &encrypted_data,
// find the protection format in our table
info = find_format(prot.symm_alg, prot.cipher_mode, prot.s2k.hash_alg);
if (!info) {
RNP_LOG("Unsupported format, alg: %d, chiper_mode: %d, hash: %d",
RNP_LOG("Unsupported format, alg: %d, cipher_mode: %d, hash: %d",
prot.symm_alg,
prot.cipher_mode,
prot.s2k.hash_alg);
Expand Down
2 changes: 1 addition & 1 deletion src/librepgp/stream-parse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ typedef struct pgp_source_signed_param_t {
pgp_literal_hdr_t lhdr{};
bool has_lhdr = false;

std::vector<pgp_one_pass_sig_t> onepasses; /* list of one-pass singatures */
std::vector<pgp_one_pass_sig_t> onepasses; /* list of one-pass signatures */
std::list<pgp_signature_t> sigs; /* list of signatures */
std::vector<pgp_signature_info_t> siginfos; /* signature validation info */
rnp::HashList hashes; /* hash contexts */
Expand Down
2 changes: 1 addition & 1 deletion src/librepgp/stream-parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ typedef struct pgp_parse_handler_t {
pgp_password_provider_t *password_provider; /* if NULL then default will be used */
rnp::KeyProvider * key_provider; /* must be set when key is required, i.e. during
signing/verification/public key encryption and
deryption */
decryption */
pgp_destination_func_t *dest_provider; /* called when destination stream is required */
pgp_source_func_t * src_provider; /* required to provider source during the detached
signature verification */
Expand Down
2 changes: 1 addition & 1 deletion src/librepgp/stream-sig.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ typedef struct pgp_signature_t {
std::string signer_uid() const;

/**
* @brief Set the signer's uid, responcible for the signature creation. See the RFC
* @brief Set the signer's uid, responsible for the signature creation. See the RFC
* 4880bis, 5.2.3.23 for details.
*/
void set_signer_uid(const std::string &uid);
Expand Down
2 changes: 1 addition & 1 deletion src/librepgp/stream-write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ init_encrypted_dst(pgp_write_handler_t *handler, pgp_dest_t *dst, pgp_dest_t *wr
skeycount = handler->ctx->passwords.size();

#if defined(ENABLE_CRYPTO_REFRESH)
/* in the case of PKESK (pkeycount > 0) and all keys are PKESKv6/SEIPDv2 capable, ugprade
/* in the case of PKESK (pkeycount > 0) and all keys are PKESKv6/SEIPDv2 capable, upgrade
* to AEADv2 */
if (handler->ctx->enable_pkesk_v6 && handler->ctx->pkeskv6_capable() && pkeycount > 0) {
param->auth_type = rnp::AuthType::AEADv2;
Expand Down
2 changes: 1 addition & 1 deletion src/librepgp/stream-write.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ typedef struct pgp_write_handler_t {
**/
rnp_result_t rnp_sign_src(pgp_write_handler_t *handler, pgp_source_t *src, pgp_dest_t *dst);

/** @brief encrypt and sign the input data. Signatures will be enrypted together with data.
/** @brief encrypt and sign the input data. Signatures will be encrypted together with data.
* @param handler handler handler to respond on stream processor callbacks, and additional
* processing parameters, including rnp_ctx_t
* @param src input source: file, stdin, memory, whatever else conforming to pgp_source_t
Expand Down
2 changes: 1 addition & 1 deletion src/rnp/rnpcfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
#define CFG_EXPERT "expert" /* expert key generation mode */
#define CFG_ZLEVEL "zlevel" /* compression level: 0..9 (0 for no compression) */
#define CFG_ZALG "zalg" /* compression algorithm: zip, zlib or bzip2 */
#define CFG_AEAD "aead" /* if nonzero then AEAD enryption mode, int */
#define CFG_AEAD "aead" /* if nonzero then AEAD encryption mode, int */
#define CFG_AEAD_CHUNK "aead_chunk" /* AEAD chunk size bits, int from 0 to 56 */
#define CFG_KEYSTORE_DISABLED \
"disable_keystore" /* indicates whether keystore must be initialized */
Expand Down
2 changes: 1 addition & 1 deletion src/tests/cli_perf.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def large_file_armored_decryption(self):
action="store_true")
args = parser.parse_args()

# get list of benchamrks to run
# get list of benchmarks to run
bench_methods = [ x[0] for x in inspect.getmembers(Benchmark,
predicate=lambda x: inspect.ismethod(x) or inspect.isfunction(x))]
print(bench_methods)
Expand Down
6 changes: 3 additions & 3 deletions src/tests/cli_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1556,7 +1556,7 @@ def test_export_keys(self):
# Re-import it, making sure file was correctly overwritten
ret, _, _ = run_proc(RNPK, ['--homedir', RNPDIR, '--import', kpub])
self.assertEqual(ret, 0)
# Enter 'y' in ovewrite prompt
# Enter 'y' in overwrite prompt
with open(kpub, 'w+') as f:
f.truncate(10)
ret, out, err = run_proc(RNPK, ['--homedir', RNPDIR, '--export-key', 'alice', '--output', kpub, '--notty'], 'y\n')
Expand Down Expand Up @@ -3682,7 +3682,7 @@ def test_ext_adding_stripping(self):
ret, _, _ = run_proc(RNP, ['--homedir', RNPDIR, '--enarmor=msg', src])
self.assertEqual(ret, 0)
self.assertTrue(os.path.isfile(asc))
# Dearmor asc - must be outputed to src
# Dearmor asc - must be outputted to src
os.remove(src)
ret, _, _ = run_proc(RNP, ['--homedir', RNPDIR, '--dearmor', asc])
self.assertEqual(ret, 0)
Expand Down Expand Up @@ -4156,7 +4156,7 @@ class Encryption(unittest.TestCase):
to wait until everything else gets
tested before your failing BLOWFISH
'''
# Ciphers list tro try during encryption. None will use default
# Ciphers list to try during encryption. None will use default
CIPHERS = [None]
SIZES = [20, 40, 120, 600, 1000, 5000, 20000, 250000]
# Compression parameters to try during encryption(s)
Expand Down
2 changes: 1 addition & 1 deletion src/tests/ffi-key-prop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ TEST_F(rnp_tests, test_ffi_key_set_expiry)
assert_false(sub->pub->valid());
assert_false(sub->sec->valid());
creation = 0;
uint32_t validity = 2 * 30 * 24 * 60 * 60; // 2 monthes
uint32_t validity = 2 * 30 * 24 * 60 * 60; // 2 months
assert_rnp_success(rnp_key_get_creation(key, &creation));
uint32_t keytill = creation + validity;
creation = time(NULL) - creation;
Expand Down
10 changes: 5 additions & 5 deletions src/tests/ffi-key.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@

static void
check_key_properties(rnp_key_handle_t key,
bool primary_exptected,
bool primary_expected,
bool have_public_expected,
bool have_secret_expected)
{
bool isprimary = !primary_exptected;
bool isprimary = !primary_expected;
assert_rnp_success(rnp_key_is_primary(key, &isprimary));
assert_true(isprimary == primary_exptected);
bool issub = primary_exptected;
assert_true(isprimary == primary_expected);
bool issub = primary_expected;
assert_rnp_success(rnp_key_is_sub(key, &issub));
assert_true(issub == !primary_exptected);
assert_true(issub == !primary_expected);
bool have_public = !have_public_expected;
assert_rnp_success(rnp_key_have_public(key, &have_public));
assert_true(have_public == have_public_expected);
Expand Down
2 changes: 1 addition & 1 deletion src/tests/generatekey.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ TEST_F(rnp_tests, generatekey_multipleUserIds_ShouldFail)
rnp.end();
}

TEST_F(rnp_tests, generatekeyECDSA_explicitlySetBiggerThanNeededDigest_ShouldSuceed)
TEST_F(rnp_tests, generatekeyECDSA_explicitlySetBiggerThanNeededDigest_ShouldSucceed)
{
cli_rnp_t rnp;
rnp_cfg ops;
Expand Down

0 comments on commit e70225b

Please sign in to comment.