picoquic/tls_api.c
void picoquic_set_key_log_file(picoquic_quic_t *quic, char const * keylog_filename)
{
    ptls_context_t* ctx = (ptls_context_t*)quic->tls_master_ctx;
    struct st_picoquic_log_event_t* log_event = (struct st_picoquic_log_event_t*)ctx->log_event;

    if (log_event == NULL) {
        log_event = (struct st_picoquic_log_event_t*)malloc(sizeof(struct st_picoquic_log_event_t));
        if (log_event != NULL) {
            log_event->super.cb = picoquic_log_event_call_back;
        }
    }
    else {
        if (log_event->fp != NULL) {
            picoquic_file_close(log_event->fp);
            log_event->fp = NULL;
        }
    }

    if (log_event != NULL) {
        log_event->fp = picoquic_file_open(keylog_filename, "a");
        log_event->super.cb = picoquic_log_event_call_back;
        ctx->log_event = (ptls_log_event_t*)log_event;
    }

    ctx->log_event = (ptls_log_event_t*)log_event;
}
/**
 * Sets the output file handle for writing traffic secrets in a format that can
 * be recognized by Wireshark.
 */
Sets the output file handle for writing traffic secrets in a format that can
be recognized by Wireshark.
Sets the output file handle for writing traffic secrets in a format that can be recognized by Wireshark .
void picoquic_set_key_log_file(picoquic_quic_t *quic, char const * keylog_filename)
{
    ptls_context_t* ctx = (ptls_context_t*)quic->tls_master_ctx;
    struct st_picoquic_log_event_t* log_event = (struct st_picoquic_log_event_t*)ctx->log_event;
    if (log_event == NULL) {
        log_event = (struct st_picoquic_log_event_t*)malloc(sizeof(struct st_picoquic_log_event_t));
        if (log_event != NULL) {
            log_event->super.cb = picoquic_log_event_call_back;
        }
    }
    else {
        if (log_event->fp != NULL) {
            picoquic_file_close(log_event->fp);
            log_event->fp = NULL;
        }
    }
    if (log_event != NULL) {
        log_event->fp = picoquic_file_open(keylog_filename, "a");
        log_event->super.cb = picoquic_log_event_call_back;
        ctx->log_event = (ptls_log_event_t*)log_event;
    }
    ctx->log_event = (ptls_log_event_t*)log_event;
}
void picoquic_set_key_log_file ( picoquic_quic_t * quic , char const * keylog_filename ) { ptls_context_t * ctx = ( ptls_context_t * ) quic -> tls_master_ctx ; struct st_picoquic_log_event_t * log_event = ( struct st_picoquic_log_event_t * ) ctx -> log_event ; if ( log_event == NULL ) { log_event = ( struct st_picoquic_log_event_t * ) malloc ( sizeof ( struct st_picoquic_log_event_t ) ) ; if ( log_event != NULL ) { log_event -> super . cb = picoquic_log_event_call_back ; } } else { if ( log_event -> fp != NULL ) { picoquic_file_close ( log_event -> fp ) ; log_event -> fp = NULL ; } } if ( log_event != NULL ) { log_event -> fp = picoquic_file_open ( keylog_filename , " " ) ; log_event -> super . cb = picoquic_log_event_call_back ; ctx -> log_event = ( ptls_log_event_t * ) log_event ; } ctx -> log_event = ( ptls_log_event_t * ) log_event ; }
Sets the output file handle for writing traffic secrets in a format that can
 be recognized by Wireshark.
Sets the output file handle for writing traffic secrets in a format that can be recognized by Wireshark .