diff --git a/source/ubl-settings-update.c b/source/ubl-settings-update.c index 2d617ac..0e4d78f 100644 --- a/source/ubl-settings-update.c +++ b/source/ubl-settings-update.c @@ -1207,6 +1207,11 @@ void on_web_publish_accept(GtkWidget *, dictionary *dict){ yon_ubl_status_highlight_incorrect(window->UserPasswordEntry); return; } + if (encryption&&!yon_char_is_empty(encryption)&&(strlen(user_password)!=128&&strlen(user_password)!=64)){ + yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),PASSWORD_RESTRICTED_SYMBOL_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); + yon_ubl_status_highlight_incorrect(window->UserPasswordEntry); + return; + } if (username_check&&yon_char_is_empty(username)){ yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); yon_ubl_status_highlight_incorrect(window->UsernameEntry); @@ -1395,7 +1400,7 @@ void on_password_accept(GtkWidget *,dictionary *dict){ yon_ubl_status_highlight_incorrect(window->PasswordHashEntry); return; } - if (check_is_password_hash(hash)){ + if (strlen((hash))==512){ yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),INCORRECT_HASH_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); yon_ubl_status_highlight_incorrect(window->PasswordHashEntry); return; @@ -1428,54 +1433,6 @@ void on_password_accept(GtkWidget *,dictionary *dict){ } } gtk_widget_destroy(window->Window); - - // if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->NoEncriptionCheck))){ - // char *encryption = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->EncryptionCombo)); - // char *hash = (char*)gtk_entry_get_text(GTK_ENTRY(window->PasswordHashEntry)); - // if (yon_char_is_empty(hash)){ - // yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); - // yon_ubl_status_highlight_incorrect(window->PasswordHashEntry); - // return; - // } - // char *temp = yon_char_unite(encryption,"|",hash,NULL); - // gtk_entry_set_text(GTK_ENTRY(target),temp); - // free(temp); - // } else { - // char *password = (char*)gtk_entry_get_text(GTK_ENTRY(window->PasswordEntry)); - // char *password_check = (char*)gtk_entry_get_text(GTK_ENTRY(window->RepeatPasswordEntry)); - // if (strpbrk(password,"!@#%^&*\'")){ - // yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),PASSWORD_RESTRICTED_SYMBOL_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); - // yon_ubl_status_highlight_incorrect(window->PasswordEntry); - // return; - // } - // if (strcmp(password,password_check)){ - // yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),PASSWORD_MISMATCH_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); - // yon_ubl_status_highlight_incorrect(window->PasswordEntry); - // yon_ubl_status_highlight_incorrect(window->RepeatPasswordEntry); - // return; - // } - // char *encryption = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->EncryptionCombo)); - // if (yon_char_is_empty(encryption)){ - // gtk_entry_set_text(GTK_ENTRY(target),password); - - // } else { - // if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->NoEncriptionCheck))){ - // char *temp = yon_char_unite(encryption,"|",password,NULL); - // gtk_entry_set_text(GTK_ENTRY(target),temp); - // free(temp); - // } else { - // int size; - // config_str hash = yon_config_load(yon_debug_output("%s\n",!strcmp(encryption,"sha512")?sha512_encrypt_command(password):sha256_encrypt_command(password)),&size); - // yon_char_remove_last_symbol(hash[0],'\n'); - // char *temp = yon_char_unite(encryption,"|",hash[0],NULL); - // gtk_entry_set_text(GTK_ENTRY(target),temp); - // yon_char_parsed_free(hash,size); - // free(temp); - // } - // } - - // } - } void on_mirror_path_removed(GtkWidget *self, mirror_add_window *window){