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

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, "") ==0))
        ssl_debug_file = NULL;
    else
        ssl_debug_file = ws_fopen(name, "w");
    if (!use_stderr && 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


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

permanent link

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
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×1,620
×637
×23
×1

question asked: 01 Aug '14, 14:04

question was seen: 1,274 times

last updated: 10 Nov '14, 09:59

p​o​w​e​r​e​d by O​S​Q​A