-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Admin master key wrong message #200
Conversation
If the user is in the process of typing the master key and SIGINT the program, the file is created without the right permissions, and thus a further invocation of pgagroal-admin will result in an error about the wrong permissions. There is no a signal handler that is installed before the master_key internal function is invoked so to handle SIGINT.
I don't think we need the |
See <agroal#200 (comment)>. The is_valid_password() was checking only the password length and the fact that was made by ASCII chars. The check for the length can be done "inline" directly within a loop. Added a constant with the minimal length of the password, so that it is possible to insert a warning message for the user in the case she inputs a too short password.
The function checks that the password is of the right size, and contains the right set of characters. If needed, it can print out what is wrong with the password check.
Since there are now separated arrays for every piece of the master key password, when automatically generating a password the function concatenate the ALPHA_UC, ALPHA_LC, DIGITS, SPECIALS arrays into a single one called 'alphabet' that is used to generate the password.
I've done a few changes. In the beginning I deleted the In the cae you want to integrate, squash or cherry pick. |
When automatically generating a password, select a different set of chars for every single position in the password, so that the password will have always an upper case, followed by a lower case, followed by a digit, followed by a special, and so on. This is not the most secure approach, but generates a quite complex, and most notably, coherent and valid, master key password.
Ok, added also the capability to automatically generate a password picking different set of chars, so that it will always contain numbers, letters, specials, and so on. |
An earlier commit remove all password strength checking for user based account - leaving it to the DBA to set the guidelines. So, I think we should do the same in this case. And, hence |
In such case I believe that cherry-picking 848100e will do the job. |
Yeah, the cherry-pick looks like it, but I would like to have a proper pull request for it, so rebase, fix indentation and squash, please :) |
Opened issue #206. I'm closing this one and opening a new pull request since most of the work done here is not accepted. |
…sages. Close agroal#206. See <agroal#200 (comment)>. The is_valid_password() was checking only the password length and the fact that was made by ASCII chars. The check for the length can be done "inline" directly within a loop. Added a constant with the minimal length of the password, so that it is possible to insert a warning message for the user in the case she inputs a too short password. The system also prompts the user for a password with a message that explicitly tells her the password will not appear on the terminal. See also the initial work on agroal#200.
Close #206. See <#200 (comment)>. The is_valid_password() was checking only the password length and the fact that was made by ASCII chars. The check for the length can be done "inline" directly within a loop. Added a constant with the minimal length of the password, so that it is possible to insert a warning message for the user in the case she inputs a too short password. The system also prompts the user for a password with a message that explicitly tells her the password will not appear on the terminal. See also the initial work on #200.
Close #206. See <#200 (comment)>. The is_valid_password() was checking only the password length and the fact that was made by ASCII chars. The check for the length can be done "inline" directly within a loop. Added a constant with the minimal length of the password, so that it is possible to insert a warning message for the user in the case she inputs a too short password. The system also prompts the user for a password with a message that explicitly tells her the password will not appear on the terminal. See also the initial work on #200.
While using
pgagroal-admin
I found some odd cases that could be improved:Master Key
on the screen without any hint;Since I'm not a day-by-day C developer, please review carefully.