Print full cert for review

This commit is contained in:
Henrik Andersson 2019-01-24 14:41:28 +01:00
parent f8581c40b0
commit b9a50db894

12
tcp.c
View File

@ -352,20 +352,10 @@ int check_cert(gnutls_session_t session)
gnutls_x509_crt_init(&cert);
gnutls_x509_crt_import(cert, &cert_list[0], GNUTLS_X509_FMT_DER);
rv = gnutls_x509_crt_print(cert, GNUTLS_CRT_PRINT_ONELINE, &cinfo);
rv = gnutls_x509_crt_print(cert, GNUTLS_CRT_PRINT_FULL, &cinfo);
if (rv == 0)
{
char *p;
strcat(message, "review the following certificate info:\n\n");
/* replace ',' with '\n' for simpler format */
p = (char *)cinfo.data;
while(*p != '\0')
{
if (*p == ',') *p = '\n';
p++;
}
strcat(message, " ");
strncat(message, (char *)cinfo.data, cinfo.size);
gnutls_free(cinfo.data);
}