|
|
|
@ -46,7 +46,14 @@ gboolean on_password_tooltip_out_event(GtkWidget *self, GdkEvent *, yon_password
|
|
|
|
char *yon_password_unencrypted_password_get(yon_password_window *window){
|
|
|
|
char *yon_password_unencrypted_password_get(yon_password_window *window){
|
|
|
|
const char *password = gtk_entry_get_text(GTK_ENTRY(window->PasswordEntry));
|
|
|
|
const char *password = gtk_entry_get_text(GTK_ENTRY(window->PasswordEntry));
|
|
|
|
const char *password_repeat = gtk_entry_get_text(GTK_ENTRY(window->RepeatPasswordEntry));
|
|
|
|
const char *password_repeat = gtk_entry_get_text(GTK_ENTRY(window->RepeatPasswordEntry));
|
|
|
|
if (strpbrk(password,"!@#%^&*\'")){
|
|
|
|
|
|
|
|
|
|
|
|
if (window->strength_func){
|
|
|
|
|
|
|
|
double password_strength = ((double(*)(yon_password_window *,const char*))window->strength_func)(window,password);
|
|
|
|
|
|
|
|
if (password_strength<0.3){
|
|
|
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),_WEAK_PASSWORD_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (strpbrk(password,"!@#%^&*\'")){
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),_PASSWORD_RESTRICTED_SYMBOL_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
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);
|
|
|
|
yon_ubl_status_highlight_incorrect(window->PasswordEntry);
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
|
@ -103,7 +110,13 @@ char *yon_password_hash_get(yon_password_window *window){
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
const char *password = gtk_entry_get_text(GTK_ENTRY(window->PasswordEntry));
|
|
|
|
const char *password = gtk_entry_get_text(GTK_ENTRY(window->PasswordEntry));
|
|
|
|
const char *password_repeat = gtk_entry_get_text(GTK_ENTRY(window->RepeatPasswordEntry));
|
|
|
|
const char *password_repeat = gtk_entry_get_text(GTK_ENTRY(window->RepeatPasswordEntry));
|
|
|
|
if (strpbrk(password,"!@#%^&*\'")){
|
|
|
|
if (window->strength_func){
|
|
|
|
|
|
|
|
double password_strength = ((double(*)(yon_password_window *,const char*))window->strength_func)(window,password);
|
|
|
|
|
|
|
|
if (password_strength<0.3){
|
|
|
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),_WEAK_PASSWORD_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (strpbrk(password,"!@#%^&*\'")){
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),_PASSWORD_RESTRICTED_SYMBOL_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
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);
|
|
|
|
yon_ubl_status_highlight_incorrect(window->PasswordEntry);
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
|
@ -207,13 +220,6 @@ void on_password_accept(GtkWidget *,dictionary *dict){
|
|
|
|
if (encription_active <1||gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->NoEncriptionCheck))){
|
|
|
|
if (encription_active <1||gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->NoEncriptionCheck))){
|
|
|
|
final = yon_password_unencrypted_password_get(window);
|
|
|
|
final = yon_password_unencrypted_password_get(window);
|
|
|
|
|
|
|
|
|
|
|
|
if (window->strength_func){
|
|
|
|
|
|
|
|
double password_strength = ((double(*)(yon_password_window *,const char*))window->strength_func)(window,final);
|
|
|
|
|
|
|
|
if (password_strength<0.3){
|
|
|
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),_WEAK_PASSWORD_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!final) return;
|
|
|
|
if (!final) return;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
final = yon_password_hash_get(window);
|
|
|
|
final = yon_password_hash_get(window);
|
|
|
|
|