|
|
|
@ -421,6 +421,9 @@ static int DetectTlsExpiredSetup (DetectEngineCtx *de_ctx, Signature *s,
|
|
|
|
|
|
|
|
|
|
SCLogDebug("\'%s\'", rawstr);
|
|
|
|
|
|
|
|
|
|
if (DetectSignatureSetAppProto(s, ALPROTO_TLS) != 0)
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
dd = SCCalloc(1, sizeof(DetectTlsValidityData));
|
|
|
|
|
if (dd == NULL) {
|
|
|
|
|
SCLogError(SC_ERR_INVALID_ARGUMENT,"Allocation \'%s\' failed", rawstr);
|
|
|
|
@ -433,12 +436,6 @@ static int DetectTlsExpiredSetup (DetectEngineCtx *de_ctx, Signature *s,
|
|
|
|
|
if (sm == NULL)
|
|
|
|
|
goto error;
|
|
|
|
|
|
|
|
|
|
if (s->alproto != ALPROTO_UNKNOWN && s->alproto != ALPROTO_TLS) {
|
|
|
|
|
SCLogError(SC_ERR_CONFLICTING_RULE_KEYWORDS,
|
|
|
|
|
"rule contains conflicting keywords.");
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dd->mode = DETECT_TLS_VALIDITY_EX;
|
|
|
|
|
dd->type = DETECT_TLS_TYPE_NOTAFTER;
|
|
|
|
|
dd->epoch = 0;
|
|
|
|
@ -447,11 +444,7 @@ static int DetectTlsExpiredSetup (DetectEngineCtx *de_ctx, Signature *s,
|
|
|
|
|
sm->type = DETECT_AL_TLS_EXPIRED;
|
|
|
|
|
sm->ctx = (void *)dd;
|
|
|
|
|
|
|
|
|
|
s->flags |= SIG_FLAG_APPLAYER;
|
|
|
|
|
s->alproto = ALPROTO_TLS;
|
|
|
|
|
|
|
|
|
|
SigMatchAppendSMToList(s, sm, g_tls_validity_buffer_id);
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
error:
|
|
|
|
@ -479,6 +472,9 @@ static int DetectTlsValidSetup (DetectEngineCtx *de_ctx, Signature *s,
|
|
|
|
|
|
|
|
|
|
SCLogDebug("\'%s\'", rawstr);
|
|
|
|
|
|
|
|
|
|
if (DetectSignatureSetAppProto(s, ALPROTO_TLS) != 0)
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
dd = SCCalloc(1, sizeof(DetectTlsValidityData));
|
|
|
|
|
if (dd == NULL) {
|
|
|
|
|
SCLogError(SC_ERR_INVALID_ARGUMENT,"Allocation \'%s\' failed", rawstr);
|
|
|
|
@ -491,12 +487,6 @@ static int DetectTlsValidSetup (DetectEngineCtx *de_ctx, Signature *s,
|
|
|
|
|
if (sm == NULL)
|
|
|
|
|
goto error;
|
|
|
|
|
|
|
|
|
|
if (s->alproto != ALPROTO_UNKNOWN && s->alproto != ALPROTO_TLS) {
|
|
|
|
|
SCLogError(SC_ERR_CONFLICTING_RULE_KEYWORDS,
|
|
|
|
|
"rule contains conflicting keywords.");
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dd->mode = DETECT_TLS_VALIDITY_VA;
|
|
|
|
|
dd->type = DETECT_TLS_TYPE_NOTAFTER;
|
|
|
|
|
dd->epoch = 0;
|
|
|
|
@ -505,11 +495,7 @@ static int DetectTlsValidSetup (DetectEngineCtx *de_ctx, Signature *s,
|
|
|
|
|
sm->type = DETECT_AL_TLS_VALID;
|
|
|
|
|
sm->ctx = (void *)dd;
|
|
|
|
|
|
|
|
|
|
s->flags |= SIG_FLAG_APPLAYER;
|
|
|
|
|
s->alproto = ALPROTO_TLS;
|
|
|
|
|
|
|
|
|
|
SigMatchAppendSMToList(s, sm, g_tls_validity_buffer_id);
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
error:
|
|
|
|
@ -576,6 +562,9 @@ static int DetectTlsValiditySetup (DetectEngineCtx *de_ctx, Signature *s,
|
|
|
|
|
|
|
|
|
|
SCLogDebug("\'%s\'", rawstr);
|
|
|
|
|
|
|
|
|
|
if (DetectSignatureSetAppProto(s, ALPROTO_TLS) != 0)
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
dd = DetectTlsValidityParse(rawstr);
|
|
|
|
|
if (dd == NULL) {
|
|
|
|
|
SCLogError(SC_ERR_INVALID_ARGUMENT,"Parsing \'%s\' failed", rawstr);
|
|
|
|
@ -588,12 +577,6 @@ static int DetectTlsValiditySetup (DetectEngineCtx *de_ctx, Signature *s,
|
|
|
|
|
if (sm == NULL)
|
|
|
|
|
goto error;
|
|
|
|
|
|
|
|
|
|
if (s->alproto != ALPROTO_UNKNOWN && s->alproto != ALPROTO_TLS) {
|
|
|
|
|
SCLogError(SC_ERR_CONFLICTING_RULE_KEYWORDS,
|
|
|
|
|
"rule contains conflicting keywords.");
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (type == DETECT_TLS_TYPE_NOTBEFORE) {
|
|
|
|
|
dd->type = DETECT_TLS_TYPE_NOTBEFORE;
|
|
|
|
|
sm->type = DETECT_AL_TLS_NOTBEFORE;
|
|
|
|
@ -608,11 +591,7 @@ static int DetectTlsValiditySetup (DetectEngineCtx *de_ctx, Signature *s,
|
|
|
|
|
|
|
|
|
|
sm->ctx = (void *)dd;
|
|
|
|
|
|
|
|
|
|
s->flags |= SIG_FLAG_APPLAYER;
|
|
|
|
|
s->alproto = ALPROTO_TLS;
|
|
|
|
|
|
|
|
|
|
SigMatchAppendSMToList(s, sm, g_tls_validity_buffer_id);
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
error:
|
|
|
|
|