Bug 250578 - security/rhash fails to build without MD4 option in security/openssl port
Summary: security/rhash fails to build without MD4 option in security/openssl port
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Alexey Dokuchaev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-24 13:25 UTC by Alexander Ushakov
Modified: 2020-11-11 03:26 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Ushakov 2020-10-24 13:25:23 UTC
security/rhash failed to build if I has unchecked option MD4 (marked as unsafe) in security/openssl:

make[3]: stopped in /usr/ports/security/rhash/work/RHash-1.3.9/librhash
--- librhash/librhash.so.0 ---
plug_openssl.c:92:1: error: expected expression
WRAP_FINAL(MD4)
^
plug_openssl.c:86:26: note: expanded from macro 'WRAP_FINAL'
#define WRAP_FINAL(name) WRAP_FINAL2(name, name##_CTX)
                         ^
plug_openssl.c:89:38: note: expanded from macro 'WRAP_FINAL2'
                CALL_FINAL(name, result, (CTX_TYPE*)ctx); \
                                                   ^
plug_openssl.c:92:1: error: use of undeclared identifier 'MD4_CTX'
plug_openssl.c:86:44: note: expanded from macro 'WRAP_FINAL'
#define WRAP_FINAL(name) WRAP_FINAL2(name, name##_CTX)
                                           ^
<scratch space>:43:1: note: expanded from here
MD4_CTX
^
plug_openssl.c:92:1: warning: unused parameter 'ctx' [-Wunused-parameter]
plug_openssl.c:86:26: note: expanded from macro 'WRAP_FINAL'
#define WRAP_FINAL(name) WRAP_FINAL2(name, name##_CTX)
                         ^
plug_openssl.c:88:39: note: expanded from macro 'WRAP_FINAL2'
        static void wrap##name##_Final(void* ctx, unsigned char* result) { \
                                             ^
plug_openssl.c:117:22: error: use of undeclared identifier 'MD4_CTX'
        { &info_md4, sizeof(MD4_CTX), offsetof(MD4_CTX, A), HASH_INFO_METHODS(MD4) }, /* 128 bit */
                            ^
plug_openssl.c:117:41: error: unknown type name 'MD4_CTX'; did you mean 'MD5_CTX'?
        { &info_md4, sizeof(MD4_CTX), offsetof(MD4_CTX, A), HASH_INFO_METHODS(MD4) }, /* 128 bit */
                                               ^~~~~~~
                                               MD5_CTX
/usr/include/stddef.h:75:42: note: expanded from macro 'offsetof'
#define offsetof(type, field)   __offsetof(type, field)
                                           ^
/usr/include/sys/cdefs.h:476:53: note: expanded from macro '__offsetof'
#define __offsetof(type, field)  __builtin_offsetof(type, field)
                                                    ^
/usr/local/include/openssl/md5.h:38:3: note: 'MD5_CTX' declared here
} MD5_CTX;
  ^
plug_openssl.c:231:30: error: invalid application of 'sizeof' to an incomplete type 'rhash_hash_info []'
        for (i = 0; i < (int)(sizeof(rhash_openssl_methods) / sizeof(rhash_hash_info)); i++)
                                    ^~~~~~~~~~~~~~~~~~~~~~~
1 warning and 5 errors generated.
--- librhash/librhash.a ---
1 error

May be security/rhash port needs some dependency check for MD4 OpenSSL option?
Comment 1 Li-Wen Hsu freebsd_committer 2020-10-24 17:22:19 UTC
Over to maintainer
Comment 2 Bernard Spil freebsd_committer 2020-10-25 18:19:32 UTC
Upstream issue

> https://github.com/rhash/RHash/blob/master/librhash/plug_openssl.c

You can see that RIPEMD is optional, but MD4 is not. Needs to be fixed.
Comment 3 commit-hook freebsd_committer 2020-11-11 03:13:43 UTC
A commit references this bug:

Author: danfe
Date: Wed Nov 11 03:13:37 UTC 2020
New revision: 554868
URL: https://svnweb.freebsd.org/changeset/ports/554868

Log:
  Unbreak the build against OpenSSL without MD4 support.

  PR:	250578

Changes:
  head/security/rhash/files/patch-librhash_plug__openssl.c
Comment 4 Alexey Dokuchaev freebsd_committer 2020-11-11 03:26:34 UTC
(In reply to Bernard Spil from comment #2)
> You can see that RIPEMD is optional, but MD4 is not. Needs to be fixed.
I've submitted the patch upstream as https://sourceforge.net/p/rhash/patches/7/ (meanwhile, committed as ports r554868).