[GH-ISSUE #1599] setup a CI for building with CommonCrypto vs oSSL #1049

Closed
opened 2026-10-14 03:33:07 +07:00 by bsakaguchi · 19 comments
Owner

Originally created by @jfoug on GitHub (Aug 1, 2015).
Original GitHub issue: https://github.com/openwall/john/issues/1599

I am not sure this could be emulated, but it would be great to setup a CI in an environment like this, so that alignment / endianity issues are caught when the change is made, or for all new formats.

Originally created by @jfoug on GitHub (Aug 1, 2015). Original GitHub issue: https://github.com/openwall/john/issues/1599 I am not sure this could be emulated, but it would be great to setup a CI in an environment like this, so that alignment / endianity issues are caught when the change is made, or for all new formats.
Author
Owner

@jfoug commented on GitHub (Aug 2, 2015):

Ok, at this time we have these CI autotesting JtR upon each commit:

AC-64 bit OMP OpenCL (sse-4.1 ?)
AC-64 bit clang no OMP (sse-?)
AC-64 bit MinGW cross compile OMP no OpenCL sse2
legacy 32 bit -any
legacy 32 bit -sse2

If we are missing anything, it would be these things (all that I can think of).

  1. BE / Unaligned (this issue).
  2. AC build with all _plug.c files removed.
  3. OSX build with CommonCryptoLib

@magnumripper or @kholia can you think of any other common build environment that we seem to have fail over time ? I think the mv *_plug.c unused test should be pretty easy to engineer. The other 2, I am open to suggestions. I can not see how to do them, without building our own CI on some dedicated HW.

<!-- gh-comment-id:126965431 --> @jfoug commented on GitHub (Aug 2, 2015): Ok, at this time we have these CI autotesting JtR upon each commit: AC-64 bit OMP OpenCL (sse-4.1 ?) AC-64 bit clang no OMP (sse-?) AC-64 bit MinGW cross compile OMP no OpenCL sse2 legacy 32 bit -any legacy 32 bit -sse2 If we are missing anything, it would be these things (all that I can think of). 1. BE / Unaligned (this issue). 2. AC build with all _plug.c files removed. 3. OSX build with CommonCryptoLib @magnumripper or @kholia can you think of any other common build environment that we seem to have fail over time ? I think the `mv *_plug.c unused` test should be pretty easy to engineer. The other 2, I am open to suggestions. I can not see how to do them, without building our own CI on some dedicated HW.
Author
Owner

@magnumripper commented on GitHub (Aug 2, 2015):

Cryptolib is not OSX specific, and it's open source AFAIK. So it should be testable on any Linux.

<!-- gh-comment-id:127074936 --> @magnumripper commented on GitHub (Aug 2, 2015): Cryptolib is not OSX specific, and it's open source AFAIK. So it should be testable on any Linux.
Author
Owner

@jfoug commented on GitHub (Aug 2, 2015):

Haven't we had more problems on OSX than just the CryptoLib stuff, or was that the main sticking point?

<!-- gh-comment-id:127083222 --> @jfoug commented on GitHub (Aug 2, 2015): Haven't we had more problems on OSX than just the CryptoLib stuff, or was that the main sticking point?
Author
Owner

@magnumripper commented on GitHub (Aug 2, 2015):

I think we mean CommonCrypto, not CryptoLib. I usually handle any other problems (they are few and often common with other *BSD) since I use a MacBook as my main devel gear. But I don't use to bother using/testing CommonCrypto. I think we should ideally support it though - it's been on my to-do list for quite some time to support it as a full replacement for OpenSSL. Supporting a weird mix (like we do now unless it's broken) is just weird and messy so we should eventually drop that.

<!-- gh-comment-id:127085592 --> @magnumripper commented on GitHub (Aug 2, 2015): I think we mean CommonCrypto, not CryptoLib. I usually handle any other problems (they are few and often common with other *BSD) since I use a MacBook as my main devel gear. But I don't use to bother using/testing CommonCrypto. I think we should ideally support it though - it's been on my to-do list for quite some time to support it as a full replacement for OpenSSL. Supporting a weird mix (like we do now unless it's broken) is just weird and messy so we should eventually drop that.
Author
Owner

@magnumripper commented on GitHub (Aug 3, 2015):

#605

<!-- gh-comment-id:127085667 --> @magnumripper commented on GitHub (Aug 3, 2015): #605
Author
Owner

@jfoug commented on GitHub (Aug 5, 2015):

I may look at adding a once a day build to one of our Sparc boxes. I just need to know how to let the world know there is a problem. I may just use mailx to send mail listing the problem to specific recipients (myself first), and then I could create an issue each time something breaks. Here is an example

#!/usr/bin/perl

my $v="";
chdir ('~/john/tst-build/src');
my $jnk = `git pull`;
`make -s distclean`;
$v = `git rev-parse --short HEAD`;
chomp $v;
my $dt = `date`;
#print ("Starting run on version $v at: $dt");   # should have no screen output for cron tasks
my $s = `./configure 2>&1 && make -sj4 2>&1 && ../run/john -test=0 2>&1 && ../run/john -test=0 -form=dynamic-all 2>&1`;
my $ret = $?;
if ($ret != 0) { `../failure_script "$s"` }
else { `../success_script "$s"` }

Set that script up as a cron task, to run at some idle time for the machine (8 or 9 pm is usually pretty idle). The failure_script / success_script are just place holders here. I would probably write something in this script, likely just dump $s to a temp file, and mailx it out (on failure). Success I would likely do nothing.

Now, this would not give us a nice green button, BUT it would daily inform us if there is problem code. Certainly much better to know early on, vs letting it sit until we do the 'big make it work' code check once or twice a year.

Note, I will have to have a 'custom' john.conf (or john-local.conf) to do this, since there ARE busted formats on sparc that we know about and are simply not fixing ATM. I would certainly want to ignore those, so that we would not fail every time. Since we are doing a git-pull, I would probably just put a john-local.conf file out there, and keep it properly up to date if there are formats we WANT to ignore in this test.

<!-- gh-comment-id:127999130 --> @jfoug commented on GitHub (Aug 5, 2015): I may look at adding a once a day build to one of our Sparc boxes. I just need to know how to let the world know there is a problem. I may just use mailx to send mail listing the problem to specific recipients (myself first), and then I could create an issue each time something breaks. Here is an example ``` Perl #!/usr/bin/perl my $v=""; chdir ('~/john/tst-build/src'); my $jnk = `git pull`; `make -s distclean`; $v = `git rev-parse --short HEAD`; chomp $v; my $dt = `date`; #print ("Starting run on version $v at: $dt"); # should have no screen output for cron tasks my $s = `./configure 2>&1 && make -sj4 2>&1 && ../run/john -test=0 2>&1 && ../run/john -test=0 -form=dynamic-all 2>&1`; my $ret = $?; if ($ret != 0) { `../failure_script "$s"` } else { `../success_script "$s"` } ``` Set that script up as a cron task, to run at some idle time for the machine (8 or 9 pm is usually pretty idle). The failure_script / success_script are just place holders here. I would probably write something in this script, likely just dump $s to a temp file, and mailx it out (on failure). Success I would likely do nothing. Now, this would not give us a nice green button, BUT it would daily inform us if there is problem code. Certainly much better to know early on, vs letting it sit until we do the 'big make it work' code check once or twice a year. Note, I will have to have a 'custom' john.conf (or john-local.conf) to do this, since there ARE busted formats on sparc that we know about and are simply not fixing ATM. I would certainly want to ignore those, so that we would not fail every time. Since we are doing a git-pull, I would probably just put a john-local.conf file out there, and keep it properly up to date if there are formats we WANT to ignore in this test.
Author
Owner

@jfoug commented on GitHub (Aug 5, 2015):

I got git installed on my sparc box, so can now put this script into play. To get git installed, I found OpenCSW project which made things 'easy', lol. I hope to have this build bot done today.

@magnumripper would you like an email upon failures?

<!-- gh-comment-id:128050576 --> @jfoug commented on GitHub (Aug 5, 2015): I got git installed on my sparc box, so can now put this script into play. To get git installed, I found OpenCSW project which made things 'easy', lol. I hope to have this build bot done today. @magnumripper would you like an email upon failures?
Author
Owner

@jfoug commented on GitHub (Aug 5, 2015):

Testing: PBKDF2-HMAC-MD4 [PBKDF2-MD4 32/32]... FAILED (cmp_all(1))

Testing: PBKDF2-HMAC-MD5 [PBKDF2-MD5 32/32]... FAILED (cmp_all(1))

Testing: pomelo [POMELO 32/32]... FAILED (cmp_all(1))

Testing: Raw-SHA512 [SHA512 32/32 generic]... FAILED (get_hash[0](0) 5!=8)

Testing: Raw-SHA384 [SHA384 32/32 generic]... FAILED (get_hash[0](0) a!=b)

Pomelo I will ignore. The others I think are new. Likely since we started the reduced rounds stuff.

<!-- gh-comment-id:128076192 --> @jfoug commented on GitHub (Aug 5, 2015): ``` Testing: PBKDF2-HMAC-MD4 [PBKDF2-MD4 32/32]... FAILED (cmp_all(1)) Testing: PBKDF2-HMAC-MD5 [PBKDF2-MD5 32/32]... FAILED (cmp_all(1)) Testing: pomelo [POMELO 32/32]... FAILED (cmp_all(1)) Testing: Raw-SHA512 [SHA512 32/32 generic]... FAILED (get_hash[0](0) 5!=8) Testing: Raw-SHA384 [SHA384 32/32 generic]... FAILED (get_hash[0](0) a!=b) ``` Pomelo I will ignore. The others I think are new. Likely since we started the reduced rounds stuff.
Author
Owner

@jfoug commented on GitHub (Aug 5, 2015):

Looks like I am only going to be able to send mail to myself anyway. If I try outside addresses from this server, I get "Relaying denied", so I can only send to an inhouse address from this server. That is OK, I can send the email to my own account, and quickly be informed when there are problems.

<!-- gh-comment-id:128097154 --> @jfoug commented on GitHub (Aug 5, 2015): Looks like I am only going to be able to send mail to myself anyway. If I try outside addresses from this server, I get "Relaying denied", so I can only send to an inhouse address from this server. That is OK, I can send the email to my own account, and quickly be informed when there are problems.
Author
Owner

@jfoug commented on GitHub (Aug 5, 2015):

here is my current test script (email address removed)

#!/usr/bin/perl

my $v="";
chdir ('~/john/tst-build/src');
my $jnk = `git pull 2>&1`;
$jnk = `gmake -s distclean 2>&1`;
$v = `git rev-parse --short HEAD`;
chomp $v;
my $dt = `date`;
my $s = `./configure 2>&1 && gmake -sj4 2>&1 && ../run/john -test=0 2>&1 && ../run/john -test=0 -form=dynamic-all 2>&1`;
my $ret = $?;
if ($ret != 0) {
  chdir ("..");
  open (FILE, "> results.txt");
  print "JTR build/test failed on $dt for git label $v\n\n";
  print FILE $s;
  close (FILE);
  `mailx -s "JtR Build/Test on Sparc failure" -r "JtR_BE_BuildBot@nowhere.com"  "someone@somewhere.com" < results.txt > /dev/null 2>&1`
}

Note, I have to use gmake on this box, but that is simply the way it is. solaris make is not happy with out makefile layout.

<!-- gh-comment-id:128098824 --> @jfoug commented on GitHub (Aug 5, 2015): here is my current test script (email address removed) ``` Perl #!/usr/bin/perl my $v=""; chdir ('~/john/tst-build/src'); my $jnk = `git pull 2>&1`; $jnk = `gmake -s distclean 2>&1`; $v = `git rev-parse --short HEAD`; chomp $v; my $dt = `date`; my $s = `./configure 2>&1 && gmake -sj4 2>&1 && ../run/john -test=0 2>&1 && ../run/john -test=0 -form=dynamic-all 2>&1`; my $ret = $?; if ($ret != 0) { chdir (".."); open (FILE, "> results.txt"); print "JTR build/test failed on $dt for git label $v\n\n"; print FILE $s; close (FILE); `mailx -s "JtR Build/Test on Sparc failure" -r "JtR_BE_BuildBot@nowhere.com" "someone@somewhere.com" < results.txt > /dev/null 2>&1` } ``` Note, I have to use gmake on this box, but that is simply the way it is. solaris make is not happy with out makefile layout.
Author
Owner

@jfoug commented on GitHub (Aug 5, 2015):

Ok, we now have a Sparc 'semi-CI'

I would like to add a no-plug build to circle-CI.

@magnum, is the only thing I have to do to 'simulate' this, is to make 'empty' fmt_externs.h and fmt_registers.h ? I would like to do this without having to do a configure.

So I would simply change the non-SIMD 64 bit build from this:

echo '******************************************************************************'
echo "now testing a NON-SIMD build"
echo '******************************************************************************'
echo ""
cd /base/JohnTheRipper/src
make -s distclean
CPPFLAGS="-mno-sse2" ./configure
if [ "x$?" != "x0" ] ; then exit 1 ; fi
make -sj4
if [ "x$?" != "x0" ] ; then exit 1 ; fi
../run/john --list=build-info
../run/john -test=0
if [ "x$?" != "x0" ] ; then exit 1 ; fi
../run/john -test=0 -form=dynamic-all
if [ "x$?" != "x0" ] ; then exit 1 ; fi

to this:

echo '******************************************************************************'
echo "now testing a NON-SIMD build"
echo '******************************************************************************'
echo ""
cd /base/JohnTheRipper/src
make -s distclean
CPPFLAGS="-mno-sse2" ./configure
if [ "x$?" != "x0" ] ; then exit 1 ; fi
make -sj4
if [ "x$?" != "x0" ] ; then exit 1 ; fi
../run/john --list=build-info
../run/john -test=0
if [ "x$?" != "x0" ] ; then exit 1 ; fi
../run/john -test=0 -form=dynamic-all
if [ "x$?" != "x0" ] ; then exit 1 ; fi
# Test a build with no _plug
echo >fmt_extern.h
echo >fmt_registers.h
make -s clean && make -sj4
if [ "x$?" != "x0" ] ; then exit 1 ; fi
../run/john --list=build-info
../run/john -test=0
if [ "x$?" != "x0" ] ; then exit 1 ; fi

But if I have to, I will move the _plug.* into a temp dir, and then configure, then move them back into src before continuing. I just wanted to avoid a configure if one was not needed.

<!-- gh-comment-id:128139782 --> @jfoug commented on GitHub (Aug 5, 2015): Ok, we now have a Sparc 'semi-CI' I would like to add a no-plug build to circle-CI. @magnum, is the only thing I have to do to 'simulate' this, is to make 'empty' fmt_externs.h and fmt_registers.h ? I would like to do this without having to do a configure. So I would simply change the non-SIMD 64 bit build from this: ``` sh echo '******************************************************************************' echo "now testing a NON-SIMD build" echo '******************************************************************************' echo "" cd /base/JohnTheRipper/src make -s distclean CPPFLAGS="-mno-sse2" ./configure if [ "x$?" != "x0" ] ; then exit 1 ; fi make -sj4 if [ "x$?" != "x0" ] ; then exit 1 ; fi ../run/john --list=build-info ../run/john -test=0 if [ "x$?" != "x0" ] ; then exit 1 ; fi ../run/john -test=0 -form=dynamic-all if [ "x$?" != "x0" ] ; then exit 1 ; fi ``` to this: ``` sh echo '******************************************************************************' echo "now testing a NON-SIMD build" echo '******************************************************************************' echo "" cd /base/JohnTheRipper/src make -s distclean CPPFLAGS="-mno-sse2" ./configure if [ "x$?" != "x0" ] ; then exit 1 ; fi make -sj4 if [ "x$?" != "x0" ] ; then exit 1 ; fi ../run/john --list=build-info ../run/john -test=0 if [ "x$?" != "x0" ] ; then exit 1 ; fi ../run/john -test=0 -form=dynamic-all if [ "x$?" != "x0" ] ; then exit 1 ; fi # Test a build with no _plug echo >fmt_extern.h echo >fmt_registers.h make -s clean && make -sj4 if [ "x$?" != "x0" ] ; then exit 1 ; fi ../run/john --list=build-info ../run/john -test=0 if [ "x$?" != "x0" ] ; then exit 1 ; fi ``` But if I have to, I will move the _plug.\* into a temp dir, and then configure, then move them back into src before continuing. I just wanted to avoid a configure if one was not needed.
Author
Owner

@magnumripper commented on GitHub (Aug 5, 2015):

@magnumripper would you like an email upon failures?

Sure, good stuff

Looks like I am only going to be able to send mail to myself anyway.

Aha. Well, just give me a heads-up if it's my bad 😆

<!-- gh-comment-id:128148572 --> @magnumripper commented on GitHub (Aug 5, 2015): > @magnumripper would you like an email upon failures? Sure, good stuff > Looks like I am only going to be able to send mail to myself anyway. Aha. Well, just give me a heads-up if it's my bad :laughing:
Author
Owner

@magnumripper commented on GitHub (Aug 5, 2015):

@magnum, is the only thing I have to do to 'simulate' this, is to make 'empty' fmt_externs.h and fmt_registers.h ? I would like to do this without having to do a configure.

Yeah I guess. Just try it!

Oh, but then you'll still have all those plugs in JOHN_OBJS or something, so build will be unneccessarily slow

<!-- gh-comment-id:128152043 --> @magnumripper commented on GitHub (Aug 5, 2015): > @magnum, is the only thing I have to do to 'simulate' this, is to make 'empty' fmt_externs.h and fmt_registers.h ? I would like to do this without having to do a configure. Yeah I guess. Just try it! Oh, but then you'll still have all those plugs in JOHN_OBJS or something, so build will be unneccessarily slow
Author
Owner

@jfoug commented on GitHub (Aug 6, 2015):

I might just do a quick ./configure then (I will make sure I do a ./configure -C prior, to so configure is much faster). I will move all *_plug.c into a temp, do ./configure -C, move the plugs back, then make clean && -sj4. That way we know it is 'correctly' built. Should not add more than 30s overhead, and that would include the ../run/john -test=0 code.

One other thing I find that can speed up, is instead of doing 2 tests (one -test=0 and one -test=0 -form-dynamic-all), is to simply create a john-local.conf in src (from within the script). Then we can set no disabled formats for the testing.

I will make these changes later tonite, and then close out this issue. We still do not test CommonCrypto but if that is needed, I will let @magnumripper figure that one out, lol. The CI testing we have now is pretty darn comprehensive.

<!-- gh-comment-id:128197036 --> @jfoug commented on GitHub (Aug 6, 2015): I might just do a quick ./configure then (I will make sure I do a ./configure -C prior, to so configure is much faster). I will move all *_plug.c into a temp, do ./configure -C, move the plugs back, then make clean && -sj4. That way we know it is 'correctly' built. Should not add more than 30s overhead, and that would include the ../run/john -test=0 code. One other thing I find that can speed up, is instead of doing 2 tests (one -test=0 and one -test=0 -form-dynamic-all), is to simply create a john-local.conf in src (from within the script). Then we can set no disabled formats for the testing. I will make these changes later tonite, and then close out this issue. We still do not test CommonCrypto but if that is needed, I will let @magnumripper figure that one out, lol. The CI testing we have now is pretty darn comprehensive.
Author
Owner

@magnumripper commented on GitHub (Aug 6, 2015):

Yeah I will do some overhaul for Commoncrypto later anyway.

<!-- gh-comment-id:128523897 --> @magnumripper commented on GitHub (Aug 6, 2015): Yeah I will do some overhaul for Commoncrypto later anyway.
Author
Owner

@jfoug commented on GitHub (Aug 9, 2015):

I changed issue title, since I now have a pseudo CI for building BE + !ARCH_UNALIGNED on a sparc-32 build.

<!-- gh-comment-id:129201144 --> @jfoug commented on GitHub (Aug 9, 2015): I changed issue title, since I now have a pseudo CI for building BE + !ARCH_UNALIGNED on a sparc-32 build.
Author
Owner

@jfoug commented on GitHub (Aug 11, 2015):

It is so nice to see this on my sparc box:

$cat ~/john/autobld/testing.log

Starting a JtR Sparc build/test at Wed Aug  5 15:21:09 CDT 2015
   Finished at Wed Aug  5 15:30:55 CDT 2015 : TEST FAILED, emails sent!

Starting a JtR Sparc build/test at Thu Aug  6 05:35:07 CDT 2015
   Finished at Thu Aug  6 05:45:12 CDT 2015 : test passed

Starting a JtR Sparc build/test at Fri Aug  7 05:35:10 CDT 2015
   Finished at Fri Aug  7 05:44:49 CDT 2015 : test passed

Starting a JtR Sparc build/test at Sat Aug  8 05:35:07 CDT 2015
   Finished at Sat Aug  8 05:44:35 CDT 2015 : test passed

Starting a JtR Sparc build/test at Sun Aug  9 05:35:04 CDT 2015
   Finished at Sun Aug  9 05:44:23 CDT 2015 : test passed

Starting a JtR Sparc build/test at Mon Aug 10 05:35:12 CDT 2015
   Finished at Mon Aug 10 05:44:39 CDT 2015 : test passed

Starting a JtR Sparc build/test at Tue Aug 11 05:35:09 CDT 2015
   Finished at Tue Aug 11 05:44:40 CDT 2015 : test passed

The first failure, was done on purpose. I changed a self test hash to fail. Other than that, once I put it into crontab to run at 5:30, things have been running like clockwork.

Now we just have to wait for the first new format from @kholia that is more complex than simple oSSL hashes chained together, (lol, jk).

Note, I still have a couple of disabled formats in my john-local.conf file, which I still need to get to, but this 'CI' will find any new failures, and when I get those fixed, I will remove them from being disabled.

<!-- gh-comment-id:130057451 --> @jfoug commented on GitHub (Aug 11, 2015): It is so nice to see this on my sparc box: ``` $cat ~/john/autobld/testing.log Starting a JtR Sparc build/test at Wed Aug 5 15:21:09 CDT 2015 Finished at Wed Aug 5 15:30:55 CDT 2015 : TEST FAILED, emails sent! Starting a JtR Sparc build/test at Thu Aug 6 05:35:07 CDT 2015 Finished at Thu Aug 6 05:45:12 CDT 2015 : test passed Starting a JtR Sparc build/test at Fri Aug 7 05:35:10 CDT 2015 Finished at Fri Aug 7 05:44:49 CDT 2015 : test passed Starting a JtR Sparc build/test at Sat Aug 8 05:35:07 CDT 2015 Finished at Sat Aug 8 05:44:35 CDT 2015 : test passed Starting a JtR Sparc build/test at Sun Aug 9 05:35:04 CDT 2015 Finished at Sun Aug 9 05:44:23 CDT 2015 : test passed Starting a JtR Sparc build/test at Mon Aug 10 05:35:12 CDT 2015 Finished at Mon Aug 10 05:44:39 CDT 2015 : test passed Starting a JtR Sparc build/test at Tue Aug 11 05:35:09 CDT 2015 Finished at Tue Aug 11 05:44:40 CDT 2015 : test passed ``` The first failure, was done on purpose. I changed a self test hash to fail. Other than that, once I put it into crontab to run at 5:30, things have been running like clockwork. Now we just have to wait for the first new format from @kholia that is more complex than simple oSSL hashes chained together, (lol, jk). Note, I still have a couple of disabled formats in my john-local.conf file, which I still need to get to, but this 'CI' will find any new failures, and when I get those fixed, I will remove them from being disabled.
Author
Owner

@ghost commented on GitHub (Dec 15, 2018):

I skipped issues like this. But, it is clear that:

  • Low Priority - It have a tendency to become high priority if enough of the users complain.

  • Business Priority - Obsolete hardware and software. Hardware nobody owns, etc.

  • WontFix - Covers all the reasons we chose to close the bug without taking action.

    • Nobody cares.
<!-- gh-comment-id:447589164 --> @ghost commented on GitHub (Dec 15, 2018): I skipped issues like this. But, it is clear that: * **Low Priority** - It have a tendency to become high priority if enough of the users complain. * **Business Priority** - Obsolete hardware and software. Hardware nobody owns, etc. * **WontFix** - Covers all the reasons we chose to close the bug without taking action. * Nobody cares.
Author
Owner

@magnumripper commented on GitHub (Dec 15, 2018):

This is obsolete. If anything we should get aways from all SSL libs and just implement the few cryptos and hashes we don't already have (that's not a lot).

<!-- gh-comment-id:447595711 --> @magnumripper commented on GitHub (Dec 15, 2018): This is obsolete. If anything we should get aways from all SSL libs and just implement the few cryptos and hashes we don't already have (that's not a lot).
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#1049
No description provided.