[GH-ISSUE #1477] dynamic_compiler_plug.c cannot be a plugin (needs to be renamed) #952

Closed
opened 2026-10-14 03:29:47 +07:00 by bsakaguchi · 7 comments
Owner

Originally created by @frank-dittrich on GitHub (Jun 28, 2015).
Original GitHub issue: https://github.com/openwall/john/issues/1477

Otherwise, build fails when I try to create a minimal john binary by moving all plugins somewhere else:

john.o: In function `john_register_one':
/home/fd/git/JtR/src/john.c:279: undefined reference to `dynamic_compile'
/home/fd/git/JtR/src/john.c:280: undefined reference to `dynamic_assign_script_to_format'
/home/fd/git/JtR/src/john.c:279: undefined reference to `dynamic_compile'
/home/fd/git/JtR/src/john.c:280: undefined reference to `dynamic_assign_script_to_format'

And I guess come more functions need to be moved from dynamic_compiler_fmt_plug.c to the (renamed) dynamic_compiler_plug.c, because when I move dynamic_compiler_plug.c back in place, the build still fails:

john.o: In function `john_register_one':
/home/fd/git/JtR/src/john.c:280: undefined reference to `dynamic_assign_script_to_format'
/home/fd/git/JtR/src/john.c:280: undefined reference to `dynamic_assign_script_to_format'

Ideally, a first commit would just rename dynamic_compiler_plug.c (and add the new object file to Makefile.in (and if you care, also to Makefile.legacy), the second would just move all the functions required for a non-plugin build.
I don't want to interfere with @jfoug here, that's why I'll not touch these files now, and wait whether or not I'll have to adjust Makefile.legacy...

Originally created by @frank-dittrich on GitHub (Jun 28, 2015). Original GitHub issue: https://github.com/openwall/john/issues/1477 Otherwise, build fails when I try to create a minimal john binary by moving all plugins somewhere else: ``` john.o: In function `john_register_one': /home/fd/git/JtR/src/john.c:279: undefined reference to `dynamic_compile' /home/fd/git/JtR/src/john.c:280: undefined reference to `dynamic_assign_script_to_format' /home/fd/git/JtR/src/john.c:279: undefined reference to `dynamic_compile' /home/fd/git/JtR/src/john.c:280: undefined reference to `dynamic_assign_script_to_format' ``` And I guess come more functions need to be moved from dynamic_compiler_fmt_plug.c to the (renamed) dynamic_compiler_plug.c, because when I move dynamic_compiler_plug.c back in place, the build still fails: ``` john.o: In function `john_register_one': /home/fd/git/JtR/src/john.c:280: undefined reference to `dynamic_assign_script_to_format' /home/fd/git/JtR/src/john.c:280: undefined reference to `dynamic_assign_script_to_format' ``` Ideally, a first commit would just rename dynamic_compiler_plug.c (and add the new object file to Makefile.in (and if you care, also to Makefile.legacy), the second would just move all the functions required for a non-plugin build. I don't want to interfere with @jfoug here, that's why I'll not touch these files now, and wait whether or not I'll have to adjust Makefile.legacy...
Author
Owner

@jfoug commented on GitHub (Jun 28, 2015):

I will get this fully working, including the Makefile.legacy. Pretty simple stuff. There will still be some dynamic compiler 'looking' stuff in john.c, BUT if the format (which is a _plug.c) is removed, then there will never be a format that satisfies the valid() for a dynamic=expression format.

But you are right, the compiler can not be a _plug.c, or there will be no way to hook it properly into john.c

<!-- gh-comment-id:116354502 --> @jfoug commented on GitHub (Jun 28, 2015): I will get this fully working, including the Makefile.legacy. Pretty simple stuff. There will still be some dynamic compiler 'looking' stuff in john.c, BUT if the format (which is a _plug.c) is removed, then there will never be a format that satisfies the valid() for a dynamic=expression format. But you are right, the compiler can not be a _plug.c, or there will be no way to hook it properly into john.c
Author
Owner

@jfoug commented on GitHub (Jun 29, 2015):

I really think I am going to need both a dyanamic_compiler.c and dynamic_compiler_plug.c

The dynamic_compiler.c will be pretty thin. Just some global data, and the dynamic_assign_script_to_format function.

the dynamic_compiler_plug.c will have the rest. This will be needed when I start adding other hash types (Whirlpool, Tiger, RipeMD, etc). Those crypts are plugs. I could not add them to dynamic_compiler.c without turning all of those hashes into non-plugs.

<!-- gh-comment-id:116739222 --> @jfoug commented on GitHub (Jun 29, 2015): I really think I am going to need both a dyanamic_compiler.c and dynamic_compiler_plug.c The dynamic_compiler.c will be pretty thin. Just some global data, and the dynamic_assign_script_to_format function. the dynamic_compiler_plug.c will have the rest. This will be needed when I start adding other hash types (Whirlpool, Tiger, RipeMD, etc). Those crypts are plugs. I could not add them to dynamic_compiler.c without turning all of those hashes into non-plugs.
Author
Owner

@jfoug commented on GitHub (Jun 29, 2015):

This may be a hard issue to split out :(

I need to look at how I did this in dynamic, which does not force require the plug'd hashes to be there.

<!-- gh-comment-id:116749484 --> @jfoug commented on GitHub (Jun 29, 2015): This may be a hard issue to split out :( I need to look at how I did this in dynamic, which does not force require the plug'd hashes to be there.
Author
Owner

@jfoug commented on GitHub (Jun 29, 2015):

Ok, I have the hashes in there. I do still think there is a problem with whirlpool. The only reason we can build once we move that _plug file, is because we are using oSSL. If building with an older oSSL that does not have whirlpool, then we would not be able to remove that file.

<!-- gh-comment-id:116767813 --> @jfoug commented on GitHub (Jun 29, 2015): Ok, I have the hashes in there. I do still think there is a problem with whirlpool. The only reason we can build once we move that _plug file, is because we are using oSSL. If building with an older oSSL that does not have whirlpool, then we would not be able to remove that file.
Author
Owner

@jfoug commented on GitHub (Jun 29, 2015):

I am closing this. I have all hashes added, and it builds OK. However, my statement about whirlpool does stand. It should not be a plug.

<!-- gh-comment-id:116805444 --> @jfoug commented on GitHub (Jun 29, 2015): I am closing this. I have all hashes added, and it builds OK. However, my statement about whirlpool does stand. It should not be a plug.
Author
Owner

@magnumripper commented on GitHub (Jun 29, 2015):

the dynamic_compiler_plug.c will have the rest. This will be needed when I start adding other hash types (Whirlpool, Tiger, RipeMD, etc). Those crypts are plugs. I could not add them to dynamic_compiler.c without turning all of those hashes into non-plugs.

You could just convert all files like whirlpool_plug.c to non-plugs. Having them as plugins is nice during development but there's no particular reason to keep them as plugins now.

Basically, if several files/formats depend on foo, foo should not be a plugin.

<!-- gh-comment-id:116845010 --> @magnumripper commented on GitHub (Jun 29, 2015): > the dynamic_compiler_plug.c will have the rest. This will be needed when I start adding other hash types (Whirlpool, Tiger, RipeMD, etc). Those crypts are plugs. I could not add them to dynamic_compiler.c without turning all of those hashes into non-plugs. You could just convert all files like `whirlpool_plug.c` to non-plugs. Having them as plugins is nice during development but there's no particular reason to keep them as plugins now. Basically, if several files/formats depend on _foo_, _foo_ should not be a plugin.
Author
Owner

@jfoug commented on GitHub (Jun 29, 2015):

The only one that is not already a non-plug is whirlpool_plug.c I will do this shortly. The other 'hashes' (sph ripemd, tiger, haval, etc) are all non-plugs.

Whirlpool has not been demoted to a non-plug probably because we 'often' can compile without that file, since we use oSSL normally. However, if oSSL whirlpool does not exist, then lack of this plug file will cause linkage failures. I will get this one fixed.

<!-- gh-comment-id:116857568 --> @jfoug commented on GitHub (Jun 29, 2015): The only one that is not already a non-plug is whirlpool_plug.c I will do this shortly. The other 'hashes' (sph ripemd, tiger, haval, etc) are all non-plugs. Whirlpool has not been demoted to a non-plug probably because we 'often' can compile without that file, since we use oSSL normally. However, if oSSL whirlpool does not exist, then lack of this plug file will cause linkage failures. I will get this one fixed.
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#952
No description provided.