This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

where does ssl_print_data() display its output?

0

I've apiece of an external dissector code where several calls have been made to the function ssl_print_data. I'm not able to find out where the arguments passed to this function are printed out!

I found it defined in the file packet-ssl-utils.c as the following:

void
ssl_print_data(const gchar* name, const guchar* data, size_t len)
{
    size_t i;
    if (!ssl_debug_file)
        return;
    fprintf(ssl_debug_file,"%s[%d]:\n",name, (int) len);
    for (i=0; i< len; i++) {
        if ((i>0) && (i%16 == 0))
            fprintf(ssl_debug_file,"\n");
        fprintf(ssl_debug_file,"%.2x ",data[i]&255);
    }
    fprintf(ssl_debug_file,"\n");
}

I also found ssl_debug_file is defined in the same file as the following

static FILE* ssl_debug_file=NULL;

void ssl_set_debug(char* name) { static gint debug_file_must_be_closed; gint use_stderr; debug_file_must_be_closed = 0; use_stderr = name?(strcmp(name, SSL_DEBUG_USE_STDERR) == 0):0;

if (debug_file_must_be_closed)
    fclose(ssl_debug_file);
if (use_stderr)
    ssl_debug_file = stderr;
else if (!name || (strcmp(name, &quot;&quot;) ==0))
    ssl_debug_file = NULL;
else
    ssl_debug_file = ws_fopen(name, &quot;w&quot;);
if (!use_stderr &amp;&amp; ssl_debug_file)
    debug_file_must_be_closed = 1;

}

It is not printing into console as I was not able to find any messages related to this specific function there. Should I create the ssl_debug_file somewhere ? If it is already exist where is it?

Thanks.

asked 01 Aug ‘14, 14:04

flora's gravatar image

flora
156313338
accept rate: 100%

edited 01 Aug ‘14, 14:30


One Answer:

0

You can define the SSL debug file here

Edit -> Preferences -> Protocols -> SSL -> SSL debug file

Please choose any existing file with the File dialog widget (Browse... button), or simply enter the file name.

If you want the messages to go to STDERR, please enter - (minus) as the file name.

Regards
Kurt

answered 03 Aug '14, 05:59

Kurt%20Knochner's gravatar image

Kurt Knochner ♦
24.8k1039237
accept rate: 15%

Thanks! This solves my problem.

(10 Nov '14, 09:59) flora