Skip to content
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

Add m_hash_crypt module #246

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Conversation

Elizafox
Copy link
Contributor

@Elizafox Elizafox commented Nov 28, 2020

This is a crypt(3)-based hash module for compatibility with Unix crypt and other IRC daemons that use it. This relies on the system crypt which may unfortunately be deficient, hence there are ugly ifdef's.

At some point I plan on implementing shims for deficient systems, but this will do for now.

Note: I've tried to make this build on macOS, but it's a terrible idea to use this module there. macOS has a really bad crypt that doesn't support any modern hash functions. All it will support for now is DES, and needless to say this is not what you want most likely.

This is a crypt(3)-based hash function for compatibility with Unix crypt
and other IRC daemons that use it. This relies on the system crypt which
may unfortunately be deficient, hence there are ugly ifdef's.
Turns out that you can't depend on pkg-config just picking up -lcrypt
everywhere. It doesn't work on my Debian box for example.
Copy link
Member

@genius3000 genius3000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a line comment about the names.

3.0/m_hash_crypt.cpp Outdated Show resolved Hide resolved
Basically, we know that linux, freebsd, and netbsd require -lcrypt.
openbsd and darwin don't (and the build will fail on at least macos if
we add that flag). So, add the known systems to the LinkerFlags and go
on our merry way.

The reason we can't use pkg-config is because libcrypt-dev is not widely
available yet (Debian stale notably does not have it) and operating
systems like FreeBSD are unlikely to really ever have it.
These are insecure and should not be generated.

crypt-generic is introduced instead, for access to the system crypt
directly. This shouldn't be used to generate passwords, but can be used
for password checking.
@Elizafox
Copy link
Contributor Author

I deliberately broke the macOS build because their crypt really sucks and it's not worth the trouble.

@Elizafox Elizafox closed this Dec 4, 2020
@Elizafox Elizafox reopened this Dec 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants