-
Notifications
You must be signed in to change notification settings - Fork 79
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
Introducing passwordbasedauthentication based on lcrypt and sha512 (backport #484) #487
Merged
bjoernricks
merged 13 commits into
gvm-libs-21.04
from
mergify/bp/gvm-libs-21.04/pr-484
Apr 30, 2021
Merged
Introducing passwordbasedauthentication based on lcrypt and sha512 (backport #484) #487
bjoernricks
merged 13 commits into
gvm-libs-21.04
from
mergify/bp/gvm-libs-21.04/pr-484
Apr 30, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Introducing passwordbasedauthentication to handle upgrade from MD5 to sha512 within gvmd. The decision to write new implementation based on lcrypt and sha512 rather than updating authutils is based on the decision to follow phc comliance as closely as feasible to allow easier versioning and updating of hashes for password based logins. To allow easy handling of correct but dated hashes a new state: RECOMMEND_UPDATE is introduced for passwords ontop of valid/invalid. Therefore a direct dependency of passwordbasedauthentication.c to authutils.c is chosen to have easier access to the deprecated functionality. To create the hash crypt_r is chosen to have a thread safe hashing possibility, this comes with the costs of portability since not all crypt libraries do support that. However libcrypt (used by debian:testing) as well as UFC crypt (used by buster) do. Due to the limitation of salt to 16 bytes the newly introduced pepper usage is limited to 4 bytes. This needs to be respected in using clients, e.g. gvmd and enforced there. (cherry picked from commit 1c6aeb5) # Conflicts: # CHANGELOG.md
(cherry picked from commit f727722)
In order to use passwordbasedauthentication.c directly dependable on authutils.c it should not be installed via CMakeLists.txt for authutils.h instead it should use passwordbasedauthentication.c (cherry picked from commit ed611d3)
(cherry picked from commit d67a617)
Since pba_hash does not change the password it is set to const char (cherry picked from commit b231fca)
Remove .ccls since it is developer specific settings and should not be within github. Instead of setting a macro if the internal gensalt_r method or the external should be used passwordbasedauthentication is guessing based on ifndef crypt_gensalt_r if crypt_gensalt_r is defined it is using the external salt function otherwise it is using it's own implementation. (cherry picked from commit b1f8eec)
The control of using the internal crypt_gensalt_r or the external by the used lcrypt library is now defined and set within util/CMakeLists.txt as EXTERNAL_CRYPT_GENSALT_R maco based on the version of the crypt module; when higher than 3.1.1 than use external otherwise internal implementation. (cherry picked from commit e59a243)
(cherry picked from commit c0afaef)
Co-authored-by: Björn Ricks <bjoern.ricks@gmail.com> (cherry picked from commit 116c51d)
Before doing a memcpy verify the length of hash; when shorter then CRYPT_OUTPUT_SIZE then use strlen otherwise CRYPT_OUTPUT_SIZE (cherry picked from commit 65cf632)
util/CMakeLists.txt check if CRYPT_M_VERSION is DEFINED before verifiying if the version is greater than 3.1.1 to prevent: Unknown arguments specified while building. (cherry picked from commit 7ea4005)
(cherry picked from commit 1115330)
mergify
bot
requested review from
ArnoStiefvater,
jjnicola and
timopollmeier
as code owners
April 29, 2021 14:40
mergify
bot
added
the
conflicts
This backport pull request has merge conflicts that need to be resolved
label
Apr 29, 2021
bjoernricks
approved these changes
Apr 30, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an automatic backport of pull request #484 done by Mergify.
Cherry-pick of 1c6aeb5 has failed:
To fix up this pull request, you can check it out locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/
Mergify commands and options
More conditions and actions can be found in the documentation.
You can also trigger Mergify actions by commenting on this pull request:
@Mergifyio refresh
will re-evaluate the rules@Mergifyio rebase
will rebase this PR on its base branch@Mergifyio update
will merge the base branch into this PR@Mergifyio backport <destination>
will backport this PR on<destination>
branchAdditionally, on Mergify dashboard you can:
Finally, you can contact us on https://mergify.io/