From 289f51a77d7770f095b64ff420fdbc3d44750963 Mon Sep 17 00:00:00 2001 From: David Garske Date: Thu, 21 Feb 2019 13:29:44 -0800 Subject: [PATCH] Fixes for various spelling errors. --- .../cs+/Projects/t4_demo/wolf_client.c | 40 +++++------ .../cs+/Projects/t4_demo/wolf_server.c | 38 +++++----- doc/dox_comments/header_files/wolfio.h | 2 +- src/ssl.c | 68 +++++++++--------- src/tls.c | 4 +- src/tls13.c | 38 +++++----- src/wolfio.c | 4 +- tests/api.c | 70 +++++++++---------- wolfcrypt/src/asn.c | 2 +- wolfcrypt/src/pkcs7.c | 4 +- wolfcrypt/src/port/af_alg/afalg_hash.c | 6 +- wolfcrypt/src/sp_int.c | 2 +- wolfcrypt/test/test.c | 2 +- wolfssl/internal.h | 20 +++--- wolfssl/wolfcrypt/random.h | 2 +- 15 files changed, 151 insertions(+), 151 deletions(-) diff --git a/IDE/Renesas/cs+/Projects/t4_demo/wolf_client.c b/IDE/Renesas/cs+/Projects/t4_demo/wolf_client.c index 9fe2a3856..ff9e8b47f 100644 --- a/IDE/Renesas/cs+/Projects/t4_demo/wolf_client.c +++ b/IDE/Renesas/cs+/Projects/t4_demo/wolf_client.c @@ -34,29 +34,29 @@ static int my_IORecv(WOLFSSL* ssl, char* buff, int sz, void* ctx) { int ret; ID cepid; - + if(ctx != NULL)cepid = *(ID *)ctx; else return WOLFSSL_CBIO_ERR_GENERAL; - + ret = tcp_rcv_dat(cepid, buff, sz, TMO_FEVR); if(ret > 0)return ret; - else return WOLFSSL_CBIO_ERR_GENERAL; + else return WOLFSSL_CBIO_ERR_GENERAL; } static int my_IOSend(WOLFSSL* ssl, char* buff, int sz, void* ctx) { int ret; ID cepid; - + if(ctx != NULL)cepid = *(ID *)ctx; else return WOLFSSL_CBIO_ERR_GENERAL; - + ret = tcp_snd_dat(cepid, buff, sz, TMO_FEVR); if(ret == sz)return ret; - else return WOLFSSL_CBIO_ERR_GENERAL; + else return WOLFSSL_CBIO_ERR_GENERAL; } -static int getIPaddr(char *arg) +static int getIPaddr(char *arg) { int a1, a2, a3, a4; if(sscanf(arg, "%d.%d.%d.%d", &a1, &a2, &a3, &a4) == 4) @@ -64,8 +64,8 @@ static int getIPaddr(char *arg) else return 0; } -static int getPort(char *arg) -{ +static int getPort(char *arg) +{ int port; if(sscanf(arg, "%d", &port) == 1) return port; @@ -74,7 +74,7 @@ static int getPort(char *arg) WOLFSSL_CTX *wolfSSL_TLS_client_init() { - + WOLFSSL_CTX* ctx; #ifndef NO_FILESYSTEM #ifdef USE_ECC_CERT @@ -91,18 +91,18 @@ WOLFSSL_CTX *wolfSSL_TLS_client_init() #define SIZEOF_CERT sizeof_ca_cert_der_2048 #endif #endif - + wolfSSL_Init(); #ifdef DEBUG_WOLFSSL wolfSSL_Debugging_ON(); #endif - + /* Create and initialize WOLFSSL_CTX */ if ((ctx = wolfSSL_CTX_new(wolfTLSv1_2_client_method_ex((void *)NULL))) == NULL) { printf("ERROR: failed to create WOLFSSL_CTX\n"); return NULL; } - + #if !defined(NO_FILESYSTEM) if (wolfSSL_CTX_load_verify_locations(ctx, cert, 0) != SSL_SUCCESS) { printf("ERROR: can't load \"%s\"\n", cert); @@ -127,7 +127,7 @@ WOLFSSL_CTX *wolfSSL_TLS_client_init() void wolfSSL_TLS_client(void *v_ctx, func_args *args) { ID cepid = 1; - ER ercd; + ER ercd; int ret; WOLFSSL_CTX *ctx = (WOLFSSL_CTX *)v_ctx; WOLFSSL *ssl; @@ -136,7 +136,7 @@ void wolfSSL_TLS_client(void *v_ctx, func_args *args) char rcvBuff[BUFF_SIZE] = {0}; static T_IPV4EP my_addr = { 0, 0 }; T_IPV4EP dst_addr; - + if(args->argc >= 2){ if((dst_addr.ipaddr = getIPaddr(args->argv[1])) == 0){ printf("ERROR: IP address\n"); @@ -147,7 +147,7 @@ void wolfSSL_TLS_client(void *v_ctx, func_args *args) return; } } - + if((ercd = tcp_con_cep(cepid, &my_addr, &dst_addr, TMO_FEVR)) != E_OK) { printf("ERROR TCP Connect: %d\n", ercd); return; @@ -157,7 +157,7 @@ void wolfSSL_TLS_client(void *v_ctx, func_args *args) printf("ERROR wolfSSL_new: %d\n", wolfSSL_get_error(ssl, 0)); return; } - + /* set callback context */ wolfSSL_SetIOReadCtx(ssl, (void *)&cepid); wolfSSL_SetIOWriteCtx(ssl, (void *)&cepid); @@ -166,7 +166,7 @@ void wolfSSL_TLS_client(void *v_ctx, func_args *args) printf("ERROR SSL connect: %d\n", wolfSSL_get_error(ssl, 0)); return; } - + if (wolfSSL_write(ssl, sendBuff, strlen(sendBuff)) != strlen(sendBuff)) { printf("ERROR SSL write: %d\n", wolfSSL_get_error(ssl, 0)); return; @@ -176,9 +176,9 @@ void wolfSSL_TLS_client(void *v_ctx, func_args *args) printf("ERROR SSL read: %d\n", wolfSSL_get_error(ssl, 0)); return; } - + rcvBuff[ret] = '\0' ; - printf("Recieved: %s\n", rcvBuff); + printf("Received: %s\n", rcvBuff); /* frees all data before client termination */ wolfSSL_free(ssl); diff --git a/IDE/Renesas/cs+/Projects/t4_demo/wolf_server.c b/IDE/Renesas/cs+/Projects/t4_demo/wolf_server.c index 4a99a3afb..d7f92c2dd 100644 --- a/IDE/Renesas/cs+/Projects/t4_demo/wolf_server.c +++ b/IDE/Renesas/cs+/Projects/t4_demo/wolf_server.c @@ -31,26 +31,26 @@ static int my_IORecv(WOLFSSL* ssl, char* buff, int sz, void* ctx) { int ret; ID cepid; - + if(ctx != NULL)cepid = *(ID *)ctx; else return WOLFSSL_CBIO_ERR_GENERAL; - + ret = tcp_rcv_dat(cepid, buff, sz, TMO_FEVR); if(ret == sz)return ret; - else return WOLFSSL_CBIO_ERR_GENERAL; + else return WOLFSSL_CBIO_ERR_GENERAL; } static int my_IOSend(WOLFSSL* ssl, char* buff, int sz, void* ctx) { int ret; ID cepid; - + if(ctx != NULL)cepid = *(ID *)ctx; else return WOLFSSL_CBIO_ERR_GENERAL; - + ret = tcp_snd_dat(cepid, buff, sz, TMO_FEVR); if(ret == sz)return ret; - else return WOLFSSL_CBIO_ERR_GENERAL; + else return WOLFSSL_CBIO_ERR_GENERAL; } @@ -59,7 +59,7 @@ WOLFSSL_CTX *wolfSSL_TLS_server_init() int ret; WOLFSSL_CTX* ctx; - + #ifndef NO_FILESYSTEM #ifdef USE_ECC_CERT char *cert = "./certs/server-ecc-cert.pem"; @@ -81,15 +81,15 @@ WOLFSSL_CTX *wolfSSL_TLS_server_init() #define sizeof_key sizeof_server_key_der_2048 #endif #endif - + wolfSSL_Init(); #ifdef DEBUG_WOLFSSL wolfSSL_Debugging_ON(); #endif - + /* Create and initialize WOLFSSL_CTX */ - if ((ctx = wolfSSL_CTX_new(wolfSSLv23_server_method_ex((void *)NULL))) == NULL) { + if ((ctx = wolfSSL_CTX_new(wolfSSLv23_server_method_ex((void *)NULL))) == NULL) { printf("ERROR: failed to create WOLFSSL_CTX\n"); return NULL; } @@ -130,13 +130,13 @@ void wolfSSL_TLS_server(void *v_ctx, func_args *args) ER ercd; WOLFSSL_CTX *ctx = (WOLFSSL_CTX *)v_ctx; (void) args; - + WOLFSSL *ssl; int len; #define BUFF_SIZE 256 char buff[BUFF_SIZE]; T_IPV4EP dst_addr = {0, 0}; - + if((ercd = tcp_acp_cep(cepid, repid, &dst_addr, TMO_FEVR)) != E_OK) { printf("ERROR TCP Accept: %d\n", ercd); return; @@ -146,7 +146,7 @@ void wolfSSL_TLS_server(void *v_ctx, func_args *args) printf("ERROR: failed wolfSSL_new\n"); return; } - + wolfSSL_SetIOReadCtx(ssl, (void *)&cepid); wolfSSL_SetIOWriteCtx(ssl, (void *)&cepid); @@ -154,20 +154,20 @@ void wolfSSL_TLS_server(void *v_ctx, func_args *args) printf("ERROR: SSL Accept(%d)\n", wolfSSL_get_error(ssl, 0)); return; } - + if ((len = wolfSSL_read(ssl, buff, sizeof(buff) - 1)) < 0) { printf("ERROR: SSL Read(%d)\n", wolfSSL_get_error(ssl, 0)); return; } - + buff[len] = '\0'; - printf("Recieved: %s\n", buff); - + printf("Received: %s\n", buff); + if (wolfSSL_write(ssl, buff, len) != len) { - printf("ERROR: SSL Wirte(%d)\n", wolfSSL_get_error(ssl, 0)); + printf("ERROR: SSL Write(%d)\n", wolfSSL_get_error(ssl, 0)); return; } - + wolfSSL_free(ssl); tcp_sht_cep(cepid); } diff --git a/doc/dox_comments/header_files/wolfio.h b/doc/dox_comments/header_files/wolfio.h index 99ba827f6..1588b3c46 100644 --- a/doc/dox_comments/header_files/wolfio.h +++ b/doc/dox_comments/header_files/wolfio.h @@ -137,7 +137,7 @@ WOLFSSL_API int EmbedReceiveFrom(WOLFSSL* ssl, char* buf, int sz, void*); \param buf a char pointer representing the buffer. \param sz the size of the buffer. \param ctx a void pointer to the user registered context. The default case - is a WOLFSSL_DTLS_CTX sructure. + is a WOLFSSL_DTLS_CTX structure. _Example_ \code diff --git a/src/ssl.c b/src/ssl.c index fc3442a61..8f5ea584f 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -575,7 +575,7 @@ int wolfSSL_use_old_poly(WOLFSSL* ssl, int value) #ifndef WOLFSSL_NO_TLS12 WOLFSSL_ENTER("SSL_use_old_poly"); WOLFSSL_MSG("Warning SSL connection auto detects old/new and this function" - "is depriciated"); + "is depreciated"); ssl->options.oldPoly = (word16)value; WOLFSSL_LEAVE("SSL_use_old_poly", 0); #endif @@ -1410,7 +1410,7 @@ int wolfSSL_GetOutputSize(WOLFSSL* ssl, int inSz) int wolfSSL_CTX_SetMinEccKey_Sz(WOLFSSL_CTX* ctx, short keySz) { if (ctx == NULL || keySz < 0 || keySz % 8 != 0) { - WOLFSSL_MSG("Key size must be divisable by 8 or ctx was null"); + WOLFSSL_MSG("Key size must be divisible by 8 or ctx was null"); return BAD_FUNC_ARG; } @@ -1425,7 +1425,7 @@ int wolfSSL_CTX_SetMinEccKey_Sz(WOLFSSL_CTX* ctx, short keySz) int wolfSSL_SetMinEccKey_Sz(WOLFSSL* ssl, short keySz) { if (ssl == NULL || keySz < 0 || keySz % 8 != 0) { - WOLFSSL_MSG("Key size must be divisable by 8 or ssl was null"); + WOLFSSL_MSG("Key size must be divisible by 8 or ssl was null"); return BAD_FUNC_ARG; } @@ -1439,7 +1439,7 @@ int wolfSSL_SetMinEccKey_Sz(WOLFSSL* ssl, short keySz) int wolfSSL_CTX_SetMinRsaKey_Sz(WOLFSSL_CTX* ctx, short keySz) { if (ctx == NULL || keySz < 0 || keySz % 8 != 0) { - WOLFSSL_MSG("Key size must be divisable by 8 or ctx was null"); + WOLFSSL_MSG("Key size must be divisible by 8 or ctx was null"); return BAD_FUNC_ARG; } @@ -1452,7 +1452,7 @@ int wolfSSL_CTX_SetMinRsaKey_Sz(WOLFSSL_CTX* ctx, short keySz) int wolfSSL_SetMinRsaKey_Sz(WOLFSSL* ssl, short keySz) { if (ssl == NULL || keySz < 0 || keySz % 8 != 0) { - WOLFSSL_MSG("Key size must be divisable by 8 or ssl was null"); + WOLFSSL_MSG("Key size must be divisible by 8 or ssl was null"); return BAD_FUNC_ARG; } @@ -2708,7 +2708,7 @@ int wolfSSL_get_error(WOLFSSL* ssl, int ret) } -/* retrive alert history, WOLFSSL_SUCCESS on ok */ +/* retrieve alert history, WOLFSSL_SUCCESS on ok */ int wolfSSL_get_alert_history(WOLFSSL* ssl, WOLFSSL_ALERT_HISTORY *h) { if (ssl && h) { @@ -7030,7 +7030,7 @@ int wolfSSL_check_private_key(const WOLFSSL* ssl) /* Looks for the extension matching the passed in nid * - * c : if not null then is set to status value -2 if multiple occurances + * c : if not null then is set to status value -2 if multiple occurrences * of the extension are found, -1 if not found, 0 if found and not * critical, and 1 if found and critical. * nid : Extension OID to be found. @@ -10283,7 +10283,7 @@ int AddSession(WOLFSSL* ssl) } #ifdef OPENSSL_EXTRA - /* If using compatibilty layer then check for and copy over session context + /* If using compatibility layer then check for and copy over session context * id. */ if (ssl->sessionCtxSz > 0 && ssl->sessionCtxSz < ID_LEN) { XMEMCPY(session->sessionCtx, ssl->sessionCtx, ssl->sessionCtxSz); @@ -10539,7 +10539,7 @@ static int get_locked_session_stats(word32* active, word32* total, word32* peak) break; } - /* if not expried then good */ + /* if not expired then good */ if (ticks < (SessionCache[i].Sessions[idx].bornOn + SessionCache[i].Sessions[idx].timeout) ) { now++; @@ -14388,7 +14388,7 @@ int wolfSSL_EVP_MD_type(const WOLFSSL_EVP_MD *md) /* frees all nodes in the current threads error queue * - * id thread id. ERR_remove_state is depriciated and id is ignored. The + * id thread id. ERR_remove_state is depreciated and id is ignored. The * current threads queue will be free'd. */ void wolfSSL_ERR_remove_state(unsigned long id) @@ -14949,7 +14949,7 @@ int wolfSSL_EVP_MD_type(const WOLFSSL_EVP_MD *md) /* Similar to wolfSSL_ERR_get_error_line but takes in a flags argument for - * more flexability. + * more flexibility. * * file output pointer to file where error happened * line output to line number of error @@ -17183,7 +17183,7 @@ WOLFSSL_EVP_PKEY* wolfSSL_X509_get_pubkey(WOLFSSL_X509* x509) } XFREE(rawKey, NULL, DYNAMIC_TYPE_TMP_BUFFER); - /* print out remaning modulus values */ + /* print out remaining modulus values */ if ((idx > 0) && (((idx - 1 + lbit) % 15) != 0)) { tmp[sizeof(tmp) - 1] = '\0'; if (wolfSSL_BIO_write(bio, tmp, @@ -17306,7 +17306,7 @@ WOLFSSL_EVP_PKEY* wolfSSL_X509_get_pubkey(WOLFSSL_X509* x509) XSTRNCAT(tmp, val, valSz); } - /* print out remaning modulus values */ + /* print out remaining modulus values */ if ((i > 0) && (((i - 1) % 15) != 0)) { tmp[sizeof(tmp) - 1] = '\0'; if (wolfSSL_BIO_write(bio, tmp, @@ -17520,7 +17520,7 @@ WOLFSSL_EVP_PKEY* wolfSSL_X509_get_pubkey(WOLFSSL_X509* x509) } XFREE(sig, NULL, DYNAMIC_TYPE_TMP_BUFFER); - /* print out remaning sig values */ + /* print out remaining sig values */ if ((i > 0) && (((i - 1) % 18) != 0)) { tmp[sizeof(tmp) - 1] = '\0'; if (wolfSSL_BIO_write(bio, tmp, (int)XSTRLEN(tmp)) @@ -17906,7 +17906,7 @@ WOLFSSL_BIO_METHOD* wolfSSL_BIO_f_base64(void) /* Set the flag for the bio. * - * bio the structre to set the flag in + * bio the structure to set the flag in * flags the flag to use */ void wolfSSL_BIO_set_flags(WOLFSSL_BIO* bio, int flags) @@ -18313,7 +18313,7 @@ static int wolfSSL_i2d_PrivateKey(WOLFSSL_EVP_PKEY* key, unsigned char** der) * cert certificate to go into PKCS12 bundle * ca extra certificates that can be added to bundle. Can be NULL * keyNID type of encryption to use on the key (-1 means no encryption) - * certNID type of ecnryption to use on the certificate + * certNID type of encryption to use on the certificate * itt number of iterations with encryption * macItt number of iterations with mac creation * keyType flag for signature and/or encryption key @@ -19197,7 +19197,7 @@ WOLFSSL_EVP_PKEY* wolfSSL_PKEY_new_ex(void* heap) #endif if (ret != 0){ wolfSSL_EVP_PKEY_free(pkey); - WOLFSSL_MSG("memory falure"); + WOLFSSL_MSG("memory failure"); return NULL; } } @@ -19354,7 +19354,7 @@ WOLFSSL_ASN1_INTEGER* wolfSSL_X509_get_serialNumber(WOLFSSL_X509* x509) /* Make sure there is space for the data, ASN.1 type and length. */ if (x509->serialSz > (WOLFSSL_ASN1_INTEGER_MAX - 2)) { - /* dynamicly create data buffer, +2 for type and length */ + /* dynamically create data buffer, +2 for type and length */ a->data = (unsigned char*)XMALLOC(x509->serialSz + 2, NULL, DYNAMIC_TYPE_OPENSSL); if (a->data == NULL) { @@ -19589,7 +19589,7 @@ void wolfSSL_X509_STORE_CTX_set_error(WOLFSSL_X509_STORE_CTX* ctx, int er) * WOLFSSL objects that have been created by the WOLFSSL_CTX structure passed * in. * - * ctx WOLFSSL_CTX structre to set callback function in + * ctx WOLFSSL_CTX structure to set callback function in * f callback function to use */ void wolfSSL_CTX_set_info_callback(WOLFSSL_CTX* ctx, @@ -21318,7 +21318,7 @@ void wolfSSL_DES_set_odd_parity(WOLFSSL_DES_cblock* myDes) #ifdef WOLFSSL_DES_ECB -/* Encrpyt or decrypt input message desa with key and get output in desb. +/* Encrypt or decrypt input message desa with key and get output in desb. * if enc is DES_ENCRYPT,input message is encrypted or * if enc is DES_DECRYPT,input message is decrypted. * */ @@ -21341,7 +21341,7 @@ void wolfSSL_DES_ecb_encrypt(WOLFSSL_DES_cblock* desa, if (enc){ if (wc_Des_EcbEncrypt(&myDes, (byte*) desb, (const byte*) desa, sizeof(WOLFSSL_DES_cblock)) != 0){ - WOLFSSL_MSG("wc_Des_EcbEncrpyt return error."); + WOLFSSL_MSG("wc_Des_EcbEncrypt return error."); } } else { if (wc_Des_EcbDecrypt(&myDes, (byte*) desb, (const byte*) desa, @@ -21502,7 +21502,7 @@ int wolfSSL_AES_set_decrypt_key(const unsigned char *key, const int bits, #ifdef HAVE_AES_ECB /* Encrypt/decrypt a 16 byte block of data using the key passed in. * - * in buffer to encrypt/decyrpt + * in buffer to encrypt/decrypt * out buffer to hold result of encryption/decryption * key AES structure to use with encryption/decryption * enc AES_ENCRPT for encryption and AES_DECRYPT for decryption @@ -21539,9 +21539,9 @@ void wolfSSL_AES_ecb_encrypt(const unsigned char *in, unsigned char* out, #ifdef HAVE_AES_CBC /* Encrypt data using key and iv passed in. iv gets updated to most recent iv - * state after encryptiond/decryption. + * state after encryption/decryption. * - * in buffer to encrypt/decyrpt + * in buffer to encrypt/decrypt * out buffer to hold result of encryption/decryption * len length of input buffer * key AES structure to use with encryption/decryption @@ -21584,9 +21584,9 @@ void wolfSSL_AES_cbc_encrypt(const unsigned char *in, unsigned char* out, /* Encrypt data using CFB mode with key and iv passed in. iv gets updated to - * most recent iv state after encryptiond/decryption. + * most recent iv state after encryption/decryption. * - * in buffer to encrypt/decyrpt + * in buffer to encrypt/decrypt * out buffer to hold result of encryption/decryption * len length of input buffer * key AES structure to use with encryption/decryption @@ -22260,7 +22260,7 @@ const char* wolfSSL_RAND_file_name(char* fname, unsigned long len) * * fname name of file to write to * - * Returns the number of bytes writen + * Returns the number of bytes written */ int wolfSSL_RAND_write_file(const char* fname) { @@ -25407,7 +25407,7 @@ int wolfSSL_RSA_verify(int type, const unsigned char* m, XFREE(sigRet, NULL, DYNAMIC_TYPE_TMP_BUFFER); return WOLFSSL_FAILURE; } - /* get non-encrypted signature to be compared with decrypted sugnature*/ + /* get non-encrypted signature to be compared with decrypted signature */ ret = wolfSSL_RSA_sign_ex(type, m, mLen, sigRet, &len, rsa, 0); if (ret <= 0) { WOLFSSL_MSG("Message Digest Error"); @@ -25636,7 +25636,7 @@ int wolfSSL_HmacCopy(Hmac* des, Hmac* src) /* Deep copy of information from src to des structure * * des destination to copy information to - * src structure to get infromation from + * src structure to get information from * * Returns WOLFSSL_SUCCESS on success and WOLFSSL_FAILURE on error */ @@ -28645,7 +28645,7 @@ static int pem_read_bio_key(WOLFSSL_BIO* bio, pem_password_cb* cb, void* pass, } } else if (bio->type == WOLFSSL_BIO_FILE) { - int sz = 100; /* read from file by 100 byte chuncks */ + int sz = 100; /* read from file by 100 byte chunks */ int idx = 0; char* tmp = (char*)XMALLOC(sz, bio->heap, DYNAMIC_TYPE_OPENSSL); @@ -28676,7 +28676,7 @@ static int pem_read_bio_key(WOLFSSL_BIO* bio, pem_password_cb* cb, void* pass, XMEMCPY(mem + idx, tmp, sz); memSz += sz; idx += sz; - sz = 100; /* read another 100 byte chunck from file */ + sz = 100; /* read another 100 byte chunk from file */ } XFREE(tmp, bio->heap, DYNAMIC_TYPE_OPENSSL); tmp = NULL; @@ -30621,7 +30621,7 @@ void* wolfSSL_GetDhAgreeCtx(WOLFSSL* ssl) /* AUX info is; trusted/rejected uses, friendly name, private key id, * and potentially a stack of "other" info. wolfSSL does not store * friendly name or private key id yet in WOLFSSL_X509 for human - * readibility and does not support extra trusted/rejected uses for + * readability and does not support extra trusted/rejected uses for * root CA. */ return wolfSSL_PEM_read_bio_X509(bp, x, cb, u); } @@ -32327,7 +32327,7 @@ void* wolfSSL_get_app_data(const WOLFSSL *ssl) * ssl WOLFSSL struct to set app data in * arg data to be stored * - * Returns SSL_SUCCESS on sucess and SSL_FAILURE on failure + * Returns SSL_SUCCESS on success and SSL_FAILURE on failure */ int wolfSSL_set_app_data(WOLFSSL *ssl, void* arg) { WOLFSSL_ENTER("wolfSSL_set_app_data"); @@ -34441,7 +34441,7 @@ int wolfSSL_i2a_ASN1_INTEGER(BIO *bp, const WOLFSSL_ASN1_INTEGER *a) /* Skip ASN.1 INTEGER (type) byte. */ i = 1; - /* When indefinte length, can't determine length with data available. */ + /* When indefinite length, can't determine length with data available. */ if (a->data[i] == 0x80) return 0; /* One length byte if less than 0x80. */ diff --git a/src/tls.c b/src/tls.c index 144b05ee6..502417e5a 100644 --- a/src/tls.c +++ b/src/tls.c @@ -7827,11 +7827,11 @@ int TLSX_PskKeModes_Use(WOLFSSL* ssl, byte modes) /******************************************************************************/ #if defined(WOLFSSL_TLS13) && defined(WOLFSSL_POST_HANDSHAKE_AUTH) -/* Get the size of the encoded Post-Hanshake Authentication extension. +/* Get the size of the encoded Post-Handshake Authentication extension. * Only in ClientHello. * * msgType The type of the message this extension is being written into. - * returns the number of bytes of the encoded Post-Hanshake Authentication + * returns the number of bytes of the encoded Post-Handshake Authentication * extension. */ static word16 TLSX_PostHandAuth_GetSize(byte msgType) diff --git a/src/tls13.c b/src/tls13.c index b2858a9fa..0676bfb1a 100644 --- a/src/tls13.c +++ b/src/tls13.c @@ -563,15 +563,15 @@ static int DeriveEarlyExporterSecret(WOLFSSL* ssl, byte* key) #endif #ifdef WOLFSSL_TLS13_DRAFT_18 -/* The length of the client hanshake label. */ +/* The length of the client handshake label. */ #define CLIENT_HANDSHAKE_LABEL_SZ 31 -/* The client hanshake label. */ +/* The client handshake label. */ static const byte clientHandshakeLabel[CLIENT_HANDSHAKE_LABEL_SZ + 1] = "client handshake traffic secret"; #else -/* The length of the client hanshake label. */ +/* The length of the client handshake label. */ #define CLIENT_HANDSHAKE_LABEL_SZ 12 -/* The client hanshake label. */ +/* The client handshake label. */ static const byte clientHandshakeLabel[CLIENT_HANDSHAKE_LABEL_SZ + 1] = "c hs traffic"; #endif @@ -1386,7 +1386,7 @@ static int HashInputRaw(WOLFSSL* ssl, const byte* input, int sz) * ssl The SSL/TLS object. * input The buffer holding the message data. * inOutIdx On entry, the index into the buffer of the handshake data. - * On exit, the start of the hanshake data. + * On exit, the start of the handshake data. * type Type of handshake message. * size The length of the handshake message data. * totalSz The total size of data in the buffer. @@ -1434,7 +1434,7 @@ static void AddTls13RecordHeader(byte* output, word32 length, byte type, /* Add handshake header to message. * - * output The buffer to write the hanshake header into. + * output The buffer to write the handshake header into. * length The length of the handshake data. * fragOffset The offset of the fragment data. (DTLS) * fragLength The length of the fragment data. (DTLS) @@ -2250,7 +2250,7 @@ static int CreateCookie(WOLFSSL* ssl, byte* hash, byte hashSz) } #endif -/* Restart the Hanshake hash with a hash of the previous messages. +/* Restart the handshake hash with a hash of the previous messages. * * ssl The SSL/TLS object. * returns 0 on success, otherwise failure. @@ -3634,7 +3634,7 @@ static int CheckCookie(WOLFSSL* ssl, byte* cookie, byte cookieSz) HRR_COOKIE_HDR_SZ) #endif -/* Restart the Hanshake hash from the cookie value. +/* Restart the handshake hash from the cookie value. * * ssl SSL/TLS object. * cookie Cookie data from client. @@ -4117,7 +4117,7 @@ int SendTls13HelloRetryRequest(WOLFSSL* ssl) /* Get position in output buffer to write new message to. */ output = ssl->buffers.outputBuffer.buffer + ssl->buffers.outputBuffer.length; - /* Add record and hanshake headers. */ + /* Add record and handshake headers. */ AddTls13Headers(output, length, hello_retry_request, ssl); /* The negotiated protocol version. */ @@ -6251,7 +6251,7 @@ static int DoTls13KeyUpdate(WOLFSSL* ssl, const byte* input, word32* inOutIdx, switch (input[i]) { case update_not_requested: - /* This message in response to any oustanding request. */ + /* This message in response to any outstanding request. */ ssl->keys.keyUpdateRespond = 0; ssl->keys.updateResponseReq = 0; break; @@ -6365,7 +6365,7 @@ static int DoTls13EndOfEarlyData(WOLFSSL* ssl, const byte* input, return BUFFER_ERROR; if (ssl->earlyData == no_early_data) { - WOLFSSL_MSG("EndOfEarlyData recieved unexpectedly"); + WOLFSSL_MSG("EndOfEarlyData received unexpectedly"); SendAlert(ssl, alert_fatal, unexpected_message); return OUT_OF_ORDER_E; } @@ -6394,7 +6394,7 @@ static int DoTls13EndOfEarlyData(WOLFSSL* ssl, const byte* input, * inOutIdx On entry, the index into the message buffer of Finished. * On exit, the index of byte after the Finished message and padding. * size The length of the current handshake message. - * retuns 0 on success, otherwise failure. + * returns 0 on success, otherwise failure. */ static int DoTls13NewSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx, word32 size) @@ -6525,7 +6525,7 @@ static int DoTls13NewSessionTicket(WOLFSSL* ssl, const byte* input, * message. * * ssl The SSL/TLS object. - * retuns 0 on success, otherwise failure. + * returns 0 on success, otherwise failure. */ static int ExpectedResumptionSecret(WOLFSSL* ssl) { @@ -6535,7 +6535,7 @@ static int ExpectedResumptionSecret(WOLFSSL* ssl) Digest digest; static byte header[] = { 0x14, 0x00, 0x00, 0x00 }; - /* Copy the running hash so we cna restore it after. */ + /* Copy the running hash so we can restore it after. */ switch (ssl->specs.mac_algorithm) { #ifndef NO_SHA256 case sha256_mac: @@ -6615,7 +6615,7 @@ static int ExpectedResumptionSecret(WOLFSSL* ssl) * Message contains the information required to perform resumption. * * ssl The SSL/TLS object. - * retuns 0 on success, otherwise failure. + * returns 0 on success, otherwise failure. */ static int SendTls13NewSessionTicket(WOLFSSL* ssl) { @@ -7122,10 +7122,10 @@ int DoTls13HandShakeMsgType(WOLFSSL* ssl, byte* input, word32* inOutIdx, /* above checks handshake state */ switch (type) { #ifndef NO_WOLFSSL_CLIENT - /* Messages only recieved by client. */ + /* Messages only received by client. */ #ifdef WOLFSSL_TLS13_DRAFT_18 case hello_retry_request: - WOLFSSL_MSG("processing hello rety request"); + WOLFSSL_MSG("processing hello retry request"); ret = DoTls13HelloRetryRequest(ssl, input, inOutIdx, size); break; #endif @@ -7165,7 +7165,7 @@ int DoTls13HandShakeMsgType(WOLFSSL* ssl, byte* input, word32* inOutIdx, #endif /* !NO_WOLFSSL_CLIENT */ #ifndef NO_WOLFSSL_SERVER - /* Messages only recieved by server. */ + /* Messages only received by server. */ case client_hello: WOLFSSL_MSG("processing client hello"); ret = DoTls13ClientHello(ssl, input, inOutIdx, size); @@ -7179,7 +7179,7 @@ int DoTls13HandShakeMsgType(WOLFSSL* ssl, byte* input, word32* inOutIdx, #endif #endif /* !NO_WOLFSSL_SERVER */ - /* Messages recieved by both client and server. */ + /* Messages received by both client and server. */ #ifndef NO_CERTS case certificate: WOLFSSL_MSG("processing certificate"); diff --git a/src/wolfio.c b/src/wolfio.c index 75c30312d..7abc931e2 100644 --- a/src/wolfio.c +++ b/src/wolfio.c @@ -501,7 +501,7 @@ int EmbedGenerateCookie(WOLFSSL* ssl, byte *buf, int sz, void *ctx) /* get the peer information in human readable form (ip, port, family) * default function assumes BSD sockets - * can be overriden with wolfSSL_CTX_SetIOGetPeer + * can be overridden with wolfSSL_CTX_SetIOGetPeer */ int EmbedGetPeer(WOLFSSL* ssl, char* ip, int* ipSz, unsigned short* port, int* fam) @@ -557,7 +557,7 @@ int EmbedGenerateCookie(WOLFSSL* ssl, byte *buf, int sz, void *ctx) /* set the peer information in human readable form (ip, port, family) * default function assumes BSD sockets - * can be overriden with wolfSSL_CTX_SetIOSetPeer + * can be overridden with wolfSSL_CTX_SetIOSetPeer */ int EmbedSetPeer(WOLFSSL* ssl, char* ip, int ipSz, unsigned short port, int fam) diff --git a/tests/api.c b/tests/api.c index 6a4748ffe..bd91d1c19 100644 --- a/tests/api.c +++ b/tests/api.c @@ -968,17 +968,17 @@ static void test_wolfSSL_CertManagerCRL(void) WOLFSSL_CERT_MANAGER* cm = NULL; AssertNotNull(cm = wolfSSL_CertManagerNew()); - AssertIntEQ(WOLFSSL_SUCCESS, + AssertIntEQ(WOLFSSL_SUCCESS, wolfSSL_CertManagerLoadCA(cm, ca_cert, NULL)); - AssertIntEQ(WOLFSSL_SUCCESS, + AssertIntEQ(WOLFSSL_SUCCESS, wolfSSL_CertManagerLoadCRL(cm, crl1, WOLFSSL_FILETYPE_PEM, 0)); - AssertIntEQ(WOLFSSL_SUCCESS, - wolfSSL_CertManagerLoadCRL(cm, crl2, WOLFSSL_FILETYPE_PEM, 0)); + AssertIntEQ(WOLFSSL_SUCCESS, + wolfSSL_CertManagerLoadCRL(cm, crl2, WOLFSSL_FILETYPE_PEM, 0)); wolfSSL_CertManagerFreeCRL(cm); - AssertIntEQ(WOLFSSL_SUCCESS, + AssertIntEQ(WOLFSSL_SUCCESS, wolfSSL_CertManagerLoadCRL(cm, crl1, WOLFSSL_FILETYPE_PEM, 0)); - AssertIntEQ(WOLFSSL_SUCCESS, + AssertIntEQ(WOLFSSL_SUCCESS, wolfSSL_CertManagerLoadCA(cm, ca_cert, NULL)); wolfSSL_CertManagerFree(cm); @@ -2683,7 +2683,7 @@ static void verify_SNI_ABSENT_on_server(WOLFSSL* ssl) static void verify_SNI_no_matching(WOLFSSL* ssl) { byte type = WOLFSSL_SNI_HOST_NAME; - char* request = (char*) &type; /* to be overwriten */ + char* request = (char*) &type; /* to be overwritten */ AssertIntEQ(WOLFSSL_SNI_NO_MATCH, wolfSSL_SNI_Status(ssl, type)); AssertNotNull(request); @@ -2731,15 +2731,15 @@ static void test_wolfSSL_UseSNI_connection(void) {0, 0, use_SNI_at_ssl, verify_SNI_real_matching, 0}, {0, 0, use_SNI_at_ssl, verify_SNI_real_matching, 0}, - /* default missmatch behavior */ + /* default mismatch behavior */ {0, 0, different_SNI_at_ssl, verify_FATAL_ERROR_on_client, 0}, {0, 0, use_SNI_at_ssl, verify_UNKNOWN_SNI_on_server, 0}, - /* continue on missmatch */ + /* continue on mismatch */ {0, 0, different_SNI_at_ssl, 0, 0}, {0, 0, use_SNI_WITH_CONTINUE_at_ssl, verify_SNI_no_matching, 0}, - /* fake answer on missmatch */ + /* fake answer on mismatch */ {0, 0, different_SNI_at_ssl, 0, 0}, {0, 0, use_SNI_WITH_FAKE_ANSWER_at_ssl, verify_SNI_fake_matching, 0}, @@ -2755,11 +2755,11 @@ static void test_wolfSSL_UseSNI_connection(void) {0, 0, 0, verify_FATAL_ERROR_on_client, 0}, {0, 0, use_MANDATORY_SNI_at_ssl, verify_SNI_ABSENT_on_server, 0}, - /* sni abort - success when overwriten */ + /* sni abort - success when overwritten */ {0, 0, 0, 0, 0}, {0, use_MANDATORY_SNI_at_ctx, use_SNI_at_ssl, verify_SNI_no_matching, 0}, - /* sni abort - success when allowing missmatches */ + /* sni abort - success when allowing mismatches */ {0, 0, different_SNI_at_ssl, 0, 0}, {0, use_PSEUDO_MANDATORY_SNI_at_ctx, 0, verify_SNI_fake_matching, 0}, }; @@ -3153,7 +3153,7 @@ static void test_wolfSSL_UseALPN_connection(void) {0, 0, 0, 0, 0}, {0, 0, use_ALPN_all, 0, 0}, - /* success case missmatch behavior but option 'continue' set */ + /* success case mismatch behavior but option 'continue' set */ {0, 0, use_ALPN_all_continue, verify_ALPN_not_matching_continue, 0}, {0, 0, use_ALPN_unknown_continue, 0, 0}, @@ -3161,12 +3161,12 @@ static void test_wolfSSL_UseALPN_connection(void) {0, 0, use_ALPN_all, 0, 0}, {0, 0, use_ALPN_one, verify_ALPN_client_list, 0}, - /* missmatch behavior with same list + /* mismatch behavior with same list * the first and only this one must be taken */ {0, 0, use_ALPN_all, 0, 0}, {0, 0, use_ALPN_all, verify_ALPN_not_matching_spdy3, 0}, - /* default missmatch behavior */ + /* default mismatch behavior */ {0, 0, use_ALPN_all, 0, 0}, {0, 0, use_ALPN_unknown, verify_ALPN_FATAL_ERROR_on_client, 0}, }; @@ -16999,7 +16999,7 @@ static void test_wolfSSL_private_keys(void) (unsigned char*)client_key_der_2048, sizeof_client_key_der_2048), WOLFSSL_SUCCESS); #ifndef HAVE_USER_RSA - /* Should missmatch now that a different private key loaded */ + /* Should mismatch now that a different private key loaded */ AssertIntNE(wolfSSL_check_private_key(ssl), WOLFSSL_SUCCESS); #endif @@ -17501,13 +17501,13 @@ static void test_wolfSSL_EVP_Digest(void) "\x23\xB0\x03\x61\xA3\x96\x17\x7A\x9C\xB4\x10\xFF\x61\xF2\x00" "\x15\xAD"; printf(testingFmt, "wolfSSL_EVP_Digest()"); - + AssertIntEQ(wolfSSL_EVP_Digest((unsigned char*)in, inLen, out, &outLen, "SHA256", NULL), 1); AssertIntEQ(outLen, WC_SHA256_DIGEST_SIZE); AssertIntEQ(XMEMCMP(out, expOut, WC_SHA256_DIGEST_SIZE), 0); - + printf(resultFmt, passed); - + #endif /* OPEN_EXTRA && ! NO_SHA256 */ } @@ -17518,8 +17518,8 @@ static void test_wolfSSL_EVP_MD_size(void) WOLFSSL_EVP_MD_CTX mdCtx; printf(testingFmt, "wolfSSL_EVP_MD_size()"); - -#ifndef NO_SHA256 + +#ifndef NO_SHA256 wolfSSL_EVP_MD_CTX_init(&mdCtx); AssertIntEQ(wolfSSL_EVP_DigestInit(&mdCtx, "SHA256"), 1); @@ -17529,9 +17529,9 @@ static void test_wolfSSL_EVP_MD_size(void) #endif -#ifndef NO_MD5 +#ifndef NO_MD5 wolfSSL_EVP_MD_CTX_init(&mdCtx); - + AssertIntEQ(wolfSSL_EVP_DigestInit(&mdCtx, "MD5"), 1); AssertIntEQ(wolfSSL_EVP_MD_CTX_size(&mdCtx), WC_MD5_DIGEST_SIZE); AssertIntEQ(wolfSSL_EVP_MD_CTX_block_size(&mdCtx), WC_MD5_BLOCK_SIZE); @@ -17539,9 +17539,9 @@ static void test_wolfSSL_EVP_MD_size(void) #endif -#ifdef WOLFSSL_SHA224 +#ifdef WOLFSSL_SHA224 wolfSSL_EVP_MD_CTX_init(&mdCtx); - + AssertIntEQ(wolfSSL_EVP_DigestInit(&mdCtx, "SHA224"), 1); AssertIntEQ(wolfSSL_EVP_MD_CTX_size(&mdCtx), WC_SHA224_DIGEST_SIZE); AssertIntEQ(wolfSSL_EVP_MD_CTX_block_size(&mdCtx), WC_SHA224_BLOCK_SIZE); @@ -17549,9 +17549,9 @@ static void test_wolfSSL_EVP_MD_size(void) #endif -#ifdef WOLFSSL_SHA384 +#ifdef WOLFSSL_SHA384 wolfSSL_EVP_MD_CTX_init(&mdCtx); - + AssertIntEQ(wolfSSL_EVP_DigestInit(&mdCtx, "SHA384"), 1); AssertIntEQ(wolfSSL_EVP_MD_CTX_size(&mdCtx), WC_SHA384_DIGEST_SIZE); AssertIntEQ(wolfSSL_EVP_MD_CTX_block_size(&mdCtx), WC_SHA384_BLOCK_SIZE); @@ -17559,9 +17559,9 @@ static void test_wolfSSL_EVP_MD_size(void) #endif -#ifdef WOLFSSL_SHA512 +#ifdef WOLFSSL_SHA512 wolfSSL_EVP_MD_CTX_init(&mdCtx); - + AssertIntEQ(wolfSSL_EVP_DigestInit(&mdCtx, "SHA512"), 1); AssertIntEQ(wolfSSL_EVP_MD_CTX_size(&mdCtx), WC_SHA512_DIGEST_SIZE); AssertIntEQ(wolfSSL_EVP_MD_CTX_block_size(&mdCtx), WC_SHA512_BLOCK_SIZE); @@ -17569,9 +17569,9 @@ static void test_wolfSSL_EVP_MD_size(void) #endif -#ifndef NO_SHA +#ifndef NO_SHA wolfSSL_EVP_MD_CTX_init(&mdCtx); - + AssertIntEQ(wolfSSL_EVP_DigestInit(&mdCtx, "SHA"), 1); AssertIntEQ(wolfSSL_EVP_MD_CTX_size(&mdCtx), WC_SHA_DIGEST_SIZE); AssertIntEQ(wolfSSL_EVP_MD_CTX_block_size(&mdCtx), WC_SHA_BLOCK_SIZE); @@ -17580,14 +17580,14 @@ static void test_wolfSSL_EVP_MD_size(void) #endif /* error case */ wolfSSL_EVP_MD_CTX_init(&mdCtx); - + AssertIntEQ(wolfSSL_EVP_DigestInit(&mdCtx, ""), BAD_FUNC_ARG); AssertIntEQ(wolfSSL_EVP_MD_size(wolfSSL_EVP_MD_CTX_md(&mdCtx)), BAD_FUNC_ARG); AssertIntEQ(wolfSSL_EVP_MD_CTX_block_size(&mdCtx), BAD_FUNC_ARG); AssertIntEQ(wolfSSL_EVP_MD_CTX_cleanup(&mdCtx), 0); - + printf(resultFmt, passed); - + #endif /* OPENSSL_EXTRA */ } @@ -20219,7 +20219,7 @@ static void test_wolfSSL_sk_GENERAL_NAME(void) for (i = 0; i < sk_GENERAL_NAME_num(sk); i++) { GENERAL_NAME* gn = sk_GENERAL_NAME_value(sk, i); if (gn == NULL) { - printf("massive falure\n"); + printf("massive failure\n"); return -1; } diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 23dddef2a..ad8720f00 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -10025,7 +10025,7 @@ static int SetEccPublicKey(byte* output, ecc_key* key, int with_header) /* returns the size of buffer used, the public ECC key in DER format is stored in output buffer with_AlgCurve is a flag for when to include a header that has the Algorithm - and Curve infromation */ + and Curve information */ int wc_EccPublicKeyToDer(ecc_key* key, byte* output, word32 inLen, int with_AlgCurve) { diff --git a/wolfcrypt/src/pkcs7.c b/wolfcrypt/src/pkcs7.c index 5a741896c..aaf917bb8 100644 --- a/wolfcrypt/src/pkcs7.c +++ b/wolfcrypt/src/pkcs7.c @@ -2233,7 +2233,7 @@ int wc_PKCS7_EncodeSignedData_ex(PKCS7* pkcs7, const byte* hashBuf, word32 hashS /* Toggle detached signature mode on/off for PKCS#7/CMS SignedData content type. * By default wolfCrypt includes the data to be signed in the SignedData - * bundle. This data can be ommited in the case when a detached signature is + * bundle. This data can be omitted in the case when a detached signature is * being created. To enable generation of detached signatures, set flag to "1", * otherwise set to "0": * @@ -3396,7 +3396,7 @@ void wc_PKCS7_AllowDegenerate(PKCS7* pkcs7, word16 flag) * degenerate cases which can have no signer. * * By default expects type SIGNED_DATA (SignedData) which can have any number of - * elements in signerInfos collection, inluding zero. (RFC2315 section 9.1) + * elements in signerInfos collection, including zero. (RFC2315 section 9.1) * When adding support for the case of SignedAndEnvelopedData content types a * signer is required. In this case the PKCS7 flag noDegenerate could be set. */ diff --git a/wolfcrypt/src/port/af_alg/afalg_hash.c b/wolfcrypt/src/port/af_alg/afalg_hash.c index 4ab8a9100..57c3f95bd 100644 --- a/wolfcrypt/src/port/af_alg/afalg_hash.c +++ b/wolfcrypt/src/port/af_alg/afalg_hash.c @@ -288,7 +288,7 @@ int wc_Sha3_384_Update(wc_Sha3* sha, const byte* in, word32 sz) { #ifndef WOLFSSL_AFALG_HASH_KEEP if (sz % 4) { - WOLFSSL_MSG("Alignment issue. Message size needs to be divisable by 4") + WOLFSSL_MSG("Alignment issue. Message size needs to be divisible by 4") return BAD_FUNC_ARG; } #endif @@ -305,7 +305,7 @@ int wc_Sha3_384_Final(wc_Sha3* sha, byte* hash) #ifdef WOLFSSL_AFALG_HASH_KEEP if (sha->used % 4) { - WOLFSSL_MSG("Alignment issue. Message size needs to be divisable by 4"); + WOLFSSL_MSG("Alignment issue. Message size needs to be divisible by 4"); return BAD_FUNC_ARG; } #endif @@ -322,7 +322,7 @@ int wc_Sha3_384_GetHash(wc_Sha3* sha, byte* hash) #ifdef WOLFSSL_AFALG_HASH_KEEP if (sha->used % 4) { - WOLFSSL_MSG("Alignment issue. Message size needs to be divisable by 4"); + WOLFSSL_MSG("Alignment issue. Message size needs to be divisible by 4"); return BAD_FUNC_ARG; } #endif diff --git a/wolfcrypt/src/sp_int.c b/wolfcrypt/src/sp_int.c index d5a9ea44d..171df1e71 100644 --- a/wolfcrypt/src/sp_int.c +++ b/wolfcrypt/src/sp_int.c @@ -413,7 +413,7 @@ void sp_clamp(sp_int* a) * * a SP integer. * l Number of digits. - * retuns MP_MEM if the number of digits requested is more than available and + * returns MP_MEM if the number of digits requested is more than available and * MP_OKAY otherwise. */ int sp_grow(sp_int* a, int l) diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 122c08112..e3df4f272 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -8511,7 +8511,7 @@ int memory_test(void) for (i = 0; i < WOLFMEM_MAX_BUCKETS; i++) { if ((size[i] % WOLFSSL_STATIC_ALIGN) != 0) { - /* each element in array should be divisable by alignment size */ + /* each element in array should be divisible by alignment size */ return -6502; } } diff --git a/wolfssl/internal.h b/wolfssl/internal.h index 32551223a..5d52e29ae 100644 --- a/wolfssl/internal.h +++ b/wolfssl/internal.h @@ -1334,13 +1334,13 @@ enum Misc { EVP_SALT_SIZE = 8, /* evp salt size 64 bits */ -#ifndef ECDHE_SIZE /* allow this to be overriden at compile-time */ +#ifndef ECDHE_SIZE /* allow this to be overridden at compile-time */ ECDHE_SIZE = 32, /* ECHDE server size defaults to 256 bit */ #endif MAX_EXPORT_ECC_SZ = 256, /* Export ANS X9.62 max future size */ MAX_CURVE_NAME_SZ = 16, /* Maximum size of curve name string */ - NEW_SA_MAJOR = 8, /* Most signicant byte used with new sig algos */ + NEW_SA_MAJOR = 8, /* Most significant byte used with new sig algos */ ED25519_SA_MAJOR = 8, /* Most significant byte for ED25519 */ ED25519_SA_MINOR = 7, /* Least significant byte for ED25519 */ ED448_SA_MAJOR = 8, /* Most significant byte for ED448 */ @@ -1437,9 +1437,9 @@ enum Misc { #endif #endif /* WOLFSSL_MIN_ECC_BITS */ #if (WOLFSSL_MIN_ECC_BITS % 8) - /* Some ECC keys are not divisable by 8 such as prime239v1 or sect131r1. - In these cases round down to the nearest value divisable by 8. The - restriction of being divisable by 8 is in place to match wc_ecc_size + /* Some ECC keys are not divisible by 8 such as prime239v1 or sect131r1. + In these cases round down to the nearest value divisible by 8. The + restriction of being divisible by 8 is in place to match wc_ecc_size function from wolfSSL. */ #error ECC minimum bit size must be a multiple of 8 @@ -1456,7 +1456,7 @@ enum Misc { #endif /* WOLFSSL_MIN_RSA_BITS */ #if (WOLFSSL_MIN_RSA_BITS % 8) /* This is to account for the example case of a min size of 2050 bits but - still allows 2049 bit key. So we need the measurment to be in bytes. */ + still allows 2049 bit key. So we need the measurement to be in bytes. */ #error RSA minimum bit size must be a multiple of 8 #endif #define MIN_RSAKEY_SZ (WOLFSSL_MIN_RSA_BITS / 8) @@ -2416,7 +2416,7 @@ typedef struct PreSharedKey { byte cipherSuite0; /* Cipher Suite */ byte cipherSuite; /* Cipher Suite */ word32 binderLen; /* Length of HMAC */ - byte binder[WC_MAX_DIGEST_SIZE]; /* HMAC of hanshake */ + byte binder[WC_MAX_DIGEST_SIZE]; /* HMAC of handshake */ byte hmac; /* HMAC algorithm */ byte resumption:1; /* Resumption PSK */ byte chosen:1; /* Server's choice */ @@ -2650,7 +2650,7 @@ struct WOLFSSL_CTX { #if defined(WOLFSSL_MULTICAST) && defined(WOLFSSL_DTLS) CallbackMcastHighwater mcastHwCb; /* Sequence number highwater callback */ word32 mcastFirstSeq; /* first trigger level */ - word32 mcastSecondSeq; /* second tigger level */ + word32 mcastSecondSeq; /* second trigger level */ word32 mcastMaxSeq; /* max level */ #endif #ifdef HAVE_OCSP @@ -3235,7 +3235,7 @@ typedef struct Options { word16 useClientOrder:1; /* Use client's cipher order */ #if defined(WOLFSSL_TLS13) && defined(WOLFSSL_POST_HANDSHAKE_AUTH) word16 postHandshakeAuth:1;/* Client send post_handshake_auth - * extendion. */ + * extension */ #endif #if defined(WOLFSSL_TLS13) && !defined(NO_WOLFSSL_SERVER) word16 sendCookie:1; /* Server creates a Cookie in HRR */ @@ -3334,7 +3334,7 @@ typedef struct Arrays { struct WOLFSSL_STACK { unsigned long num; /* number of nodes in stack - * (saftey measure for freeing and shortcut for count) */ + * (safety measure for freeing and shortcut for count) */ union { WOLFSSL_X509* x509; WOLFSSL_X509_NAME* name; diff --git a/wolfssl/wolfcrypt/random.h b/wolfssl/wolfcrypt/random.h index 28d6fc851..370e94a03 100644 --- a/wolfssl/wolfcrypt/random.h +++ b/wolfssl/wolfcrypt/random.h @@ -88,7 +88,7 @@ * seeded via wc_GenerateSeed. This is the default source. */ - /* Seed source can be overriden by defining one of these: + /* Seed source can be overridden by defining one of these: CUSTOM_RAND_GENERATE_SEED CUSTOM_RAND_GENERATE_SEED_OS CUSTOM_RAND_GENERATE */