>From d999b9a0be2b3e731e078826959f8ce22cf3aafa Mon Sep 17 00:00:00 2001 From: Ben Sartor Date: Sun, 25 Jan 2015 07:29:11 +0100 Subject: [PATCH 15/15] Code Cleanup: fixed typo "lenght" in comments --- include/bzrtp/bzrtp.h | 4 ++-- include/cryptoWrapper.h | 6 +++--- include/typedef.h | 4 ++-- src/bzrtp.c | 2 +- src/cryptoPolarssl.c | 10 +++++----- src/packetParser.c | 2 +- src/stateMachine.c | 4 ++-- src/zidCache.c | 4 ++-- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/include/bzrtp/bzrtp.h b/include/bzrtp/bzrtp.h index dd7a3c5..b679e79 100644 --- a/include/bzrtp/bzrtp.h +++ b/include/bzrtp/bzrtp.h @@ -100,7 +100,7 @@ typedef struct bzrtpSrtpSecrets_struct { uint8_t cipherKeyLength; /**< The key length in bytes for the cipher block algorithm used by srtp */ uint8_t authTagAlgo; /**< srtp authentication tag algorithm agreed on after Hello packet exchange */ char *sas; /**< a null terminated char containing the Short Authentication String */ - uint8_t sasLength; /**< The lenght of sas, including the termination character */ + uint8_t sasLength; /**< The length of sas, including the termination character */ } bzrtpSrtpSecrets_t; #define ZRTP_MAGIC_COOKIE 0x5a525450 @@ -305,7 +305,7 @@ BZRTP_EXPORT void bzrtp_setSupportedCryptoTypes(bzrtpContext_t *zrtpContext, uin * @param[in] tagContent The content of the tag to be written(a string, if KDF is used the result will be turned into an hexa string) * @param[in] tagContentLength The length in bytes of tagContent * @param[in] derivedDataLength Used only in KDF mode, length in bytes of the derived data to use (max 32) - * @param[in] useKDF A flag, if set to 0, write data as it is provided, if set to 1, write KDF(s0, "tagContent", KDF_Context, negotiated hash lenght) + * @param[in] useKDF A flag, if set to 0, write data as it is provided, if set to 1, write KDF(s0, "tagContent", KDF_Context, negotiated hash length) * @param[in] fileFlag Flag, if LOADFILE bit is set, reload the cache buffer from file before updating. * if WRITEFILE bit is set, update the cache file * diff --git a/include/cryptoWrapper.h b/include/cryptoWrapper.h index f32f548..819a7c6 100644 --- a/include/cryptoWrapper.h +++ b/include/cryptoWrapper.h @@ -114,7 +114,7 @@ int bzrtpCrypto_destroyRNG(bzrtpRNGContext_t *context); * @param[in] keyLength HMAC key length in bytes * @param[in] input Input data buffer * @param[in] inputLength Input data length in bytes - * @param[in] hmacLength Lenght of output required in bytes, HMAC output is truncated to the hmacLenght left bytes. 32 bytes maximum + * @param[in] hmacLength Length of output required in bytes, HMAC output is truncated to the hmacLength left bytes. 32 bytes maximum * @param[out] output Output data buffer. * */ @@ -129,7 +129,7 @@ void bzrtpCrypto_hmacSha256(const uint8_t *key, * @brief SHA256 wrapper * @param[in] input Input data buffer * @param[in] inputLength Input data length in bytes - * @param[in] hmacLength Lenght of output required in bytes, SHA256 output is truncated to the hashLenght left bytes. 32 bytes maximum + * @param[in] hmacLength Length of output required in bytes, SHA256 output is truncated to the hashLength left bytes. 32 bytes maximum * @param[out] output Output data buffer. * */ @@ -144,7 +144,7 @@ void bzrtpCrypto_sha256(const uint8_t *input, * @param[in] keyLength HMAC key length * @param[in] input Input data buffer * @param[in] inputLength Input data length - * @param[in] hmacLength Lenght of output required in bytes, HMAC output is truncated to the hmacLenght left bytes. 32 bytes maximum + * @param[in] hmacLength Length of output required in bytes, HMAC output is truncated to the hmacLength left bytes. 32 bytes maximum * @param[out] output Output data buffer * */ diff --git a/include/typedef.h b/include/typedef.h index 865f77c..88b197a 100644 --- a/include/typedef.h +++ b/include/typedef.h @@ -160,7 +160,7 @@ struct bzrtpChannelContext_struct { uint8_t keyAgreementAlgo; /**< key agreement algorithm agreed on after Hello packet exchange, stored using integer mapping defined in cryptoWrapper.h */ uint16_t keyAgreementLength; /**< the length in byte of the secret generated by the agreed key exchange algo */ uint8_t sasAlgo; /**< sas rendering algorithm agreed on after Hello packet exchange, stored using integer mapping defined in cryptoWrapper.h */ - uint8_t sasLength; /**< lenght of the SAS depends on the algorithm agreed */ + uint8_t sasLength; /**< length of the SAS depends on the algorithm agreed */ /* function pointer to the agreed algorithms - Note, key agreement manage directly this selection so it is not set here */ void (*hmacFunction)(const uint8_t *key, size_t keyLength, const uint8_t *input, size_t inputLength, uint8_t hmacLength, uint8_t *output); /**< function pointer to the agreed hmacFunction */ @@ -172,7 +172,7 @@ struct bzrtpChannelContext_struct { /* keys */ uint8_t *s0; /**< the s0 as describred rfc section 4.4 - have a length of hashLength */ uint8_t *KDFContext; /**< defined in rfc section 4.4 */ - uint16_t KDFContextLength; /**< lenght of the KDF context, is 24 + output length of the selected hash algo */ + uint16_t KDFContextLength; /**< length of the KDF context, is 24 + output length of the selected hash algo */ uint8_t *mackeyi; /**< the initiator mackey as defined in rfc section 4.5.3 - have a length of hashLength */ uint8_t *mackeyr; /**< the responder mackey as defined in rfc section 4.5.3 - have a length of hashLength*/ uint8_t *zrtpkeyi; /**< the initiator mackey as defined in rfc section 4.5.3 - have a length of cipherKeyLength */ diff --git a/src/bzrtp.c b/src/bzrtp.c index ef78e6a..c5513dc 100644 --- a/src/bzrtp.c +++ b/src/bzrtp.c @@ -507,7 +507,7 @@ void bzrtp_resetSASVerified(bzrtpContext_t *zrtpContext) { * @param[in] tagContent The content of the tag to be written(a string, if KDF is used the result will be turned into an hexa string) * @param[in] tagContentLength The length in bytes of tagContent * @param[in] derivedDataLength Used only in KDF mode, length in bytes of the derived data to use (max 32) - * @param[in] useKDF A flag, if set to 0, write data as it is provided, if set to 1, write KDF(s0, "tagContent", KDF_Context, negotiated hash lenght) + * @param[in] useKDF A flag, if set to 0, write data as it is provided, if set to 1, write KDF(s0, "tagContent", KDF_Context, negotiated hash length) * @param[in] fileFlag Flag, if LOADFILE bit is set, reload the cache buffer from file before updating. * if WRITEFILE bit is set, update the cache file * diff --git a/src/cryptoPolarssl.c b/src/cryptoPolarssl.c index f19d6ca..e8dc0fb 100644 --- a/src/cryptoPolarssl.c +++ b/src/cryptoPolarssl.c @@ -169,7 +169,7 @@ int bzrtpCrypto_destroyRNG(bzrtpRNGContext_t *context) { * @param[in] keyLength HMAC key length * @param[in] input Input data buffer * @param[in] inputLength Input data length - * @param[in] hmacLength Lenght of output required in bytes, HMAC output is truncated to the hmacLenght left bytes. 20 bytes maximum + * @param[in] hmacLength Length of output required in bytes, HMAC output is truncated to the hmacLength left bytes. 20 bytes maximum * @param[out] output Output data buffer. * */ @@ -404,7 +404,7 @@ void bzrtpCrypto_aes256CfbDecrypt(const uint8_t key[32], * @brief SHA256 wrapper * @param[in] input Input data buffer * @param[in] inputLength Input data length in bytes - * @param[in] hmacLength Lenght of output required in bytes, HMAC output is truncated to the hmacLenght left bytes. 32 bytes maximum + * @param[in] hmacLength Length of output required in bytes, HMAC output is truncated to the hmacLength left bytes. 32 bytes maximum * @param[out] output Output data buffer. * */ @@ -430,7 +430,7 @@ void bzrtpCrypto_sha256(const uint8_t *input, * @param[in] keyLength HMAC key length * @param[in] input Input data buffer * @param[in] inputLength Input data length - * @param[in] hmacLength Lenght of output required in bytes, HMAC output is truncated to the hmacLenght left bytes. 32 bytes maximum + * @param[in] hmacLength Length of output required in bytes, HMAC output is truncated to the hmacLength left bytes. 32 bytes maximum * @param[out] output Output data buffer. * */ @@ -476,7 +476,7 @@ void bzrtpCrypto_DHMComputeSecret(bzrtpDHMContext_t *context, int (*rngFunction) * @brief SHA256 wrapper * @param[in] input Input data buffer * @param[in] inputLength Input data length in bytes - * @param[in] hmacLength Lenght of output required in bytes, HMAC output is truncated to the hmacLenght left bytes. 32 bytes maximum + * @param[in] hmacLength Length of output required in bytes, HMAC output is truncated to the hmacLength left bytes. 32 bytes maximum * @param[out] output Output data buffer. * */ @@ -502,7 +502,7 @@ void bzrtpCrypto_sha256(const uint8_t *input, * @param[in] keyLength HMAC key length * @param[in] input Input data buffer * @param[in] inputLength Input data length - * @param[in] hmacLength Lenght of output required in bytes, HMAC output is truncated to the hmacLenght left bytes. 32 bytes maximum + * @param[in] hmacLength Length of output required in bytes, HMAC output is truncated to the hmacLength left bytes. 32 bytes maximum * @param[out] output Output data buffer. * */ diff --git a/src/packetParser.c b/src/packetParser.c index a4eb391..e606ad1 100644 --- a/src/packetParser.c +++ b/src/packetParser.c @@ -244,7 +244,7 @@ int bzrtp_packetParser(bzrtpContext_t *zrtpContext, bzrtpChannelContext_t *zrtpC return BZRTP_PARSER_ERROR_INVALIDMESSAGE; } - /* parse the variable lenght part: algorithms types */ + /* parse the variable length part: algorithms types */ for (i=0; ihc; i++) { messageData->supportedHash[i] = cryptoAlgoTypeStringToInt(messageContent, ZRTP_HASH_TYPE); messageContent +=4; diff --git a/src/stateMachine.c b/src/stateMachine.c index 0dcb0a2..1dcccfa 100644 --- a/src/stateMachine.c +++ b/src/stateMachine.c @@ -1757,7 +1757,7 @@ int bzrtp_computeS0DHMMode(bzrtpContext_t *zrtpContext, bzrtpChannelContext_t *z /* first compute the total_hash as in rfc section 4.4.1.4 * total_hash = hash(Hello of responder || Commit || DHPart1 || DHPart2) - * total_hash lenght depends on the agreed hash algo + * total_hash length depends on the agreed hash algo */ if (zrtpChannelContext->role == RESPONDER) { hashDataLength = zrtpChannelContext->selfPackets[HELLO_MESSAGE_STORE_ID]->messageLength @@ -2086,7 +2086,7 @@ int bzrtp_deriveSrtpKeysFromS0(bzrtpContext_t *zrtpContext, bzrtpChannelContext_ } - /* Set the lenght in secrets structure */ + /* Set the length in secrets structure */ zrtpChannelContext->srtpSecrets.selfSrtpKeyLength = zrtpChannelContext->cipherKeyLength; zrtpChannelContext->srtpSecrets.selfSrtpSaltLength = 14; /* salt length is defined to be 112 bits(14 bytes) in rfc section 4.5.3 */ zrtpChannelContext->srtpSecrets.peerSrtpKeyLength = zrtpChannelContext->cipherKeyLength; diff --git a/src/zidCache.c b/src/zidCache.c index 4743383..748121e 100644 --- a/src/zidCache.c +++ b/src/zidCache.c @@ -351,7 +351,7 @@ void bzrtp_writeCache(bzrtpContext_t *zrtpContext) { * * @param[out] outputBytes The output bytes buffer, must have a length of half the input string buffer * @param[in] inputString The input string buffer, must be hexadecimal(it is not checked by function, any non hexa char is converted to 0) - * @param[in] inputStringLength The lenght in chars of the string buffer, output is half this length + * @param[in] inputStringLength The length in chars of the string buffer, output is half this length */ void bzrtp_strToUint8(uint8_t *outputBytes, uint8_t *inputString, uint16_t inputStringLength) { int i; @@ -365,7 +365,7 @@ void bzrtp_strToUint8(uint8_t *outputBytes, uint8_t *inputString, uint16_t input * * @param[out] outputString The output string buffer, must have a length of twice the input bytes buffer * @param[in] inputBytes The input bytes buffer - * @param[in] inputBytesLength The lenght in bytes buffer, output is twice this length + * @param[in] inputBytesLength The length in bytes buffer, output is twice this length */ void bzrtp_int8ToStr(uint8_t *outputString, uint8_t *inputBytes, uint16_t inputBytesLength) { int i; -- 2.1.4