c - fprintf not working in wireshark source -


i trying make changes wireshark source code , added following code file: /epan/dissectors/packet-ssl-utils.c

f=fopen("keys.txt","a+");  fflush(f); fprintf(f,"test");  ssl_print_data("client write key",c_wk,ssl_session->cipher_suite.bits/8);  ssl_print_data("server write key",s_wk,ssl_session->cipher_suite.bits/8); fprintf(f,"%s %s",c_wk,s_wk);  if(ssl_session->cipher_suite.block>1) {  ssl_print_data("client write iv",c_iv,ssl_session->cipher_suite.block);  ssl_print_data("server write iv",s_iv,ssl_session->cipher_suite.block);  fprintf(f,"%s %s",c_iv,s_iv); }  else {  ssl_print_data("client write iv",c_iv,8);  ssl_print_data("server write iv",s_iv,8);  fprintf(f,"%s %s",c_iv,s_iv); }  fflush(f);  fclose(f); 

i declared file pointer 'f' @ start of function ssl_generate_keyring(). after multiple attempts of running scripts


sudo ./configure sudo make sudo make install 

i still not able print data these variables file. file not created.

can advise me on how write these variables file ?

background: must set export sslkeylogfile=/home/somefilename.txt in terminal. launch browser terminal , browse traffic.

go wire shark preferences , set keylog file in protocol tab -> ssl tab

the wireshark directory write protected , hence modifications made wireshark code not written file in same directory.

@markplotnick, @olaf , @jean-bapiste point towards right direction , practice 1 should write better debugging code error handlers.


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

python 3.5 - Pyqtgraph string in x tick -