app-layer: spelling

pull/8828/head
Victor Julien 3 years ago
parent 5dc0a1f53b
commit f28459ed78

@ -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;
}

@ -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);

@ -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)

@ -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)
{

@ -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

@ -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);

@ -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;

@ -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)
{

@ -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,

@ -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)

@ -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) {

@ -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);

@ -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) {

@ -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

Loading…
Cancel
Save