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

Switch DHCAST128 UAM to use libgcrypt #1506

Merged
merged 1 commit into from
Sep 22, 2024

Conversation

NJRoadfan
Copy link
Contributor

Switches the DHCAST128 UAM from WolfSSL+Nettle to libgcrypt for CAST encryption functions.

@@ -42,15 +42,16 @@ if have_embedded_ssl
ssl_links += libatalk
endif

if have_ssl
if have_libgcrypt
Copy link
Member

Choose a reason for hiding this comment

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

I think we can remove the have_libgcrypt conditional and assume that this library is always available. Which we can safely do, since setup will fail early in the Meson script if libgcrypt cannot be detected.

@rdmark
Copy link
Member

rdmark commented Sep 21, 2024

@demonfoo Heads-up that you may want to test compatibility with your AFP client with this change.

@demonfoo
Copy link
Contributor

@rdmark I'd been considering reimplementing that based on libgcrypt, actually. I'll build it In a VM and try it out.

@demonfoo
Copy link
Contributor

demonfoo commented Sep 21, 2024

@rdmark I was able (with a bit of messing about) to get it building under my FreeBSD 13.4 VM. Forcing the DHCAST128 UAM succeeds (I've confirmed the DSO it installed is the new gcrypt-using one). The code appears to do the right things in all the relevant places.

@NJRoadfan
Copy link
Contributor Author

Found some nagging meson issues when not using PAM since crypt.h wasn't being linked. Tested DHCAST128 with and without PAM and its working.

@NJRoadfan NJRoadfan force-pushed the njroadfan-dhxlibgcrypt branch 2 times, most recently from a35821e to 807c0d5 Compare September 21, 2024 21:29
@NJRoadfan
Copy link
Contributor Author

Fixed the change password function. Now a user can change their password.

@demonfoo
Copy link
Contributor

demonfoo commented Sep 21, 2024

I don't recall Apple's server implementations returning kFPAccessDenied when the password change was complete, but it does change the password.

Edit: Nevermind, that seems to be something local with PAM. Seems I'm getting stuff like:

Sep 21 16:13:14 freebsd afpd[35024]: in pam_sm_chauthtok(): pw_mkdb() failed

which doesn't seem to be anything specific to afpd.

@rdmark
Copy link
Member

rdmark commented Sep 22, 2024

@demonfoo Thanks for testing!

@NJRoadfan
Copy link
Contributor Author

@demonfoo I'm not seeing any PAM errors here.

@demonfoo
Copy link
Contributor

demonfoo commented Sep 22, 2024

@demonfoo I'm not seeing any PAM errors here.

It looks like this may be some kind of bug in FreeBSD's libutil. Running truss on the process shows its invocation of pwd_mkdb does work, but it looks like it's not waiting for the process correctly, and thus pw_mkdb() is returning -1 even though it shouldn't.

Edit: This is on FreeBSD 13.4-RELEASE/amd64 in a VirtualBox VM, if it matters.

@NJRoadfan NJRoadfan marked this pull request as ready for review September 22, 2024 17:41
Switches the DHCAST128 UAM from WolfSSL+Nettle to libgcrypt for CAST encryption functions. Update documentation.
@rdmark rdmark merged commit 556711e into Netatalk:main Sep 22, 2024
14 checks passed
@NJRoadfan NJRoadfan deleted the njroadfan-dhxlibgcrypt branch September 22, 2024 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants