Bug 835

Summary: macro USE_DSA should be added for `_verify_nettle_dsa` in validator/val_secalgo.c
Product: unbound Reporter: 0xbbc <0xbbc>
Component: serverAssignee: unbound team <unbound-team>
Status: RESOLVED FIXED    
Severity: trivial CC: 0xbbc, cathya, wouter
Priority: P5    
Version: 1.5.9   
Hardware: All   
OS: All   

Description 0xbbc 2016-09-20 14:17:43 CEST
When '--disable-dsa' is supplied to configure, _verify_nettle_dsa still builds, causing errors below: 


./libtool --tag=CC --mode=compile gcc -I.  -I/usr/local/include/nettle -I/usr/local/include -I/usr/local/include -g -O2 -flto -D_THREAD_SAFE  -pthread -o val_secalgo.lo -c validator/val_secalgo.c
libtool: compile:  gcc -I. -I/usr/local/include/nettle -I/usr/local/include -I/usr/local/include -g -O2 -flto -D_THREAD_SAFE -pthread -c validator/val_secalgo.c  -fno-common -DPIC -o .libs/val_secalgo.o
validator/val_secalgo.c:1378:24: error: variable has incomplete type
      'struct dsa_public_key'
        struct dsa_public_key pubkey;
                              ^
validator/val_secalgo.c:1378:9: note: forward declaration of
      'struct dsa_public_key'
        struct dsa_public_key pubkey;
               ^
validator/val_secalgo.c:1434:2: warning: implicit declaration of function
      'nettle_dsa_public_key_init' is invalid in C99
      [-Wimplicit-function-declaration]
        nettle_dsa_public_key_init(&pubkey);
        ^
validator/val_secalgo.c:1447:9: warning: implicit declaration of function
      'dsa_sha1_verify_digest' is invalid in C99
      [-Wimplicit-function-declaration]
        res &= dsa_sha1_verify_digest(&pubkey, digest, &signature);
               ^
validator/val_secalgo.c:1451:2: warning: implicit declaration of function
      'nettle_dsa_public_key_clear' is invalid in C99
      [-Wimplicit-function-declaration]
        nettle_dsa_public_key_clear(&pubkey);
        ^
3 warnings and 1 error generated.
make: *** [val_secalgo.lo] Error 1



P.S
I'm not sure this is the right way to figure it out, but after my adding this macro for `_verify_nettle_dsa`, it compiles.
Comment 1 Wouter Wijngaards 2016-09-20 14:22:30 CEST
Hi,

Thank you for the report, yes that fixes the problem.  Applied the fix.

Best regards, Wouter