Skip to content

Commit

Permalink
Add: Added check of certificate for TippingPoint SMS alerts.
Browse files Browse the repository at this point in the history
Now the uploaded certificate for a TippingPoint SMS alert is
checked, if it is a valid X509 certificate in PEM format.
This check takes place before the alert data is saved.
  • Loading branch information
jhelmold committed Jul 21, 2023
1 parent c27685b commit c3c836c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/manage_sql.c
Original file line number Diff line number Diff line change
Expand Up @@ -7047,7 +7047,16 @@ validate_tippingpoint_data (alert_method_t method, const gchar *name,

if (strcmp (name, "tp_sms_tls_certificate") == 0)
{
// TODO: Check certificate, return 52 on failure
// Check certificate, return 52 on failure
int ret;
gnutls_x509_crt_fmt_t crt_fmt;

ret = get_certificate_info (*data, strlen(*data), NULL, NULL, NULL,
NULL, NULL, NULL, NULL, &crt_fmt);
if (ret || crt_fmt != GNUTLS_X509_FMT_PEM)
{
return 52;
}
}

if (strcmp (name, "tp_sms_tls_workaround") == 0)
Expand Down

0 comments on commit c3c836c

Please sign in to comment.