varnish / libvmod-digest

Digest and HMAC vmod
Other
50 stars 27 forks source link

Compile issue on RHEL7 #20

Closed jensskott closed 5 years ago

jensskott commented 8 years ago

varnishd -V varnishd (varnish-4.0.2 revision bfe7cd1) Copyright (c) 2006 Verdens Gang AS Copyright (c) 2006-2014 Varnish Software AS

make[2]: Entering directory `/root/libvmod-digest-libvmod-digest-1.0.1/src'
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I..  -I/usr/share/varnish/include -I/usr/include/varnish -Wall -Wextra   -g -O2 -MT vmod_digest.lo -MD -MP -MF .deps/vmod_digest.Tpo -c -o vmod_digest.lo vmod_digest.c
libtool: compile:  gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I/usr/share/varnish/include -I/usr/include/varnish -Wall -Wextra -g -O2 -MT vmod_digest.lo -MD -MP -MF .deps/vmod_digest.Tpo -c vmod_digest.c  -fPIC -DPIC -o .libs/vmod_digest.o
vmod_digest.c:95:24: error: expected ‘)’ before ‘struct’
 init_function(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
                        ^
vmod_digest.c:286:28: error: expected ‘)’ before ‘hashid’
 vmod_hmac_generic(VRT_CTX, hashid hash, const char *key, const char *msg)
                            ^
vmod_digest.c:333:30: error: expected ‘)’ before ‘enum’
 vmod_base64_generic(VRT_CTX, enum alphabets a, const char *msg, int is_hex)
                              ^
vmod_digest.c:356:37: error: expected ‘)’ before ‘enum’
 vmod_base64_decode_generic(VRT_CTX, enum alphabets a, const char *msg)
                                     ^
vmod_digest.c:379:28: error: expected ‘)’ before ‘hashid’
 vmod_hash_generic(VRT_CTX, hashid hash, const char *msg)
                            ^
vmod_digest.c:403:29: error: expected ‘)’ before ‘const’
 vmod_hash_ ## low (VRT_CTX, const char *msg) \
                             ^
vmod_digest.c:410:1: note: in expansion of macro ‘VMOD_HASH_FOO’
 VMOD_HASH_FOO(sha1,SHA1)
 ^
vmod_digest.c:403:29: error: expected ‘)’ before ‘const’
 vmod_hash_ ## low (VRT_CTX, const char *msg) \
                             ^
vmod_digest.c:411:1: note: in expansion of macro ‘VMOD_HASH_FOO’
 VMOD_HASH_FOO(sha224,SHA224)
 ^
vmod_digest.c:403:29: error: expected ‘)’ before ‘const’
 vmod_hash_ ## low (VRT_CTX, const char *msg) \
                             ^
vmod_digest.c:412:1: note: in expansion of macro ‘VMOD_HASH_FOO’
 VMOD_HASH_FOO(sha256,SHA256)
 ^
vmod_digest.c:403:29: error: expected ‘)’ before ‘const’
 vmod_hash_ ## low (VRT_CTX, const char *msg) \
                             ^
vmod_digest.c:413:1: note: in expansion of macro ‘VMOD_HASH_FOO’
 VMOD_HASH_FOO(sha384,SHA384)
 ^
vmod_digest.c:403:29: error: expected ‘)’ before ‘const’
 vmod_hash_ ## low (VRT_CTX, const char *msg) \
                             ^
vmod_digest.c:414:1: note: in expansion of macro ‘VMOD_HASH_FOO’
 VMOD_HASH_FOO(sha512,SHA512)
 ^
vmod_digest.c:403:29: error: expected ‘)’ before ‘const’
 vmod_hash_ ## low (VRT_CTX, const char *msg) \
                             ^
vmod_digest.c:415:1: note: in expansion of macro ‘VMOD_HASH_FOO’
 VMOD_HASH_FOO(gost,GOST)
 ^
vmod_digest.c:403:29: error: expected ‘)’ before ‘const’
 vmod_hash_ ## low (VRT_CTX, const char *msg) \
                             ^
vmod_digest.c:416:1: note: in expansion of macro ‘VMOD_HASH_FOO’
 VMOD_HASH_FOO(md2,MD2)
 ^
vmod_digest.c:403:29: error: expected ‘)’ before ‘const’
 vmod_hash_ ## low (VRT_CTX, const char *msg) \
                             ^
vmod_digest.c:417:1: note: in expansion of macro ‘VMOD_HASH_FOO’
 VMOD_HASH_FOO(md4,MD4)
 ^
vmod_digest.c:403:29: error: expected ‘)’ before ‘const’
 vmod_hash_ ## low (VRT_CTX, const char *msg) \
                             ^
vmod_digest.c:418:1: note: in expansion of macro ‘VMOD_HASH_FOO’
 VMOD_HASH_FOO(md5,MD5)
 ^
vmod_digest.c:403:29: error: expected ‘)’ before ‘const’
 vmod_hash_ ## low (VRT_CTX, const char *msg) \
                             ^
vmod_digest.c:419:1: note: in expansion of macro ‘VMOD_HASH_FOO’
 VMOD_HASH_FOO(crc32,CRC32)
 ^
vmod_digest.c:403:29: error: expected ‘)’ before ‘const’
 vmod_hash_ ## low (VRT_CTX, const char *msg) \
                             ^
vmod_digest.c:420:1: note: in expansion of macro ‘VMOD_HASH_FOO’
 VMOD_HASH_FOO(crc32b,CRC32B)
 ^
vmod_digest.c:403:29: error: expected ‘)’ before ‘const’
 vmod_hash_ ## low (VRT_CTX, const char *msg) \
                             ^
vmod_digest.c:421:1: note: in expansion of macro ‘VMOD_HASH_FOO’
 VMOD_HASH_FOO(adler32,ADLER32)
 ^
vmod_digest.c:403:29: error: expected ‘)’ before ‘const’
 vmod_hash_ ## low (VRT_CTX, const char *msg) \
                             ^
vmod_digest.c:422:1: note: in expansion of macro ‘VMOD_HASH_FOO’
 VMOD_HASH_FOO(haval128,HAVAL128)
 ^
vmod_digest.c:403:29: error: expected ‘)’ before ‘const’
 vmod_hash_ ## low (VRT_CTX, const char *msg) \
                             ^
vmod_digest.c:423:1: note: in expansion of macro ‘VMOD_HASH_FOO’
 VMOD_HASH_FOO(haval160,HAVAL160)
 ^
vmod_digest.c:403:29: error: expected ‘)’ before ‘const’
 vmod_hash_ ## low (VRT_CTX, const char *msg) \
                             ^
vmod_digest.c:424:1: note: in expansion of macro ‘VMOD_HASH_FOO’
 VMOD_HASH_FOO(haval192,HAVAL192)
 ^
vmod_digest.c:403:29: error: expected ‘)’ before ‘const’
 vmod_hash_ ## low (VRT_CTX, const char *msg) \
                             ^
vmod_digest.c:425:1: note: in expansion of macro ‘VMOD_HASH_FOO’
 VMOD_HASH_FOO(haval224,HAVAL224)
 ^
vmod_digest.c:403:29: error: expected ‘)’ before ‘const’
 vmod_hash_ ## low (VRT_CTX, const char *msg) \
                             ^
vmod_digest.c:426:1: note: in expansion of macro ‘VMOD_HASH_FOO’
 VMOD_HASH_FOO(haval256,HAVAL256)
 ^
vmod_digest.c:403:29: error: expected ‘)’ before ‘const’
 vmod_hash_ ## low (VRT_CTX, const char *msg) \
                             ^
vmod_digest.c:427:1: note: in expansion of macro ‘VMOD_HASH_FOO’
 VMOD_HASH_FOO(ripemd128,RIPEMD128)
 ^
vmod_digest.c:403:29: error: expected ‘)’ before ‘const’
 vmod_hash_ ## low (VRT_CTX, const char *msg) \
                             ^
vmod_digest.c:428:1: note: in expansion of macro ‘VMOD_HASH_FOO’
 VMOD_HASH_FOO(ripemd160,RIPEMD160)
 ^
vmod_digest.c:403:29: error: expected ‘)’ before ‘const’
 vmod_hash_ ## low (VRT_CTX, const char *msg) \
                             ^
vmod_digest.c:429:1: note: in expansion of macro ‘VMOD_HASH_FOO’
 VMOD_HASH_FOO(ripemd256,RIPEMD256)
 ^
vmod_digest.c:403:29: error: expected ‘)’ before ‘const’
 vmod_hash_ ## low (VRT_CTX, const char *msg) \
                             ^
vmod_digest.c:430:1: note: in expansion of macro ‘VMOD_HASH_FOO’
 VMOD_HASH_FOO(ripemd320,RIPEMD320)
 ^
vmod_digest.c:403:29: error: expected ‘)’ before ‘const’
 vmod_hash_ ## low (VRT_CTX, const char *msg) \
                             ^
vmod_digest.c:431:1: note: in expansion of macro ‘VMOD_HASH_FOO’
 VMOD_HASH_FOO(tiger,TIGER)
 ^
vmod_digest.c:403:29: error: expected ‘)’ before ‘const’
 vmod_hash_ ## low (VRT_CTX, const char *msg) \
                             ^
vmod_digest.c:432:1: note: in expansion of macro ‘VMOD_HASH_FOO’
 VMOD_HASH_FOO(tiger128,TIGER128)
 ^
vmod_digest.c:403:29: error: expected ‘)’ before ‘const’
 vmod_hash_ ## low (VRT_CTX, const char *msg) \
                             ^
vmod_digest.c:433:1: note: in expansion of macro ‘VMOD_HASH_FOO’
 VMOD_HASH_FOO(tiger160,TIGER160)
 ^
vmod_digest.c:403:29: error: expected ‘)’ before ‘const’
 vmod_hash_ ## low (VRT_CTX, const char *msg) \
                             ^
vmod_digest.c:434:1: note: in expansion of macro ‘VMOD_HASH_FOO’
 VMOD_HASH_FOO(snefru128,SNEFRU128)
 ^
vmod_digest.c:403:29: error: expected ‘)’ before ‘const’
 vmod_hash_ ## low (VRT_CTX, const char *msg) \
                             ^
vmod_digest.c:435:1: note: in expansion of macro ‘VMOD_HASH_FOO’
 VMOD_HASH_FOO(snefru256,SNEFRU256)
 ^
vmod_digest.c:403:29: error: expected ‘)’ before ‘const’
 vmod_hash_ ## low (VRT_CTX, const char *msg) \
                             ^
vmod_digest.c:436:1: note: in expansion of macro ‘VMOD_HASH_FOO’
 VMOD_HASH_FOO(whirlpool,WHIRLPOOL)
 ^
vmod_digest.c:440:30: error: expected ‘)’ before ‘const’
 vmod_ ## codec_low (VRT_CTX, const char *msg) \
                              ^
vmod_digest.c:463:1: note: in expansion of macro ‘VMOD_ENCODE_FOO’
 VMOD_ENCODE_FOO(base64,BASE64)
 ^
vmod_digest.c:448:38: error: expected ‘)’ before ‘const’
 vmod_ ## codec_low ## _hex (VRT_CTX, const char *msg) \
                                      ^
vmod_digest.c:463:1: note: in expansion of macro ‘VMOD_ENCODE_FOO’
 VMOD_ENCODE_FOO(base64,BASE64)
 ^
vmod_digest.c:456:41: error: expected ‘)’ before ‘const’
 vmod_ ## codec_low ## _decode (VRT_CTX, const char *msg) \
                                         ^
vmod_digest.c:463:1: note: in expansion of macro ‘VMOD_ENCODE_FOO’
 VMOD_ENCODE_FOO(base64,BASE64)
 ^
vmod_digest.c:440:30: error: expected ‘)’ before ‘const’
 vmod_ ## codec_low (VRT_CTX, const char *msg) \
                              ^
vmod_digest.c:464:1: note: in expansion of macro ‘VMOD_ENCODE_FOO’
 VMOD_ENCODE_FOO(base64url,BASE64URL)
 ^
vmod_digest.c:448:38: error: expected ‘)’ before ‘const’
 vmod_ ## codec_low ## _hex (VRT_CTX, const char *msg) \
                                      ^
vmod_digest.c:464:1: note: in expansion of macro ‘VMOD_ENCODE_FOO’
 VMOD_ENCODE_FOO(base64url,BASE64URL)
 ^
vmod_digest.c:456:41: error: expected ‘)’ before ‘const’
 vmod_ ## codec_low ## _decode (VRT_CTX, const char *msg) \
                                         ^
vmod_digest.c:464:1: note: in expansion of macro ‘VMOD_ENCODE_FOO’
 VMOD_ENCODE_FOO(base64url,BASE64URL)
 ^
vmod_digest.c:440:30: error: expected ‘)’ before ‘const’
 vmod_ ## codec_low (VRT_CTX, const char *msg) \
                              ^
vmod_digest.c:465:1: note: in expansion of macro ‘VMOD_ENCODE_FOO’
 VMOD_ENCODE_FOO(base64url_nopad,BASE64URLNOPAD)
 ^
vmod_digest.c:448:38: error: expected ‘)’ before ‘const’
 vmod_ ## codec_low ## _hex (VRT_CTX, const char *msg) \
                                      ^
vmod_digest.c:465:1: note: in expansion of macro ‘VMOD_ENCODE_FOO’
 VMOD_ENCODE_FOO(base64url_nopad,BASE64URLNOPAD)
 ^
vmod_digest.c:456:41: error: expected ‘)’ before ‘const’
 vmod_ ## codec_low ## _decode (VRT_CTX, const char *msg) \
                                         ^
vmod_digest.c:465:1: note: in expansion of macro ‘VMOD_ENCODE_FOO’
 VMOD_ENCODE_FOO(base64url_nopad,BASE64URLNOPAD)
 ^
vmod_digest.c:474:29: error: expected ‘)’ before ‘const’
 vmod_hmac_ ## hash(VRT_CTX, const char *key, const char *msg) \
                             ^
vmod_digest.c:484:1: note: in expansion of macro ‘VMOD_HMAC_FOO’
 VMOD_HMAC_FOO(sha256,SHA256)
 ^
vmod_digest.c:474:29: error: expected ‘)’ before ‘const’
 vmod_hmac_ ## hash(VRT_CTX, const char *key, const char *msg) \
                             ^
vmod_digest.c:485:1: note: in expansion of macro ‘VMOD_HMAC_FOO’
 VMOD_HMAC_FOO(sha1,SHA1)
 ^
vmod_digest.c:474:29: error: expected ‘)’ before ‘const’
 vmod_hmac_ ## hash(VRT_CTX, const char *key, const char *msg) \
                             ^
vmod_digest.c:486:1: note: in expansion of macro ‘VMOD_HMAC_FOO’
 VMOD_HMAC_FOO(md5,MD5)
 ^
vmod_digest.c: In function ‘vmod_version’:
vmod_digest.c:490:1: warning: type of ‘VRT_CTX’ defaults to ‘int’ [enabled by default]
 vmod_version(VRT_CTX)
 ^
vmod_digest.c:490:1: error: argument ‘VRT_CTX’ doesn’t match prototype
In file included from vmod_digest.c:57:0:
vcc_if.h:55:12: error: prototype declaration
 VCL_STRING vmod_version(const struct vrt_ctx *);
            ^
vmod_digest.c:492:8: error: ‘ctx’ undeclared (first use in this function)
  (void)ctx;
        ^
vmod_digest.c:492:8: note: each undeclared identifier is reported only once for each function it appears in
vmod_digest.c:490:1: warning: unused parameter ‘VRT_CTX’ [-Wunused-parameter]
 vmod_version(VRT_CTX)
 ^
vmod_digest.c: At top level:
vmod_digest.c:75:3: warning: ‘alphabet’ defined but not used [-Wunused-variable]
 } alphabet[N_ALPHA];
   ^
vmod_digest.c:81:1: warning: ‘vmod_digest_alpha_init’ defined but not used [-Wunused-function]
 vmod_digest_alpha_init(struct e_alphabet *alpha)
 ^
vmod_digest.c:131:1: warning: ‘base64_decode’ defined but not used [-Wunused-function]
 base64_decode(struct e_alphabet *alpha, char *d, unsigned dlen, const char *s)
 ^
vmod_digest.c:205:1: warning: ‘base64_encode’ defined but not used [-Wunused-function]
 base64_encode(struct e_alphabet *alpha, const char *in,
 ^
make[2]: *** [vmod_digest.lo] Error 1
make[2]: Leaving directory `/root/libvmod-digest-libvmod-digest-1.0.1/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/libvmod-digest-libvmod-digest-1.0.1'
make: *** [all] Error 2
fgsch commented 8 years ago

I just committed a fix for master and will be included in the next release.

That said, fix aside, this tarball was created against master which is tracking Varnish 4.1 so there might be other issues.

For the time being you might want to try using the 4.0 branch instead.

jensskott commented 8 years ago

Patched branch 4.0 with this and it now works to build

fgsch commented 8 years ago

Thanks for the update.

I will update the code to deal with this. On 3 May 2016 1:08 p.m., "Jens Skott" notifications@github.com wrote:

Patched branch 4.0 with this and it now works to build

— You are receiving this because you modified the open/close state. Reply to this email directly or view it on GitHub https://github.com/varnish/libvmod-digest/issues/20#issuecomment-216508622

daghf commented 8 years ago

With fcbbf7e1911a4c9b12aa7bcbe40de9a1a987cb50 in place, this can be (re-)closed?

fgsch commented 8 years ago

We could change master to work with both 4.0.x and 4.1.2 or redirect people using 4.0.x to the 4.0 branch.

What do we want to do? If it's the latter we can close this, otherwise I can work on a fix.

lkarsten commented 8 years ago

@fgsch did you find any workable solution to support both 4.0 and 4.1 on the same vmod code base? ifdef-ing init_function() and passing the vcc file through the preprocessor? feels rather hackish.

fgsch commented 8 years ago

The approach I mentioned works, I have used it before. There is no need for preprocessor since vmodtool.py can understands both $Event and $init. You still need ifdef init_functions though. I will submit a PR for discussing it.

lkarsten commented 8 years ago

+1

dridi commented 5 years ago

EEOL