Commit 3d69407d authored by Ben Sartor's avatar Ben Sartor Committed by johan

Code Cleanup: fixed typo "lenght" in comments

Signed-off-by: johan's avatarJohan Pascal <johan.pascal@belledonne-communications.com>
parent 50091275
......@@ -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
*
......
......@@ -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
*
*/
......
......@@ -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 */
......
......@@ -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
*
......
......@@ -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.
*
*/
......
......@@ -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; i<messageData->hc; i++) {
messageData->supportedHash[i] = cryptoAlgoTypeStringToInt(messageContent, ZRTP_HASH_TYPE);
messageContent +=4;
......
......@@ -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;
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment