[GH-ISSUE #499] GPG-opencl's valid() too promiscuous, segfault #200

Closed
opened 2026-10-14 02:56:06 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @magnumripper on GitHub (Feb 6, 2014).
Original GitHub issue: https://github.com/openwall/john/issues/499

Originally assigned to: @kholia on GitHub.

The last two commented out test vectors should be rejected in valid() but are not. I don't understand why (see #482).

Originally created by @magnumripper on GitHub (Feb 6, 2014). Original GitHub issue: https://github.com/openwall/john/issues/499 Originally assigned to: @kholia on GitHub. The last two commented out test vectors should be rejected in valid() but are not. I don't understand why (see #482).
bsakaguchi 2026-10-14 02:56:06 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@frank-dittrich commented on GitHub (Oct 28, 2014):

I didn't want to create a new issue for gpg's valid(), that's why just an addition to this issue:

Here's a test file that causes john to segfault:

$ ./john fail_gpg.pw 
Segmentation fault (core dumped)
$ cat fail_gpg.pw 
$gpg$*16*36*1024*0a4c2fb9d1ff24b817212a9cc0d3f2d84184a368ff3a04c337566812d037e5fe28933eaa*1*255*2*3*8*b312f3046fdb046c*0*a0ccc71dedfce4d3*128*f9235c132a796b0fd67f59567cf01dcf0a4ebbc8607a1033cefd2d52be40334e8cfba60737751b1bf16e36399340698656255917ca65f1f6f7806f05f686889ef7dc7030dd17dc9b45a1e1f01ab8d8a676d5a1759ac65bd1e2e50282f9926b44a156f7fea5e4ae5883e10f533efb9cd857efb84d23062f9741b4bd2ba70abcb3*
<!-- gh-comment-id:60812325 --> @frank-dittrich commented on GitHub (Oct 28, 2014): I didn't want to create a new issue for gpg's valid(), that's why just an addition to this issue: Here's a test file that causes john to segfault: ``` $ ./john fail_gpg.pw Segmentation fault (core dumped) $ cat fail_gpg.pw $gpg$*16*36*1024*0a4c2fb9d1ff24b817212a9cc0d3f2d84184a368ff3a04c337566812d037e5fe28933eaa*1*255*2*3*8*b312f3046fdb046c*0*a0ccc71dedfce4d3*128*f9235c132a796b0fd67f59567cf01dcf0a4ebbc8607a1033cefd2d52be40334e8cfba60737751b1bf16e36399340698656255917ca65f1f6f7806f05f686889ef7dc7030dd17dc9b45a1e1f01ab8d8a676d5a1759ac65bd1e2e50282f9926b44a156f7fea5e4ae5883e10f533efb9cd857efb84d23062f9741b4bd2ba70abcb3* ```
Author
Owner

@jfoug commented on GitHub (Nov 23, 2014):

Franks issue fixed on CPU with d1572a2

The same patch (for opencl), can easily cause the last 2 hashes to fail valid, if the valid changes I just did get ported, BUT:

} else if (usage == 255 && spec == 3 && algorithm == 1) {
        /* UNK */
        /* gpg --homedir . --s2k-cipher-algo 3des --simple-sk-checksum --gen-key */
-       ex_flds = 1; /* handle p */
+       ex_flds = 0; /* do NOT handle p at this time.  Cause the hash to be invalid. */
    } else {
<!-- gh-comment-id:64122203 --> @jfoug commented on GitHub (Nov 23, 2014): Franks issue fixed on CPU with d1572a2 The same patch (for opencl), can easily cause the last 2 hashes to fail valid, if the valid changes I just did get ported, BUT: ``` C } else if (usage == 255 && spec == 3 && algorithm == 1) { /* UNK */ /* gpg --homedir . --s2k-cipher-algo 3des --simple-sk-checksum --gen-key */ - ex_flds = 1; /* handle p */ + ex_flds = 0; /* do NOT handle p at this time. Cause the hash to be invalid. */ } else { ```
Author
Owner

@jfoug commented on GitHub (Nov 23, 2014):

86ead19 Ports to opencl I did make the change listed in my above comment, and this causes the last 2 hashes to be invalid (on opencl), UNTIL we can handle them.

$ ../run/john gpg.in -form=gpg
Loaded 2 password hashes with 2 different salts (gpg, OpenPGP / GnuPG Secret Key [32/64])
Press 'q' or Ctrl-C to abort, almost any other key for status
openwall         (3)
openwall         (2)
2g 0:00:00:00 DONE 1/3 (2014-11-23 10:05) 43.47g/s 347.8p/s 347.8c/s 347.8C/s 2..22
Use the "--show" option to display all of the cracked passwords reliably
Session completed

$ ../run/john gpg.in -form=gpg-opencl
No password hashes loaded (see FAQ)
<!-- gh-comment-id:64122875 --> @jfoug commented on GitHub (Nov 23, 2014): 86ead19 Ports to opencl I did make the change listed in my above comment, and this causes the last 2 hashes to be invalid (on opencl), UNTIL we can handle them. ``` $ ../run/john gpg.in -form=gpg Loaded 2 password hashes with 2 different salts (gpg, OpenPGP / GnuPG Secret Key [32/64]) Press 'q' or Ctrl-C to abort, almost any other key for status openwall (3) openwall (2) 2g 0:00:00:00 DONE 1/3 (2014-11-23 10:05) 43.47g/s 347.8p/s 347.8c/s 347.8C/s 2..22 Use the "--show" option to display all of the cracked passwords reliably Session completed $ ../run/john gpg.in -form=gpg-opencl No password hashes loaded (see FAQ) ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openwall/john#200
No description provided.