Skip to content

Sync ssh-opencl with the CPU format #5791

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

Merged
merged 5 commits into from
Jun 25, 2025

Conversation

solardiz
Copy link
Member

This brings ssh-opencl almost on par with the CPU format, except for new format keys that use bcrypt-pbkdf.

Successfully tested on POCL and on most devices on "super" (except for Xeon Phi, where it prints an LLVM error and gets stuck), including wordlist-based cracking of all of our test vectors plus john-samples that fit this revised format's constraints. It correctly refuses to load the bcrypt-pbkdf keys, and correctly loads and cracks all others.

Also drop some unused definitions.

Related to 87c1e3b
@solardiz
Copy link
Member Author

This also touches pem-opencl. I've confirmed that it passes tests.

The code in ssh_kernel.cl is intentionally kept closer to the C version, not converted to idiomatic OpenCL except where necessary or where other changes are made anyway. So there are quite some uses of unsigned int and unsigned char, not changed to uint and uchar.

@solardiz
Copy link
Member Author

In the kernel here, I hard-coded self_test_running to 0, but this reduces tests coverage. We should also re-test with it set to 1.

We have no easy and readily available way to get the actual variable from host, right?

@magnumripper
Copy link
Member

In the kernel here, I hard-coded self_test_running to 0, but this reduces tests coverage. We should also re-test with it set to 1.

We have no easy and readily available way to get the actual variable from host, right?

Easy peasy, I did that in oldoffice-opencl, transferred/updated in set_salt(). It's cl_mem cl_benchmark in the host code and __global uint *benchmark in the kernel parameters.

@solardiz
Copy link
Member Author

Easy peasy, I did that in oldoffice-opencl, transferred/updated in set_salt(). It's cl_mem cl_benchmark in the host code and __global uint *benchmark in the kernel parameters.

I didn't realize we were doing this already. But it's a separate buffer, transferred separately. Not as easy and lightweight as I'd have liked. Maybe it's better to add a field to the salt struct, so that there's no extra buffer to transfer.

@solardiz
Copy link
Member Author

Maybe it's better to add a field to the salt struct, so that there's no extra buffer to transfer.

OK, this was easy. Done. But now it's failing on super's NVIDIAs (but not AMD, nor CPUs), for the single-DES test vector on the very last ASN.1 check. I'll need to investigate.

@solardiz
Copy link
Member Author

now it's failing on super's NVIDIAs (but not AMD, nor CPUs), for the single-DES test vector on the very last ASN.1 check.

Bug found and fixed. All tests are passing again.

@solardiz solardiz merged commit 5baa3c4 into openwall:bleeding-jumbo Jun 25, 2025
32 of 33 checks passed
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.

2 participants