Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Codespell fixes #3710

Merged
merged 9 commits into from
Oct 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish-crates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
description: Exclude Specific Crates From Being Published
required: false
release_branch:
description: Release Branch Where Recent Bump Occured
description: Release Branch Where Recent Bump Occurred
required: true
ockam_publish_recent_failure:
description: Indicate A Recent Failure
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
description: Git Tag To Release From. Last Git Tag Is Used If Omitted
required: false
release_branch:
description: Release Branch Where Recent Bump Occured
description: Release Branch Where Recent Bump Occurred
required: true

permissions:
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
# the corresponding hash mentioned in sha256sums.txt
cat sha256sums.txt | grep ockam.x86_64-unknown-linux-gnu | sha256sum -c

# rename the download binary and give it permission to execure
# rename the download binary and give it permission to execute
mv ockam.x86_64-unknown-linux-gnu ockam
chmod u+x ockam
\`\`\`"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ Credential contains identity of the sender, a set of attributes this sender is a
### Credential based attribute acceptance implementation

To accept attributes from a credential, the accepting endpoint will need to trust a credential authority and be able to verify credential signature.
This is implemented by posessing the credential authority identity, which contains the public key used to sign credentials.
This is implemented by possessing the credential authority identity, which contains the public key used to sign credentials.

The attribute acceptance works as following:

- Receive a credential from an identity
- Verify credential signature and identity using credential verifier service
- Receive attribute set from the verifier service
- Save attribute set to local cache assiciated with the sender identity
- Save attribute set to local cache associated with the sender identity


### Attribute sets and expiration

Posession of attributes by certain identity may change over time, this means we need to remove attributes from the attribute storage for this identity at some point.
Possession of attributes by certain identity may change over time, this means we need to remove attributes from the attribute storage for this identity at some point.
This can be done by having attribute expiration time and removing the attributes once they expired.

Expiration time is controlled by the credential authority and communicated in a credential.
Expand All @@ -47,7 +47,7 @@ A group of attributes presented in a credential with their expiry is called attr

**Current implementation of attribute storage allows to store one attribute set per identity.**

**If the same identity presents a new credential - old attribute set is overriden by a new one.**
**If the same identity presents a new credential - old attribute set is overridden by a new one.**


### Credential exchange
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ The public API of Rust's standard library is split into 3 parts.
- If no `#[global_allocator]` is configured, then `libstd` will provide one based on the OS's default allocator.
- In the rare cases where `libstd` supports a target without a system-provided allocator, `libstd` will provide a default written in Rust (currently, it uses a Rust [port of `dlmalloc`](https://crates.io/crates/dlmalloc) for these situations).

As you may note, these are analagous to the three configurations we wish to support, but there is an important difference:
As you may note, these are analogous to the three configurations we wish to support, but there is an important difference:

We should do not adopt the restriction that `libcore` and `liballoc` has around target-specific checks and `cfg`s and such. We favor practicality over purity, and without this, we would be completely unable to provide useful functionality for embedded environments.

Expand Down
2 changes: 1 addition & 1 deletion documentation/architecture/workers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl Worker for MyWorker {
type Context = Context;
type Message = MyMessage;

fn intialize(&mut self, ctx: &mut Context) -> Result<()> {
fn initialize(&mut self, ctx: &mut Context) -> Result<()> {
println!("Starting worker {}", ctx.address())
Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion documentation/use-cases/run-ockam-on-riscv/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ building Rust executables for RISC-V is the presence of a RISC-V linker, such as
- For Debian: `apt-get install gcc-riscv64-linux-gnu`
- For MacOS: `brew tap riscv/riscv && brew install --cc=gcc-10 riscv-tools`

In your `ockam_rv` project, create a `.cargo/config.toml` file. In this file, we specify that we're builing for RISC-V
In your `ockam_rv` project, create a `.cargo/config.toml` file. In this file, we specify that we're building for RISC-V
and also configure the location of the linker.


Expand Down
2 changes: 1 addition & 1 deletion examples/elixir/get_started/hop.exs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defmodule Hop do
def handle_message(message, %{address: address} = state) do
IO.puts("Address: #{address}\t Received: #{inspect(message)}")

## Forward mesage to the next address and trace current address
## Forward message to the next address and trace current address
## in return route.
forwarded_message = Message.forward(message) |> Message.trace(address)

Expand Down
4 changes: 2 additions & 2 deletions implementations/c/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

# Set the minimum required CMake version to 3.1...3.18
#
# * We require atleast CMake 3.1 (which added the target_sources command)
# * has been tested for versions upto 3.18
# * We require at least CMake 3.1 (which added the target_sources command)
# * has been tested for versions up to 3.18
#
# The FATAL_ERROR option is accepted, but ignored, by CMake 2.6 and higher.
# It's specified so CMake versions 2.4 and lower fail with an error instead of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# your cmake- (or more generically externally-) built artifacts.
#
# If you desire to use IAR EW as native IDE, you'll need to create EW project and then manually add
# every file using the IDE GUI. To maintain folder structure, use "add group" to mimick/replicate the folder
# every file using the IDE GUI. To maintain folder structure, use "add group" to mimic/replicate the folder
# hierarchy. The project config/structure is eventually saved into XML files. So presumably, you could
# also create by hand (or write a script to generate) the XML files.
#
Expand Down
2 changes: 1 addition & 1 deletion implementations/c/ockam/random/impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ typedef struct {
ockam_error_t (*deinit)(ockam_random_t* random);

/**
* @brief Retrive a specified number of random bytes from the random implementation.
* @brief Retrieve a specified number of random bytes from the random implementation.
* @param random[in] The ockam random object to use.
* @param buffer[out] Buffer to fill with random bytes.
* @param buffer_size[in] Buffer size (in bytes).
Expand Down
8 changes: 4 additions & 4 deletions implementations/c/ockam/vault/atecc508a/atecc508a.c
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ OckamError Atecc508aHkdfWriteKey(const OckamMemory *p_memory, uint8_t *p_key, si
p_buf += ATECC508A_SLOT_WRITE_SIZE_MAX;
}

if (status != ATCA_SUCCESS) { /* Ensure the 32 byte writes were sucessful before */
if (status != ATCA_SUCCESS) { /* Ensure the 32 byte writes were successful before */
ret_val = kOckamError; /* attempting the 4 byte writes */
goto exit_block;
}
Expand All @@ -606,15 +606,15 @@ OckamError Atecc508aHkdfWriteKey(const OckamMemory *p_memory, uint8_t *p_key, si
}

slot_offset++; /* Adjust the offset and buffer pointer AFTER data */
p_buf += ATECC508A_SLOT_WRITE_SIZE_MIN; /* has been sucessfully written to the ATECC508A */
p_buf += ATECC508A_SLOT_WRITE_SIZE_MIN; /* has been successfully written to the ATECC508A */

if (slot_offset >= ATECC508A_SLOT_OFFSET_MAX) { /* Always check the slot offset after its been */
slot_offset = 0; /* incremented */
block_offset++;
}
}

if (status != ATCA_SUCCESS) { /* Ensure the 4 byte writes were sucessful before */
if (status != ATCA_SUCCESS) { /* Ensure the 4 byte writes were successful before */
ret_val = kOckamError; /* proceeding, otherwise unknown data in HKDF slot */
goto exit_block; /* may be used for HKDF */
}
Expand Down Expand Up @@ -769,7 +769,7 @@ OckamError Atecc508aHkdfExpand(const OckamMemory *p_memory, uint8_t key_slot, ui

exit_block:

if (p_atca_ctx) { /* If an error occured in the loop and we exited */
if (p_atca_ctx) { /* If an error occurred in the loop and we exited */
p_memory->Free(p_atca_ctx, /* early, ensure the buffer is freed. */
sizeof(atca_hmac_sha256_ctx_t));
}
Expand Down
6 changes: 3 additions & 3 deletions implementations/c/ockam/vault/atecc608a/atecc608a.c
Original file line number Diff line number Diff line change
Expand Up @@ -1500,7 +1500,7 @@ ockam_error_t atecc608a_aead_aes_gcm(ockam_vault_t* vault,
if (encrypt == VAULT_ATECC608A_AEAD_AES_GCM_ENCRYPT) {

uint8_t* tag_offset = 0;
status = atcab_aes_gcm_encrypt_update(atca_ctx, /* If mode is encrypt, resulting cipertext is placed */
status = atcab_aes_gcm_encrypt_update(atca_ctx, /* If mode is encrypt, resulting ciphertext is placed */
input, /* into output. */
input_length,
output);
Expand All @@ -1511,8 +1511,8 @@ ockam_error_t atecc608a_aead_aes_gcm(ockam_vault_t* vault,

tag_offset = output + input_length;

status = atcab_aes_gcm_encrypt_finish(atca_ctx, /* After the cipertext has been generated, output the */
tag_offset, /* resulting tag to p_tag and end AES GCM encryption */
status = atcab_aes_gcm_encrypt_finish(atca_ctx, /* After the ciphertext has been generated, output the */
tag_offset, /* resulting tag to p_tag and end AES GCM encryption */
OCKAM_VAULT_AEAD_AES_GCM_TAG_LENGTH);
if (status != ATCA_SUCCESS) {
error.code = OCKAM_VAULT_ATECC608A_ERROR_AEAD_AES_GCM_FAIL;
Expand Down
8 changes: 4 additions & 4 deletions implementations/c/ockam/vault/impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ typedef struct {
* @brief Generate an ockam secret.
* @param vault[in] Vault object to use for generating a secret key.
* @param secret[out] Pointer to an ockam secret object to be populated with the generated secret.
* @param attributes[in] Desired attribtes for the secret to be generated.
* @param attributes[in] Desired attributes for the secret to be generated.
*/
ockam_error_t (*secret_generate)(ockam_vault_t* vault,
ockam_vault_secret_t* secret,
Expand All @@ -60,7 +60,7 @@ typedef struct {
* @brief Import the specified data into the supplied ockam vault secret.
* @param vault[in] Vault object to use for generating a secret key.
* @param secret[out] Pointer to an ockam secret object to be populated with input data.
* @param attributes[in] Desired attribtes for the secret to be imported.
* @param attributes[in] Desired attributes for the secret to be imported.
* @param input[in] Data to load into the supplied secret.
* @param input_length[in] Length of data to load into the secret.
*/
Expand Down Expand Up @@ -101,7 +101,7 @@ typedef struct {
size_t* output_buffer_length);

/**
* @brief Retrive the attributes for a specified secret
* @brief Retrieve the attributes for a specified secret
* @param vault[in] Vault object to use for retrieving ockam vault secret attributes.
* @param secret[in] Ockam vault secret to get attributes for.
* @param attributes[out] Pointer to the attributes for the specified secret.
Expand Down Expand Up @@ -133,7 +133,7 @@ typedef struct {
* @param privatekey[in] The ockam vault secret to use for the private key of ECDH.
* @param peer_publickey[in] Public key data to use for ECDH.
* @param peer_publickey_length[in] Length of the public key.
* @param shared_secret[out] Resulting shared secret from a sucessful ECDH operation. Invalid if ECDH failed.
* @param shared_secret[out] Resulting shared secret from a successful ECDH operation. Invalid if ECDH failed.
* @return OCKAM_ERROR_NONE on success.
*/
ockam_error_t (*ecdh)(ockam_vault_t* vault,
Expand Down
4 changes: 2 additions & 2 deletions implementations/c/ockam/vault/rust/vault.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ uint32_t ockam_vault_sha256(ockam_vault_t vault,
* generate. For EC keys and AES keys, length is ignored.
* @param vault[in] Vault object to use for generating a secret key.
* @param secret[out] Pointer to an ockam secret object to be populated with a handle to the secret
* @param attributes[in] Desired attribtes for the secret to be generated.
* @param attributes[in] Desired attributes for the secret to be generated.
*/
uint32_t ockam_vault_secret_generate(ockam_vault_t vault,
ockam_vault_secret_t* secret,
Expand Down Expand Up @@ -185,7 +185,7 @@ uint32_t ockam_vault_secret_destroy(ockam_vault_t vault, ockam_vault_secret_t se
* @param privatekey[in] The ockam vault secret to use for the private key of ECDH.
* @param peer_publickey[in] Public key data to use for ECDH.
* @param peer_publickey_length[in] Length of the public key.
* @param shared_secret[out] Resulting shared secret from a sucessful ECDH operation. Invalid if ECDH failed.
* @param shared_secret[out] Resulting shared secret from a successful ECDH operation. Invalid if ECDH failed.
* @return OCKAM_ERROR_NONE on success.
*/
uint32_t ockam_vault_ecdh(ockam_vault_t* vault,
Expand Down
6 changes: 3 additions & 3 deletions implementations/c/ockam/vault/tests/secret_ecdh.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ void test_vault_secret_ecdh(void** state)
assert_true(ockam_error_is_none(&error));
}

/* ------------ */
/* Key Retrival */
/* ------------ */
/* ------------- */
/* Key Retrieval */
/* ------------- */

error = ockam_vault_secret_publickey_get(
test_data->vault, &initiator_secret, generated_initiator_pub, test_data->key_size, &length);
Expand Down
8 changes: 4 additions & 4 deletions implementations/c/ockam/vault/vault.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ ockam_error_t ockam_vault_sha256(ockam_vault_t* vault,
* generate. For EC keys and AES keys, length is ignored.
* @param vault[in] Vault object to use for generating a secret key.
* @param secret[out] Pointer to an ockam secret object to be populated with the generated secret.
* @param attributes[in] Desired attribtes for the secret to be generated.
* @param attributes[in] Desired attributes for the secret to be generated.
*/
ockam_error_t ockam_vault_secret_generate(ockam_vault_t* vault,
ockam_vault_secret_t* secret,
Expand All @@ -139,7 +139,7 @@ ockam_error_t ockam_vault_secret_generate(ockam_vault_t*
* @brief Import the specified data into the supplied ockam vault secret.
* @param vault[in] Vault object to use for generating a secret key.
* @param secret[out] Pointer to an ockam secret object to be populated with input data.
* @param attributes[in] Desired attribtes for the secret being imported.
* @param attributes[in] Desired attributes for the secret being imported.
* @param input[in] Data to load into the supplied secret.
* @param input_length[in] Length of data to load into the secret.
*/
Expand Down Expand Up @@ -181,7 +181,7 @@ ockam_error_t ockam_vault_secret_publickey_get(ockam_vault_t* vault,
size_t* output_buffer_length);

/**
* @brief Retrive the attributes for a specified secret
* @brief Retrieve the attributes for a specified secret
* @param vault[in] Vault object to use for retrieving ockam vault secret attributes.
* @param secret[in] Ockam vault secret to get attributes for.
* @param secret_attributes[out] Pointer to the attributes for the specified secret.
Expand Down Expand Up @@ -214,7 +214,7 @@ ockam_error_t ockam_vault_secret_destroy(ockam_vault_t* vault, ockam_vault_secre
* @param privatekey[in] The ockam vault secret to use for the private key of ECDH.
* @param peer_publickey[in] Public key data to use for ECDH.
* @param peer_publickey_length[in] Length of the public key.
* @param shared_secret[out] Resulting shared secret from a sucessful ECDH operation. Invalid if ECDH failed.
* @param shared_secret[out] Resulting shared secret from a successful ECDH operation. Invalid if ECDH failed.
* @return OCKAM_ERROR_NONE on success.
*/
ockam_error_t ockam_vault_ecdh(ockam_vault_t* vault,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ defmodule Ockam.Credential.AttributeStorageETS do

@doc """
Save attribute set for identity id
Current attribute set (if exists) will be overriden.
Current attribute set (if exists) will be overridden.
"""
@spec put_attribute_set(identity_id(), AttributeSet.t()) :: :ok | {:error, any()}
def put_attribute_set(id, attribute_set) do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ defmodule Ockam.Examples.Ping do

{previous, ""} = Integer.parse(Message.payload(message))

Logger.info("\nReceived pong fo #{inspect(previous)}")
Logger.info("\nReceived pong for #{inspect(previous)}")

state =
case Map.get(state, :last, 0) do
Expand Down
2 changes: 1 addition & 1 deletion implementations/elixir/ockam/ockam/lib/ockam/node.ex
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ defmodule Ockam.Node do
@spec get_random_unregistered_address(prefix :: String.t(), length_in_bytes :: integer()) ::
binary()
@doc """
Returns a random address that is currently not registed on the node.
Returns a random address that is currently not registered on the node.
"""
def get_random_unregistered_address(
prefix \\ "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ defmodule Ockam.Node.Registry do

@spec register_name(any, any) :: :no | :yes
@doc false
# This function is used when a process is registed using the `:via` option.
# This function is used when a process is registered using the `:via` option.
#
# The Gen* modules expect this function to be exported.
# See the "Name registration" section of the `GenServer` module.
Expand All @@ -33,15 +33,15 @@ defmodule Ockam.Node.Registry do

@spec whereis_name(any) :: :undefined | pid
@doc false
# This function is used when a process is registed using the `:via` option.
# This function is used when a process is registered using the `:via` option.
#
# The Gen* modules expect this function to be exported.
# See the "Name registration" section of the `GenServer` module.
def whereis_name(address), do: Registry.whereis_name({__MODULE__, address})

@spec unregister_name(any) :: :ok
@doc false
# This function is used when a process is registed using the `:via` option.
# This function is used when a process is registered using the `:via` option.
#
# The Gen* modules expect this function to be exported.
# See the "Name registration" section of the `GenServer` module.
Expand All @@ -54,7 +54,7 @@ defmodule Ockam.Node.Registry do

def addresses(pid), do: Registry.keys(__MODULE__, pid)

# This function is used when a process is registed using the `:via` option.
# This function is used when a process is registered using the `:via` option.
#
# The Gen* modules expect this function to be exported.
# See the "Name registration" section of the `GenServer` module.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ defmodule Ockam.Router.Storage do
@doc """
Puts the given `value` under `key` in storage.

If key is successfullly set, `:ok` is returned.
If key is successfully set, `:ok` is returned.
If a value already exists for this key, it will be overwritten, `:ok` is returned.
"""
@spec put(key(), value()) :: :ok
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ defmodule Ockam.Identity.SecureChannel.Handshake do
@impl true
def handle_responder(handshake_options, message, handshake_state) do
## TODO: maybe we need some separate handle_init_message for responder?
## Currently using a flag in handshake_state ot distinguish between
## Currently using a flag in handshake_state to distinguish between
## init message and handshake message
case Map.get(handshake_state, :expected_message, :init) do
:init ->
Expand Down
Loading