@@ -401,10 +401,10 @@ typedef struct _webui_core_t {
401401 char * default_server_root_path ;
402402 bool ui ;
403403 #ifdef WEBUI_TLS
404- uint8_t * root_cert ;
405- uint8_t * root_key ;
406- uint8_t * ssl_cert ;
407- uint8_t * ssl_key ;
404+ char * root_cert ;
405+ char * root_key ;
406+ char * ssl_cert ;
407+ char * ssl_key ;
408408 #endif
409409 // WebView
410410 bool is_browser_main_run ;
@@ -556,8 +556,8 @@ static void _webui_connection_remove(_webui_window_t* win, struct mg_connection*
556556static void _webui_remove_firefox_profile_ini (const char * path , const char * profile_name );
557557static bool _webui_is_firefox_ini_profile_exist (const char * path , const char * profile_name );
558558static void _webui_send_client (_webui_window_t * win , struct mg_connection * client ,
559- uint16_t id , uint8_t cmd , const char * data , size_t len , bool token_bypass );
560- static void _webui_send_all (_webui_window_t * win , uint16_t id , uint8_t cmd , const char * data , size_t len );
559+ uint16_t id , unsigned char cmd , const char * data , size_t len , bool token_bypass );
560+ static void _webui_send_all (_webui_window_t * win , uint16_t id , unsigned char cmd , const char * data , size_t len );
561561static uint16_t _webui_get_id (const char * data );
562562static uint32_t _webui_get_token (const char * data );
563563static uint32_t _webui_generate_random_uint32 ();
@@ -5038,7 +5038,7 @@ static uint16_t _webui_get_id(const char* data) {
50385038 return id ;
50395039}
50405040
5041- static void _webui_send_all (_webui_window_t * win , uint16_t id , uint8_t cmd , const char * data , size_t len ) {
5041+ static void _webui_send_all (_webui_window_t * win , uint16_t id , unsigned char cmd , const char * data , size_t len ) {
50425042
50435043 #ifdef WEBUI_LOG
50445044 printf ("[Core]\t\t_webui_send_all()\n" );
@@ -5066,7 +5066,7 @@ static void _webui_send_all(_webui_window_t* win, uint16_t id, uint8_t cmd, cons
50665066
50675067static void _webui_send_client (
50685068 _webui_window_t * win , struct mg_connection * client ,
5069- uint16_t id , uint8_t cmd , const char * data , size_t len , bool token_bypass ) {
5069+ uint16_t id , unsigned char cmd , const char * data , size_t len , bool token_bypass ) {
50705070
50715071 #ifdef WEBUI_LOG
50725072 printf ("[Core]\t\t_webui_send_client()\n" );
@@ -6775,20 +6775,20 @@ static bool _webui_tls_generate_self_signed_cert(char* root_cert, char* root_key
67756775 X509_gmtime_adj (X509_get_notAfter (root_x509 ), (long )(WEBUI_SSL_EXPIRE ));
67766776
67776777 X509_NAME * root_name = X509_get_subject_name (root_x509 );
6778- X509_NAME_add_entry_by_txt (root_name , "C" , MBSTRING_ASC , "CA" , -1 , -1 ,
6778+ X509_NAME_add_entry_by_txt (root_name , "C" , MBSTRING_ASC , ( const unsigned char * ) "CA" , -1 , -1 ,
67796779 0 ); // Country
6780- X509_NAME_add_entry_by_txt (root_name , "O" , MBSTRING_ASC , "WebUI Root Authority" , -1 , -1 , 0 ); // Organization
6781- X509_NAME_add_entry_by_txt (root_name , "OU" , MBSTRING_ASC , "WebUI" , -1 , -1 ,
6780+ X509_NAME_add_entry_by_txt (root_name , "O" , MBSTRING_ASC , ( const unsigned char * ) "WebUI Root Authority" , -1 , -1 , 0 ); // Organization
6781+ X509_NAME_add_entry_by_txt (root_name , "OU" , MBSTRING_ASC , ( const unsigned char * ) "WebUI" , -1 , -1 ,
67826782 0 ); // Organizational Unit
6783- X509_NAME_add_entry_by_txt (root_name , "CN" , MBSTRING_ASC , "localhost" , -1 , -1 ,
6783+ X509_NAME_add_entry_by_txt (root_name , "CN" , MBSTRING_ASC , ( const unsigned char * ) "localhost" , -1 , -1 ,
67846784 0 ); // Common Name
67856785 X509_NAME_add_entry_by_txt (
6786- root_name , "subjectAltName" , MBSTRING_ASC , "127.0.0.1" , -1 , -1 ,
6786+ root_name , "subjectAltName" , MBSTRING_ASC , ( const unsigned char * ) "127.0.0.1" , -1 , -1 ,
67876787 0
67886788 ); // Subject Alternative Name
6789- X509_NAME_add_entry_by_txt (root_name , "ST" , MBSTRING_ASC , "WebUI" , -1 , -1 ,
6789+ X509_NAME_add_entry_by_txt (root_name , "ST" , MBSTRING_ASC , ( const unsigned char * ) "WebUI" , -1 , -1 ,
67906790 0 ); // State
6791- X509_NAME_add_entry_by_txt (root_name , "L" , MBSTRING_ASC , "WebUI" , -1 , -1 ,
6791+ X509_NAME_add_entry_by_txt (root_name , "L" , MBSTRING_ASC , ( const unsigned char * ) "WebUI" , -1 , -1 ,
67926792 0 ); // Locality
67936793
67946794 X509_set_issuer_name (root_x509 , root_name );
@@ -6837,20 +6837,20 @@ static bool _webui_tls_generate_self_signed_cert(char* root_cert, char* root_key
68376837 X509_gmtime_adj (X509_get_notAfter (x509 ), (long )(WEBUI_SSL_EXPIRE ));
68386838
68396839 X509_NAME * name = X509_get_subject_name (x509 );
6840- X509_NAME_add_entry_by_txt (name , "C" , MBSTRING_ASC , "CA" , -1 , -1 ,
6840+ X509_NAME_add_entry_by_txt (name , "C" , MBSTRING_ASC , ( const unsigned char * ) "CA" , -1 , -1 ,
68416841 0 ); // Country
6842- X509_NAME_add_entry_by_txt (name , "O" , MBSTRING_ASC , "WebUI" , -1 , -1 ,
6842+ X509_NAME_add_entry_by_txt (name , "O" , MBSTRING_ASC , ( const unsigned char * ) "WebUI" , -1 , -1 ,
68436843 0 ); // Organization
6844- X509_NAME_add_entry_by_txt (name , "OU" , MBSTRING_ASC , "WebUI" , -1 , -1 ,
6844+ X509_NAME_add_entry_by_txt (name , "OU" , MBSTRING_ASC , ( const unsigned char * ) "WebUI" , -1 , -1 ,
68456845 0 ); // Organizational Unit
6846- X509_NAME_add_entry_by_txt (name , "CN" , MBSTRING_ASC , "localhost" , -1 , -1 ,
6846+ X509_NAME_add_entry_by_txt (name , "CN" , MBSTRING_ASC , ( const unsigned char * ) "localhost" , -1 , -1 ,
68476847 0 ); // Common Name
68486848 X509_NAME_add_entry_by_txt (
6849- name , "subjectAltName" , MBSTRING_ASC , "127.0.0.1" , -1 , -1 , 0
6849+ name , "subjectAltName" , MBSTRING_ASC , ( const unsigned char * ) "127.0.0.1" , -1 , -1 , 0
68506850 ); // Subject Alternative Name
6851- X509_NAME_add_entry_by_txt (name , "ST" , MBSTRING_ASC , "WebUI" , -1 , -1 ,
6851+ X509_NAME_add_entry_by_txt (name , "ST" , MBSTRING_ASC , ( const unsigned char * ) "WebUI" , -1 , -1 ,
68526852 0 ); // State
6853- X509_NAME_add_entry_by_txt (name , "L" , MBSTRING_ASC , "WebUI" , -1 , -1 ,
6853+ X509_NAME_add_entry_by_txt (name , "L" , MBSTRING_ASC , ( const unsigned char * ) "WebUI" , -1 , -1 ,
68546854 0 ); // Locality
68556855
68566856 X509_set_issuer_name (x509 , root_name );
@@ -7431,8 +7431,9 @@ static void _webui_init(void) {
74317431
74327432 // Initializing server services
74337433 #ifdef WEBUI_TLS
7434- if (mg_init_library (MG_FEATURES_TLS ) != MG_FEATURES_TLS )
7434+ if (( unsigned ) mg_init_library (MG_FEATURES_TLS ) != ( unsigned ) MG_FEATURES_TLS ) {
74357435 WEBUI_ASSERT ("mg_init_library() failed" );
7436+ }
74367437 #else
74377438 mg_init_library (0 );
74387439 #endif
0 commit comments