From: Victor Julien Date: Sat, 6 May 2023 06:51:41 +0000 (+0200) Subject: app-layer: spelling X-Git-Tag: suricata-7.0.0-rc2~236 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f28459ed785d212d9e27788e2b577cd73d5c0b1a;p=thirdparty%2Fsuricata.git app-layer: spelling --- diff --git a/src/app-layer-detect-proto.c b/src/app-layer-detect-proto.c index 7c5ed84f88..39e36bd317 100644 --- a/src/app-layer-detect-proto.c +++ b/src/app-layer-detect-proto.c @@ -1836,7 +1836,7 @@ bool AppLayerRequestProtocolChange(Flow *f, uint16_t dp, AppProto expect_proto) { if (FlowChangeProto(f)) { // If we are already changing protocols, from SMTP to TLS for instance, - // and that we do not get TLS but HTTP1, which is requesting whange to HTTP2, + // and that we do not get TLS but HTTP1, which is requesting change to HTTP2, // we do not proceed the new protocol change return false; } diff --git a/src/app-layer-detect-proto.h b/src/app-layer-detect-proto.h index e97b35cc4e..4ee4bac10a 100644 --- a/src/app-layer-detect-proto.h +++ b/src/app-layer-detect-proto.h @@ -108,7 +108,7 @@ int AppLayerProtoDetectPMRegisterPatternCI(uint8_t ipproto, AppProto alproto, * \brief The first function to be called. This initializes a global * protocol detection context. * - * \retval 0 On succcess; + * \retval 0 On success; * \retval -1 On failure. */ int AppLayerProtoDetectSetup(void); diff --git a/src/app-layer-dnp3-objects.c b/src/app-layer-dnp3-objects.c index 9c3d9a53c9..0bf9cd37bd 100644 --- a/src/app-layer-dnp3-objects.c +++ b/src/app-layer-dnp3-objects.c @@ -351,7 +351,7 @@ static int DNP3ReadPrefix( /** * \brief Add an object to a DNP3PointList. * - * \retval 1 if successfull, 0 on failure. + * \retval 1 if successful, 0 on failure. */ static int DNP3AddPoint(DNP3PointList *list, void *object, uint32_t point_index, uint8_t prefix_code, uint32_t prefix) diff --git a/src/app-layer-dnp3.c b/src/app-layer-dnp3.c index 3ef50bb8aa..21abfaaeb6 100644 --- a/src/app-layer-dnp3.c +++ b/src/app-layer-dnp3.c @@ -321,7 +321,7 @@ static uint16_t DNP3ProbingParser(Flow *f, uint8_t direction, } /** - * \brief Caculate the length of the transport layer with CRCs removed. + * \brief Calculate the length of the transport layer with CRCs removed. * * \param input_len The length of the transport layer buffer. * @@ -663,7 +663,7 @@ static void DNP3ObjectFree(DNP3Object *object) } /** - * \breif Allocate a DNP3 object. + * \brief Allocate a DNP3 object. */ static DNP3Object *DNP3ObjectAlloc(void) { diff --git a/src/app-layer-enip-common.c b/src/app-layer-enip-common.c index cb4fb01c72..305eb8312b 100644 --- a/src/app-layer-enip-common.c +++ b/src/app-layer-enip-common.c @@ -565,9 +565,8 @@ int DecodeCIPRequestPDU(const uint8_t *input, uint32_t input_len, return ret; } - /** - * \brief Deocde CIP Request Path + * \brief Decode CIP Request Path * @param input, input_len data stream * @param enip_data stores data from Packet * @param offset current point in the packet diff --git a/src/app-layer-expectation.c b/src/app-layer-expectation.c index c7e4f3aa49..7a456f87a3 100644 --- a/src/app-layer-expectation.c +++ b/src/app-layer-expectation.c @@ -244,7 +244,7 @@ int AppLayerExpectationCreate(Flow *f, int direction, Port src, Port dst, exp_list = IPPairGetStorageById(ipp, g_ippair_expectation_id); if (exp_list) { CIRCLEQ_INSERT_HEAD(&exp_list->list, exp, entries); - /* In case there is already EXPECTATION_MAX_LEVEL expectations waiting to be fullfill, + /* In case there is already EXPECTATION_MAX_LEVEL expectations waiting to be fulfilled, * we remove the older expectation to limit the total number of expectations */ if (exp_list->length >= EXPECTATION_MAX_LEVEL) { Expectation *last_exp = CIRCLEQ_LAST(&exp_list->list); diff --git a/src/app-layer-ftp.c b/src/app-layer-ftp.c index a47b0502ed..7f0accadc1 100644 --- a/src/app-layer-ftp.c +++ b/src/app-layer-ftp.c @@ -1097,7 +1097,7 @@ static AppLayerResult FTPDataParse(Flow *f, FtpDataState *ftpdata_state, } } - BUG_ON((direction & ftpdata_state->direction) == 0); // should be unreachble + BUG_ON((direction & ftpdata_state->direction) == 0); // should be unreachable if (eof) { ret = FileCloseFile(ftpdata_state->files, &sbcfg, NULL, 0, flags); ftpdata_state->state = FTPDATA_STATE_FINISHED; diff --git a/src/app-layer-htp-range.c b/src/app-layer-htp-range.c index 88c4adba38..3cdde35ba2 100644 --- a/src/app-layer-htp-range.c +++ b/src/app-layer-htp-range.c @@ -352,7 +352,7 @@ static HttpRangeContainerBlock *HttpRangeOpenFile(HttpRangeContainerFile *c, uin HttpRangeContainerBlock *r = HttpRangeOpenFileAux(c, start, end, total, sbcfg, name, name_len, flags); if (HttpRangeAppendData(sbcfg, r, data, len) < 0) { - SCLogDebug("Failed to append data while openeing"); + SCLogDebug("Failed to append data while opening"); } return r; } @@ -409,7 +409,7 @@ int HttpRangeAppendData(const StreamingBufferConfig *sbcfg, HttpRangeContainerBl int r = 0; if (c->files) { if (data == NULL) { - // gap overlaping already known data + // gap overlapping already known data r = FileAppendData(c->files, sbcfg, NULL, len - c->toskip); } else { r = FileAppendData(c->files, sbcfg, data + c->toskip, len - c->toskip); @@ -464,7 +464,7 @@ static void HttpRangeFileClose( } /** - * \note if `f` is non-NULL, the ownership of the file is transfered to the caller. + * \note if `f` is non-NULL, the ownership of the file is transferred to the caller. */ File *HttpRangeClose(const StreamingBufferConfig *sbcfg, HttpRangeContainerBlock *c, uint16_t flags) { diff --git a/src/app-layer-htp.c b/src/app-layer-htp.c index f750d61d4e..210283e071 100644 --- a/src/app-layer-htp.c +++ b/src/app-layer-htp.c @@ -3174,7 +3174,7 @@ static int HTPRegisterPatternsForProtocolDetection(void) } } - /* Loop through all the http verions patterns that are TO_CLIENT */ + /* Loop through all the http version patterns that are TO_CLIENT */ for (versions_pos = 0; versions[versions_pos]; versions_pos++) { register_result = AppLayerProtoDetectPMRegisterPatternCI(IPPROTO_TCP, ALPROTO_HTTP1, versions[versions_pos], (uint16_t)strlen(versions[versions_pos]), 0, diff --git a/src/app-layer-parser.c b/src/app-layer-parser.c index fc60b98b9a..7783c076b6 100644 --- a/src/app-layer-parser.c +++ b/src/app-layer-parser.c @@ -158,7 +158,7 @@ struct AppLayerParserState_ { enum ExceptionPolicy g_applayerparser_error_policy = EXCEPTION_POLICY_NOT_SET; -static void AppLayerConfg(void) +static void AppLayerConfig(void) { g_applayerparser_error_policy = ExceptionPolicyParse("app-layer.error-policy", true); } @@ -1740,7 +1740,7 @@ void AppLayerParserRegisterProtocolParsers(void) { SCEnter(); - AppLayerConfg(); + AppLayerConfig(); RegisterHTPParsers(); RegisterSSLParsers(); @@ -1861,7 +1861,7 @@ typedef struct TestState_ { /** * \brief Test parser function to test the memory deallocation of app layer - * parser of occurence of an error. + * parser of occurrence of an error. */ static AppLayerResult TestProtocolParser(Flow *f, void *test_state, AppLayerParserState *pstate, StreamSlice stream_slice, void *local_data) @@ -1933,7 +1933,7 @@ void AppLayerParserRestoreParserTable(void) } /** - * \test Test the deallocation of app layer parser memory on occurance of + * \test Test the deallocation of app layer parser memory on occurrence of * error in the parsing process. */ static int AppLayerParserTest01(void) @@ -1978,7 +1978,7 @@ static int AppLayerParserTest01(void) } /** - * \test Test the deallocation of app layer parser memory on occurance of + * \test Test the deallocation of app layer parser memory on occurrence of * error in the parsing process for UDP. */ static int AppLayerParserTest02(void) diff --git a/src/app-layer-protos.h b/src/app-layer-protos.h index b0a5db1c8a..dd372550cb 100644 --- a/src/app-layer-protos.h +++ b/src/app-layer-protos.h @@ -84,7 +84,7 @@ static inline bool AppProtoIsValid(AppProto a) return ((a > ALPROTO_UNKNOWN && a < ALPROTO_FAILED)); } -// wether a signature AppProto matches a flow (or signature) AppProto +// whether a signature AppProto matches a flow (or signature) AppProto static inline bool AppProtoEquals(AppProto sigproto, AppProto alproto) { switch (sigproto) { diff --git a/src/app-layer-smtp.c b/src/app-layer-smtp.c index d48c23bf11..bdd61d3464 100644 --- a/src/app-layer-smtp.c +++ b/src/app-layer-smtp.c @@ -952,7 +952,7 @@ static int SMTPProcessReply(SMTPState *state, Flow *f, AppLayerParserState *psta /* reply but not a command we have stored, fall through */ } else if (IsReplyToCommand(state, SMTP_COMMAND_STARTTLS)) { if (reply_code == SMTP_REPLY_220) { - /* we are entering STARRTTLS data mode */ + /* we are entering STARTTLS data mode */ state->parser_state |= SMTP_PARSER_STATE_COMMAND_DATA_MODE; if (!AppLayerRequestProtocolTLSUpgrade(f)) { SMTPSetEvent(state, SMTP_DECODER_EVENT_FAILED_PROTOCOL_CHANGE); diff --git a/src/app-layer-ssl.c b/src/app-layer-ssl.c index 59856e44fd..d754d93924 100644 --- a/src/app-layer-ssl.c +++ b/src/app-layer-ssl.c @@ -2374,7 +2374,7 @@ static struct SSLDecoderResult SSLv3Decode(uint8_t direction, SSLState *ssl_stat ((ssl_state->flags & SSL_AL_FLAG_STATE_SERVER_HELLO) == 0)) break; - /* if we see (encrypted) aplication data, then this means the + /* if we see (encrypted) application data, then this means the handshake must be done */ ssl_state->flags |= SSL_AL_FLAG_HANDSHAKE_DONE; @@ -2400,7 +2400,7 @@ static struct SSLDecoderResult SSLv3Decode(uint8_t direction, SSLState *ssl_stat case SSLV3_HANDSHAKE_PROTOCOL: { if (ssl_state->flags & SSL_AL_FLAG_CHANGE_CIPHER_SPEC) { /* In TLSv1.3, ChangeCipherSpec is only used for middlebox - compability (rfc8446, appendix D.4). */ + compatibility (rfc8446, appendix D.4). */ // Client hello flags is needed to have a valid version if ((ssl_state->flags & SSL_AL_FLAG_STATE_CLIENT_HELLO) && (ssl_state->client_connp.version > TLS_VERSION_12) && @@ -2474,7 +2474,7 @@ static struct SSLDecoderResult SSLv3Decode(uint8_t direction, SSLState *ssl_stat * \brief SSLv2, SSLv23, SSLv3, TLSv1.1, TLSv1.2, TLSv1.3 parser. * * On parsing error, this should be the only function that should reset - * the parser state, to avoid multiple functions in the chain reseting + * the parser state, to avoid multiple functions in the chain resetting * the parser state. * * \param direction 0 for toserver, 1 for toclient. @@ -2556,8 +2556,8 @@ static AppLayerResult SSLDecode(Flow *f, uint8_t direction, void *alstate, SSLv2Decode(direction, ssl_state, pstate, input, input_len, stream_slice); if (r.retval < 0 || r.retval > input_len) { DEBUG_VALIDATE_BUG_ON(r.retval > input_len); - SCLogDebug("Error parsing SSLv2. Reseting parser " - "state. Let's get outta here"); + SCLogDebug("Error parsing SSLv2. Resetting parser " + "state. Let's get outta here"); SSLParserReset(ssl_state); SSLSetEvent(ssl_state, TLS_DECODER_EVENT_INVALID_SSL_RECORD); @@ -2583,8 +2583,8 @@ static AppLayerResult SSLDecode(Flow *f, uint8_t direction, void *alstate, SSLv3Decode(direction, ssl_state, pstate, input, input_len, stream_slice); if (r.retval < 0 || r.retval > input_len) { DEBUG_VALIDATE_BUG_ON(r.retval > input_len); - SCLogDebug("Error parsing TLS. Reseting parser " - "state. Let's get outta here"); + SCLogDebug("Error parsing TLS. Resetting parser " + "state. Let's get outta here"); SSLParserReset(ssl_state); return APP_LAYER_ERROR; } else if (r.needed) { diff --git a/src/app-layer.c b/src/app-layer.c index 0e244caf20..6d4ac2ea8f 100644 --- a/src/app-layer.c +++ b/src/app-layer.c @@ -464,7 +464,7 @@ static int TCPProtoDetect(ThreadVars *tv, * * \todo We need to figure out a more robust solution for this, * as this can lead to easy evasion tactics, where the - * attackeer can first send some dummy data in the wrong + * attacker can first send some dummy data in the wrong * direction first to mislead our proto detection process. * While doing this we need to update the parsers as well, * since the parsers must be robust to see such wrong