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

Fix typos prior to release #6717

Merged
merged 3 commits into from
Dec 6, 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 doxygen/input/doc_encdec.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* All symmetric encryption algorithms are accessible via the generic cipher layer
* (see \c mbedtls_cipher_setup()).
*
* The asymmetric encryptrion algorithms are accessible via the generic public
* The asymmetric encryption algorithms are accessible via the generic public
* key layer (see \c mbedtls_pk_init()).
*
* The following algorithms are provided:
Expand Down
2 changes: 1 addition & 1 deletion include/mbedtls/asn1write.h
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ int mbedtls_asn1_write_octet_string( unsigned char **p, const unsigned char *sta
* the existing buffer to fit \p val_len.
*
* \return A pointer to the new / existing entry on success.
* \return \c NULL if if there was a memory allocation error.
* \return \c NULL if there was a memory allocation error.
*/
mbedtls_asn1_named_data *mbedtls_asn1_store_named_data( mbedtls_asn1_named_data **list,
const char *oid, size_t oid_len,
Expand Down
2 changes: 1 addition & 1 deletion include/mbedtls/check_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@

#if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT) && \
!defined(MBEDTLS_SSL_DTLS_CONNECTION_ID)
#error "MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT defined, but not all prerequsites"
#error "MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT defined, but not all prerequisites"
#endif

#if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT) && MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT != 0
Expand Down
2 changes: 1 addition & 1 deletion include/mbedtls/config_psa.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* those definitions to define symbols used in the library code.
*
* Users and integrators should not edit this file, please edit
* include/mbedtls/mbedtls_config.h for MBETLS_XXX settings or
* include/mbedtls/mbedtls_config.h for MBEDTLS_XXX settings or
* include/psa/crypto_config.h for PSA_WANT_XXX settings.
*/
/*
Expand Down
6 changes: 3 additions & 3 deletions include/mbedtls/lms.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
#define MBEDTLS_LMS_TYPE_LEN (4)
#define MBEDTLS_LMS_H_TREE_HEIGHT(type) ((type) == MBEDTLS_LMS_SHA256_M32_H10 ? 10u : 0)

/* The length of a hash output, Currently only imlemented for SHA256.
/* The length of a hash output, Currently only implemented for SHA256.
* Max is 32 bytes.
*/
#define MBEDTLS_LMS_M_NODE_BYTES(type) ((type) == MBEDTLS_LMS_SHA256_M32_H10 ? 32 : 0)
Expand All @@ -82,15 +82,15 @@ extern "C" {

/** The Identifier of the LMS parameter set, as per
* https://www.iana.org/assignments/leighton-micali-signatures/leighton-micali-signatures.xhtml
* We are only implementing a subset of the types, particularly H10, for the sake of simplicty.
* We are only implementing a subset of the types, particularly H10, for the sake of simplicity.
*/
typedef enum {
MBEDTLS_LMS_SHA256_M32_H10 = 0x6,
} mbedtls_lms_algorithm_type_t;

/** The Identifier of the LMOTS parameter set, as per
* https://www.iana.org/assignments/leighton-micali-signatures/leighton-micali-signatures.xhtml.
* We are only implementing a subset of the types, particularly N32_W8, for the sake of simplicty.
* We are only implementing a subset of the types, particularly N32_W8, for the sake of simplicity.
*/
typedef enum {
MBEDTLS_LMOTS_SHA256_N32_W8 = 4
Expand Down
2 changes: 1 addition & 1 deletion include/mbedtls/mbedtls_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -1543,7 +1543,7 @@
* Requires: MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
* Requires: MBEDTLS_PSA_CRYPTO_C
*
* Note: even though TLS 1.3 depends on PSA Crypto, and uses it unconditonally
* Note: even though TLS 1.3 depends on PSA Crypto, and uses it unconditionally
* for most operations, if you want it to only use PSA for all crypto
* operations, you need to also enable MBEDTLS_USE_PSA_CRYPTO; otherwise X.509
* operations, and functions that are common with TLS 1.2 (record protection,
Expand Down
2 changes: 1 addition & 1 deletion include/mbedtls/pkcs12.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ int mbedtls_pkcs12_pbe( mbedtls_asn1_buf *pbe_params, int mode,
* no byte order mark and with a null terminator (i.e. the
* last two bytes should be 0x00 0x00).
* \param pwdlen length of the password (may be 0).
* \param salt Salt buffer to use This may only be \c NULL when
* \param salt Salt buffer to use. This may only be \c NULL when
* \p saltlen is 0.
* \param saltlen length of the salt (may be zero)
* \param mbedtls_md mbedtls_md type to use during the derivation
Expand Down
2 changes: 1 addition & 1 deletion include/mbedtls/pkcs7.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ int mbedtls_pkcs7_signed_data_verify( mbedtls_pkcs7 *pkcs7,
* \param hashlen Length of the hash.
*
* \note This function is different from mbedtls_pkcs7_signed_data_verify()
* in a way that it directly recieves the hash of the data.
* in a way that it directly receives the hash of the data.
*
* \return A negative error code on failure.
*/
Expand Down
2 changes: 1 addition & 1 deletion include/mbedtls/rsa.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ int mbedtls_rsa_import( mbedtls_rsa_context *ctx,
* \param N The RSA modulus. This may be \c NULL.
* \param N_len The Byte length of \p N; it is ignored if \p N == NULL.
* \param P The first prime factor of \p N. This may be \c NULL.
* \param P_len The Byte length of \p P; it ns ignored if \p P == NULL.
* \param P_len The Byte length of \p P; it is ignored if \p P == NULL.
* \param Q The second prime factor of \p N. This may be \c NULL.
* \param Q_len The Byte length of \p Q; it is ignored if \p Q == NULL.
* \param D The private exponent. This may be \c NULL.
Expand Down
10 changes: 5 additions & 5 deletions include/mbedtls/ssl.h
Original file line number Diff line number Diff line change
Expand Up @@ -2136,7 +2136,7 @@ void mbedtls_ssl_set_bio( mbedtls_ssl_context *ssl,
* the `ServerHello` contains the CID extension, too,
* the CID extension will actually be put to use.
* - On the Server, enabling the use of the CID through
* this call implies that that the server will look for
* this call implies that the server will look for
* the CID extension in a `ClientHello` from the client,
* and, if present, reply with a CID extension in its
* `ServerHello`.
Expand Down Expand Up @@ -2582,7 +2582,7 @@ static inline uintptr_t mbedtls_ssl_conf_get_user_data_n(
* \note The library stores \c p without accessing it. It is the responsibility
* of the caller to ensure that the pointer remains valid.
*
* \param ssl The SSL context context to modify.
* \param ssl The SSL context to modify.
* \param p The new value of the user data.
*/
static inline void mbedtls_ssl_set_user_data_p(
Expand All @@ -2596,7 +2596,7 @@ static inline void mbedtls_ssl_set_user_data_p(
*
* You can retrieve this value later with mbedtls_ssl_get_user_data_n().
*
* \param ssl The SSL context context to modify.
* \param ssl The SSL context to modify.
* \param n The new value of the user data.
*/
static inline void mbedtls_ssl_set_user_data_n(
Expand All @@ -2613,7 +2613,7 @@ static inline void mbedtls_ssl_set_user_data_n(
* called. The value is undefined if mbedtls_ssl_set_user_data_n() has
* been called without a subsequent call to mbedtls_ssl_set_user_data_p().
*
* \param ssl The SSL context context to modify.
* \param ssl The SSL context to modify.
* \return The current value of the user data.
*/
static inline void *mbedtls_ssl_get_user_data_p(
Expand All @@ -2629,7 +2629,7 @@ static inline void *mbedtls_ssl_get_user_data_p(
* called. The value is undefined if mbedtls_ssl_set_user_data_p() has
* been called without a subsequent call to mbedtls_ssl_set_user_data_n().
*
* \param ssl The SSL context context to modify.
* \param ssl The SSL context to modify.
* \return The current value of the user data.
*/
static inline uintptr_t mbedtls_ssl_get_user_data_n(
Expand Down
4 changes: 2 additions & 2 deletions include/psa/crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ psa_status_t psa_copy_key(mbedtls_svc_key_id_t source_key,
*
* This function destroys a key from both volatile
* memory and, if applicable, non-volatile storage. Implementations shall
* make a best effort to ensure that that the key material cannot be recovered.
* make a best effort to ensure that the key material cannot be recovered.
*
* This function also erases any metadata such as policies and frees
* resources associated with the key.
Expand Down Expand Up @@ -3823,7 +3823,7 @@ psa_status_t psa_key_derivation_verify_bytes(
* compares those bytes to an expected value, provided as key of type
* #PSA_KEY_TYPE_PASSWORD_HASH.
* If you view the key derivation's output as a stream of bytes, this
* function destructively reads the number of bytes corresponding the the
* function destructively reads the number of bytes corresponding to the
* length of the expected value from the stream before comparing them.
* The operation's capacity decreases by the number of bytes read.
*
Expand Down
10 changes: 5 additions & 5 deletions include/psa/crypto_se_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ typedef psa_status_t (*psa_drv_se_mac_finish_t)(void *op_context,
* operation by comparing the resulting MAC against a provided value
*
* \param[in,out] op_context A hardware-specific structure for the previously
* started MAC operation to be fiinished
* started MAC operation to be finished
* \param[in] p_mac The MAC value against which the resulting MAC
* will be compared against
* \param[in] mac_length The size in bytes of the value stored in `p_mac`
Expand Down Expand Up @@ -337,7 +337,7 @@ typedef struct {
/** Function that completes a MAC operation with a verify check
*/
psa_drv_se_mac_finish_verify_t MBEDTLS_PRIVATE(p_finish_verify);
/** Function that aborts a previoustly started MAC operation
/** Function that aborts a previously started MAC operation
*/
psa_drv_se_mac_abort_t MBEDTLS_PRIVATE(p_abort);
/** Function that performs a MAC operation in one call
Expand Down Expand Up @@ -746,7 +746,7 @@ typedef psa_status_t (*psa_drv_se_aead_encrypt_t)(psa_drv_se_context_t *drv_cont
size_t ciphertext_size,
size_t *p_ciphertext_length);

/** A function that peforms a secure element authenticated decryption operation
/** A function that performs a secure element authenticated decryption operation
*
* \param[in,out] drv_context The driver context structure.
* \param[in] key_slot Slot containing the key to use
Expand Down Expand Up @@ -1157,7 +1157,7 @@ typedef struct {
*
* Different key derivation algorithms require a different number of inputs.
* Instead of having an API that takes as input variable length arrays, which
* can be problemmatic to manage on embedded platforms, the inputs are passed
* can be problematic to manage on embedded platforms, the inputs are passed
* to the driver via a function, `psa_drv_se_key_derivation_collateral`, that
* is called multiple times with different `collateral_id`s. Thus, for a key
* derivation algorithm that required 3 parameter inputs, the flow would look
Expand Down Expand Up @@ -1271,7 +1271,7 @@ typedef struct {
psa_drv_se_key_derivation_collateral_t MBEDTLS_PRIVATE(p_collateral);
/** Function that performs a final key derivation step */
psa_drv_se_key_derivation_derive_t MBEDTLS_PRIVATE(p_derive);
/** Function that perforsm a final key derivation or agreement and
/** Function that performs a final key derivation or agreement and
* exports the key */
psa_drv_se_key_derivation_export_t MBEDTLS_PRIVATE(p_export);
} psa_drv_se_key_derivation_t;
Expand Down
2 changes: 1 addition & 1 deletion include/psa/crypto_sizes.h
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@
(PSA_KEY_EXPORT_ASN1_INTEGER_MAX_SIZE(key_bits) + 11)

/* Maximum size of the export encoding of an RSA key pair.
* Assumes thatthe public exponent is less than 2^32 and that the size
* Assumes that the public exponent is less than 2^32 and that the size
* difference between the two primes is at most 1 bit.
*
* RSAPrivateKey ::= SEQUENCE {
Expand Down
2 changes: 1 addition & 1 deletion include/psa/crypto_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ typedef psa_key_id_t mbedtls_svc_key_id_t;

#else /* MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER */
/* Implementation-specific: The Mbed Cryptography library can be built as
* part of a multi-client service that exposes the PSA Cryptograpy API in each
* part of a multi-client service that exposes the PSA Cryptography API in each
* client and encodes the client identity in the key identifier argument of
* functions such as psa_open_key().
*/
Expand Down
6 changes: 3 additions & 3 deletions include/psa/crypto_values.h
Original file line number Diff line number Diff line change
Expand Up @@ -2577,7 +2577,7 @@ static inline int mbedtls_svc_key_id_is_null( mbedtls_svc_key_id_t key )
*
* This flag allows the key to be used for a MAC verification operation
* or for an asymmetric signature verification operation,
* if otherwise permitted by by the key's type and policy.
* if otherwise permitted by the key's type and policy.
*
* For a key pair, this concerns the public key.
*/
Expand All @@ -2587,7 +2587,7 @@ static inline int mbedtls_svc_key_id_is_null( mbedtls_svc_key_id_t key )
* hash.
*
* This flag allows the key to be used for a key derivation operation or for
* a key agreement operation, if otherwise permitted by by the key's type and
* a key agreement operation, if otherwise permitted by the key's type and
* policy.
*
* If this flag is present on all keys used in calls to
Expand All @@ -2603,7 +2603,7 @@ static inline int mbedtls_svc_key_id_is_null( mbedtls_svc_key_id_t key )
* This flag allows the key to be used:
*
* This flag allows the key to be used in a key derivation operation, if
* otherwise permitted by by the key's type and policy.
* otherwise permitted by the key's type and policy.
*
* If this flag is present on all keys used in calls to
* psa_key_derivation_input_key() for a key derivation operation, then it
Expand Down
2 changes: 1 addition & 1 deletion library/aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,7 @@ int mbedtls_aes_crypt_xts( mbedtls_aes_xts_context *ctx,
{
/* We are on the last block in a decrypt operation that has
* leftover bytes, so we need to use the next tweak for this block,
* and this tweak for the lefover bytes. Save the current tweak for
* and this tweak for the leftover bytes. Save the current tweak for
* the leftovers and then update the current tweak for use on this,
* the last full block. */
memcpy( prev_tweak, tweak, sizeof( tweak ) );
Expand Down
2 changes: 1 addition & 1 deletion library/ccm.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ static int ccm_calculate_first_block_if_ready(mbedtls_ccm_context *ctx)
unsigned char i;
size_t len_left, olen;

/* length calulcation can be done only after both
/* length calculation can be done only after both
* mbedtls_ccm_starts() and mbedtls_ccm_set_lengths() have been executed
*/
if( !(ctx->state & CCM_STATE__STARTED) || !(ctx->state & CCM_STATE__LENGTHS_SET) )
Expand Down
2 changes: 1 addition & 1 deletion library/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void mbedtls_debug_print_ret( const mbedtls_ssl_context *ssl, int level,
/*
* With non-blocking I/O and examples that just retry immediately,
* the logs would be quickly flooded with WANT_READ, so ignore that.
* Don't ignore WANT_WRITE however, since is is usually rare.
* Don't ignore WANT_WRITE however, since it is usually rare.
*/
if( ret == MBEDTLS_ERR_SSL_WANT_READ )
return;
Expand Down
2 changes: 1 addition & 1 deletion library/lmots.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ int mbedtls_lmots_import_public_key( mbedtls_lmots_public_t *ctx,
* this public key.
*
* \param ctx The initialized LMOTS context that contains the
* publc key.
* public key.
* \param key The buffer into which the key will be output. Must
* be at least #MBEDTLS_LMOTS_PUBLIC_KEY_LEN in size.
*
Expand Down
2 changes: 1 addition & 1 deletion library/mps_reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ int mbedtls_mps_reader_reclaim( mbedtls_mps_reader *rd,
* of the accumulator. */
memmove( acc, acc + acc_backup_offset, acc_backup_len );

/* Copy uncmmitted parts of the current fragment to the
/* Copy uncommitted parts of the current fragment to the
* accumulator. */
memcpy( acc + acc_backup_len,
frag + frag_backup_offset, frag_backup_len );
Expand Down
2 changes: 1 addition & 1 deletion library/pkcs7.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ static int pkcs7_get_signer_info( unsigned char **p, unsigned char *end,
if( ret != 0 )
goto out;

/* Asssume authenticatedAttributes is nonexistent */
/* Assume authenticatedAttributes is nonexistent */

ret = pkcs7_get_digest_algorithm( p, end_signer, &signer->sig_alg_identifier );
if( ret != 0 )
Expand Down
2 changes: 1 addition & 1 deletion library/psa_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -5998,7 +5998,7 @@ psa_status_t psa_generate_random( uint8_t *output,
if( status != PSA_SUCCESS )
return( status );
/* Breaking up a request into smaller chunks is currently not supported
* for the extrernal RNG interface. */
* for the external RNG interface. */
if( output_length != output_size )
return( PSA_ERROR_INSUFFICIENT_ENTROPY );
return( PSA_SUCCESS );
Expand Down
2 changes: 1 addition & 1 deletion library/psa_crypto_se.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ psa_status_t psa_find_se_slot_for_key(
psa_se_drv_table_entry_t *driver,
psa_key_slot_number_t *slot_number );

/** Destoy a key in a secure element.
/** Destroy a key in a secure element.
*
* This function calls the relevant driver method to destroy a key
* and updates the driver's persistent data.
Expand Down
2 changes: 1 addition & 1 deletion library/ssl_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ static int ssl_prepare_client_hello( mbedtls_ssl_context *ssl )

/*
* Generate the random bytes, except when responding to a verify request
* where we MUST reuse the previoulsy generated random bytes
* where we MUST reuse the previously generated random bytes
* (RFC 6347 4.2.1).
*/
#if defined(MBEDTLS_SSL_PROTO_DTLS)
Expand Down
2 changes: 1 addition & 1 deletion library/ssl_misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ uint32_t mbedtls_ssl_get_extension_mask( unsigned int extension_type );
MBEDTLS_SSL_EXT_MASK( TRUNCATED_HMAC ) | \
MBEDTLS_SSL_EXT_MASK( UNRECOGNIZED ) )

/* RFC 8446 section 4.2. Allowed extensions for ClienHello */
/* RFC 8446 section 4.2. Allowed extensions for ClientHello */
#define MBEDTLS_SSL_TLS1_3_ALLOWED_EXTS_OF_CH \
( MBEDTLS_SSL_EXT_MASK( SERVERNAME ) | \
MBEDTLS_SSL_EXT_MASK( MAX_FRAGMENT_LENGTH ) | \
Expand Down
6 changes: 3 additions & 3 deletions library/ssl_msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ int mbedtls_ssl_encrypt_buf( mbedtls_ssl_context *ssl,
int auth_done = 0;
unsigned char * data;
/* For an explanation of the additional data length see
* the descrpition of ssl_extract_add_data_from_record().
* the description of ssl_extract_add_data_from_record().
*/
#if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID)
unsigned char add_data[23 + MBEDTLS_SSL_CID_OUT_LEN_MAX];
Expand Down Expand Up @@ -1289,7 +1289,7 @@ int mbedtls_ssl_decrypt_buf( mbedtls_ssl_context const *ssl,
#endif
unsigned char* data;
/* For an explanation of the additional data length see
* the descrpition of ssl_extract_add_data_from_record().
* the description of ssl_extract_add_data_from_record().
*/
#if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID)
unsigned char add_data[23 + MBEDTLS_SSL_CID_IN_LEN_MAX];
Expand Down Expand Up @@ -4098,7 +4098,7 @@ static int ssl_load_buffered_message( mbedtls_ssl_context *ssl )
if( hs == NULL )
return( -1 );

MBEDTLS_SSL_DEBUG_MSG( 2, ( "=> ssl_load_buffered_messsage" ) );
MBEDTLS_SSL_DEBUG_MSG( 2, ( "=> ssl_load_buffered_message" ) );

if( ssl->state == MBEDTLS_SSL_CLIENT_CHANGE_CIPHER_SPEC ||
ssl->state == MBEDTLS_SSL_SERVER_CHANGE_CIPHER_SPEC )
Expand Down
4 changes: 2 additions & 2 deletions library/ssl_tls12_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1971,8 +1971,8 @@ static int ssl_parse_server_psk_hint( mbedtls_ssl_context *ssl,
}

/*
* Note: we currently ignore the PKS identity hint, as we only allow one
* PSK to be provisionned on the client. This could be changed later if
* Note: we currently ignore the PSK identity hint, as we only allow one
* PSK to be provisioned on the client. This could be changed later if
* someone needs that feature.
*/
*p += len;
Expand Down
2 changes: 1 addition & 1 deletion library/ssl_tls13_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ static int ssl_tls13_parse_pre_shared_key_ext( mbedtls_ssl_context *ssl,

if( p_identity_len != identities_end || p_binder_len != binders_end )
{
MBEDTLS_SSL_DEBUG_MSG( 3, ( "pre_shared_key extesion decode error" ) );
MBEDTLS_SSL_DEBUG_MSG( 3, ( "pre_shared_key extension decode error" ) );
MBEDTLS_SSL_PEND_FATAL_ALERT( MBEDTLS_SSL_ALERT_MSG_DECODE_ERROR,
MBEDTLS_ERR_SSL_DECODE_ERROR );
return( MBEDTLS_ERR_SSL_DECODE_ERROR );
Expand Down
Loading