Print full cert for review
This commit is contained in:
parent
f8581c40b0
commit
b9a50db894
12
tcp.c
12
tcp.c
@ -352,20 +352,10 @@ int check_cert(gnutls_session_t session)
|
|||||||
|
|
||||||
gnutls_x509_crt_init(&cert);
|
gnutls_x509_crt_init(&cert);
|
||||||
gnutls_x509_crt_import(cert, &cert_list[0], GNUTLS_X509_FMT_DER);
|
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)
|
if (rv == 0)
|
||||||
{
|
{
|
||||||
char *p;
|
|
||||||
strcat(message, "review the following certificate info:\n\n");
|
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);
|
strncat(message, (char *)cinfo.data, cinfo.size);
|
||||||
gnutls_free(cinfo.data);
|
gnutls_free(cinfo.data);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user