* \param s Pointer to the Signature to which the current keyword belongs
* \param str Should hold an empty string always
*
- * \retval 0 On success
+ * \retval 0 On success
+ * \retval -1 On failure
*/
static int DetectTlsFingerprintSetup(DetectEngineCtx *de_ctx, Signature *s,
const char *str)
{
- DetectBufferSetActiveList(s, g_tls_cert_fingerprint_buffer_id);
+ if (DetectBufferSetActiveList(s, g_tls_cert_fingerprint_buffer_id) < 0)
+ return -1;
- if (DetectSignatureSetAppProto(s, ALPROTO_TLS) != 0)
+ if (DetectSignatureSetAppProto(s, ALPROTO_TLS) < 0)
return -1;
return 0;
* \param s Pointer to the Signature to which the current keyword belongs
* \param str Should hold an empty string always
*
- * \retval 0 On success
+ * \retval 0 On success
+ * \retval -1 On failure
*/
static int DetectTlsIssuerSetup(DetectEngineCtx *de_ctx, Signature *s, const char *str)
{
- DetectBufferSetActiveList(s, g_tls_cert_issuer_buffer_id);
- s->alproto = ALPROTO_TLS;
+ if (DetectBufferSetActiveList(s, g_tls_cert_issuer_buffer_id) < 0)
+ return -1;
+
+ if (DetectSignatureSetAppProto(s, ALPROTO_TLS) < 0)
+ return -1;
+
return 0;
}
* \param s Pointer to the Signature to which the current keyword belongs
* \param str Should hold an empty string always
*
- * \retval 0 On success
+ * \retval 0 On success
+ * \retval -1 On failure
*/
static int DetectTlsSerialSetup(DetectEngineCtx *de_ctx, Signature *s, const char *str)
{
- DetectBufferSetActiveList(s, g_tls_cert_serial_buffer_id);
+ if (DetectBufferSetActiveList(s, g_tls_cert_serial_buffer_id) < 0)
+ return -1;
- if (DetectSignatureSetAppProto(s, ALPROTO_TLS) != 0)
+ if (DetectSignatureSetAppProto(s, ALPROTO_TLS) < 0)
return -1;
return 0;
* \param s Pointer to the Signature to which the current keyword belongs
* \param str Should hold an empty string always
*
- * \retval 0 On success
+ * \retval 0 On success
+ * \retval -1 On failure
*/
static int DetectTlsSubjectSetup(DetectEngineCtx *de_ctx, Signature *s, const char *str)
{
- DetectBufferSetActiveList(s, g_tls_cert_subject_buffer_id);
- s->alproto = ALPROTO_TLS;
+ if (DetectBufferSetActiveList(s, g_tls_cert_subject_buffer_id) < 0)
+ return -1;
+
+ if (DetectSignatureSetAppProto(s, ALPROTO_TLS) < 0)
+ return -1;
+
return 0;
}
* \param s Pointer to the Signature to which the current keyword belongs
* \param str Should hold an empty string always
*
- * \retval 0 On success
+ * \retval 0 On success
+ * \retval -1 On failure
*/
static int DetectTlsJa3HashSetup(DetectEngineCtx *de_ctx, Signature *s, const char *str)
{
- DetectBufferSetActiveList(s, g_tls_ja3_hash_buffer_id);
- s->alproto = ALPROTO_TLS;
+ if (DetectBufferSetActiveList(s, g_tls_ja3_hash_buffer_id) < 0)
+ return -1;
+
+ if (DetectSignatureSetAppProto(s, ALPROTO_TLS) < 0)
+ return -1;
if (RunmodeIsUnittests())
return 0;
* \param s Pointer to the Signature to which the current keyword belongs
* \param str Should hold an empty string always
*
- * \retval 0 On success
+ * \retval 0 On success
+ * \retval -1 On failure
*/
static int DetectTlsJa3StringSetup(DetectEngineCtx *de_ctx, Signature *s, const char *str)
{
- DetectBufferSetActiveList(s, g_tls_ja3_str_buffer_id);
- s->alproto = ALPROTO_TLS;
+ if (DetectBufferSetActiveList(s, g_tls_ja3_str_buffer_id) < 0)
+ return -1;
+
+ if (DetectSignatureSetAppProto(s, ALPROTO_TLS) < 0)
+ return -1;
if (RunmodeIsUnittests())
return 0;
* \param s Pointer to the Signature to which the current keyword belongs
* \param str Should hold an empty string always
*
- * \retval 0 On success
+ * \retval 0 On success
+ * \retval -1 On failure
*/
static int DetectTlsSniSetup(DetectEngineCtx *de_ctx, Signature *s, const char *str)
{
- DetectBufferSetActiveList(s, g_tls_sni_buffer_id);
- s->alproto = ALPROTO_TLS;
+ if (DetectBufferSetActiveList(s, g_tls_sni_buffer_id) < 0)
+ return -1;
+
+ if (DetectSignatureSetAppProto(s, ALPROTO_TLS) < 0)
+ return -1;
+
return 0;
}