Bug 214459 - security/john use of undeclared identifier 'C_Block'
Summary: security/john use of undeclared identifier 'C_Block'
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Alexey Dokuchaev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-13 00:18 UTC by Walter Schwarzenfeld
Modified: 2016-11-22 08:03 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (danfe)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Walter Schwarzenfeld freebsd_triage 2016-11-13 00:18:13 UTC
Fails on 10.3-amd64 with
efs_fmt_plug.c:239:15: error: use of undeclared identifier 'C_Block'
        DES_set_key((C_Block *) key1, &ks1);
                     ^
efs_fmt_plug.c:239:24: error: expected expression
        DES_set_key((C_Block *) key1, &ks1);
                              ^
efs_fmt_plug.c:240:15: error: use of undeclared identifier 'C_Block'
        DES_set_key((C_Block *) key2, &ks2);
                     ^
efs_fmt_plug.c:240:24: error: expected expression
        DES_set_key((C_Block *) key2, &ks2);
                              ^
efs_fmt_plug.c:241:15: error: use of undeclared identifier 'C_Block'
        DES_set_key((C_Block *) key3, &ks3);
                     ^
efs_fmt_plug.c:241:24: error: expected expression
        DES_set_key((C_Block *) key3, &ks3);
Comment 1 Walter Schwarzenfeld freebsd_triage 2016-11-13 01:09:40 UTC
Found this
https://wiki.freebsd.org/LibreSSL/PatchingPorts
=>
"Guard" the code calling RAND_egd

#ifndef OPENSSL_NO_EGD
   RAND_egd("/some/file");
#endif

but which file instead of "/some/file" ??
Comment 2 Walter Schwarzenfeld freebsd_triage 2016-11-13 01:23:09 UTC
Was a misunderstood
the solution should be
# define OPENSSL_NO_EGD

but this works with the file src/gpg_fmt_plug.c but not with the file src/efs_fmt_plug.c.
Comment 3 Walter Schwarzenfeld freebsd_triage 2016-11-13 09:09:56 UTC
I looked in the old version, and only for  testing I added to the Makefile

post-patch:
        ${REINPLACE_CMD} -e 's|C_Block|DES_cblock|' \
                ${WRKSRC}/keychain_fmt_plug.c
        ${REINPLACE_CMD} -e 's|C_Block|DES_cblock|' \
                ${WRKSRC}/efs_fmt_plug.c
        ${REINPLACE_CMD} -e 's|C_Block|DES_cblock|' \
                ${WRKSRC}/gpg_fmt_plug.c
        ${REINPLACE_CMD} -e 's|C_Block|DES_cblock|' \
                ${WRKSRC}/mozilla_ng_fmt_plug.c
        ${REINPLACE_CMD} -e 's|C_Block|DES_cblock|' \
                ${WRKSRC}/opencl_gpg_fmt_plug.c
        ${REINPLACE_CMD} -e 's|C_Block|DES_cblock|' \
                ${WRKSRC}/opencl_keychain_fmt_plug.c
        ${REINPLACE_CMD} -e 's|C_Block|DES_cblock|' \
                ${WRKSRC}/ssh_ng_fmt_plug.c
        ${REINPLACE_CMD} -e 's|des_set_odd_parity|DES_set_odd_parity|' \
                ${WRKSRC}/KRB4_std_plug.c
        ${REINPLACE_CMD} -e 's|des_string_to_key|DES_string_to_key|' \
                ${WRKSRC}/KRB4_fmt_plug.c

it compiles nearly to the end, and failed then with  a linker error:

/usr/local/libexec/ccache/world/cc -g  -Wl,-rpath,/usr/local/lib -fstack-protector -L/usr/local/lib   -D_THREAD_SAFE -pthread  uaf2john.o uaf_encode_plug.o memdbg.o  -o ../run/uaf2john
/usr/local/libexec/ccache/world/cc -g  -Wl,-rpath,/usr/local/lib -fstack-protector -L/usr/local/lib   wpapcap2john.o memdbg.o  -o ../run/wpapcap2john
/usr/local/libexec/ccache/world/cc -g  -Wl,-rpath,/usr/local/lib -fstack-protector -L/usr/local/lib   luks2john.o -L/usr/local/lib -lcrypto -lssl memdbg.o jumbo.o  -o ../run/luks2john
john.o: In function `john_register_all':
john.c:(.text+0x1eff): undefined reference to `fmt_rawSHA_0'
cc: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[3]: *** [Makefile:294: ../run/john] Error 1
gmake[3]: *** Waiting for unfinished jobs....


If I am right, it seems the maintainer removed to much of the old patches with the update.
Comment 4 Walter Schwarzenfeld freebsd_triage 2016-11-13 09:15:18 UTC
In  the old version, there were also a patch for  the file john.c. But this does not apply. And I
find not the way to work it  out.
Comment 5 Alexey Dokuchaev freebsd_committer freebsd_triage 2016-11-13 09:45:25 UTC
First of all, what's your FreeBSD version and platform (CPU)?  Are you using any custom settings or software (non-standard compiler, CFLAGS, LibreSSL, anything else)?
Comment 6 Walter Schwarzenfeld freebsd_triage 2016-11-13 16:36:41 UTC
10.3-amd64. using Libressl.
Comment 7 Alexey Dokuchaev freebsd_committer freebsd_triage 2016-11-14 04:46:23 UTC
Yeah you're right, I've trimmed a bit too much from the Makefile in ports r425958; standby for the fix...
Comment 8 commit-hook freebsd_committer freebsd_triage 2016-11-14 06:42:13 UTC
A commit references this bug:

Author: danfe
Date: Mon Nov 14 06:41:47 UTC 2016
New revision: 426086
URL: https://svnweb.freebsd.org/changeset/ports/426086

Log:
  - Fix the build against LibreSSL: put back safety belts added in r382632,
    expanding them to cover newly added files, and augment OPENSSL_NO_SHA0
    patch to avoid linking error
  - Restore `-flax-vector-conversions' option required on pre-Clang systems
    that was erroneously removed in r425958

  PR:	214459

Changes:
  head/security/john/Makefile
  head/security/john/files/patch-rawSHA0__fmt__plug.c
Comment 9 Alexey Dokuchaev freebsd_committer freebsd_triage 2016-11-22 08:03:58 UTC
Close due to lack of feedback; assume fixed per ports r426086.