[GH-ISSUE #440] gpg2john: salt may be printed twice #169

Closed
opened 2026-10-14 02:55:11 +07:00 by bsakaguchi · 4 comments
Owner

Originally created by @magnumripper on GitHub (Dec 26, 2013).
Original GitHub issue: https://github.com/openwall/john/issues/440

Originally assigned to: @kholia on GitHub.

    switch(s2k.m_spec) {
        case SPEC_SIMPLE:
            break;
        case SPEC_SALTED:
            printf("*0*");
            print_hex((unsigned char*)s2k.m_salt, 8);

        case SPEC_ITERATED_SALTED:
            printf("*%d*", s2k.m_count);
            print_hex((unsigned char*)s2k.m_salt, 8);
            break;
    }

Either a break is missing after SPEC_SALTED - or the print_hex in SPEC_ITERATED_SALTED should be removed. I wasn't sure which so I do nothing. To me it seems the format always wants to read an iterations count so maybe it too needs fixes?

Originally created by @magnumripper on GitHub (Dec 26, 2013). Original GitHub issue: https://github.com/openwall/john/issues/440 Originally assigned to: @kholia on GitHub. ``` switch(s2k.m_spec) { case SPEC_SIMPLE: break; case SPEC_SALTED: printf("*0*"); print_hex((unsigned char*)s2k.m_salt, 8); case SPEC_ITERATED_SALTED: printf("*%d*", s2k.m_count); print_hex((unsigned char*)s2k.m_salt, 8); break; } ``` Either a break is missing after SPEC_SALTED - or the print_hex in SPEC_ITERATED_SALTED should be removed. I wasn't sure which so I do nothing. To me it seems the format always wants to read an iterations count so maybe it too needs fixes?
bsakaguchi 2026-10-14 02:55:11 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@kholia commented on GitHub (Dec 26, 2013):

To me it seems the format always wants to read an iterations count so maybe it too needs fixes?

We also support "SPEC_SIMPLE" stuff, which doesn't have "iterations".

<!-- gh-comment-id:31231168 --> @kholia commented on GitHub (Dec 26, 2013): > To me it seems the format always wants to read an iterations count so maybe it too needs fixes? We also support "SPEC_SIMPLE" stuff, which doesn't have "iterations".
Author
Owner

@kholia commented on GitHub (Dec 26, 2013):

Fixed in commit 3dd0f74a83. Please check!

<!-- gh-comment-id:31231265 --> @kholia commented on GitHub (Dec 26, 2013): Fixed in commit 3dd0f74a830d22ef5c01364872ef9744e5d892cb. Please check!
Author
Owner

@magnumripper commented on GitHub (Dec 26, 2013):

Yes but get_salt() reads cs.count anyway. So if there is no count in the hash, it will read the salt into cs.count and then read null or garbage into the salt :-(

<!-- gh-comment-id:31231269 --> @magnumripper commented on GitHub (Dec 26, 2013): Yes but get_salt() reads cs.count anyway. So if there is no count in the hash, it will read the _salt_ into cs.count and then read null or garbage into the salt :-(
Author
Owner

@kholia commented on GitHub (Dec 26, 2013):

Yes but get_salt() reads cs.count anyway. So if there is no count in the hash, it will read the salt into cs.count and then read null or garbage into the salt :-(

This should be fixed now with commit f26e26432c. Good catch ;(

<!-- gh-comment-id:31232213 --> @kholia commented on GitHub (Dec 26, 2013): > Yes but get_salt() reads cs.count anyway. So if there is no count in the hash, it will read the salt into cs.count and then read null or garbage into the salt :-( This should be fixed now with commit f26e26432c85f4e912a7aff18f493d7fb1b042fd. Good catch ;(
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#169
No description provided.