]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
ldns/host2str.c: fix build error with SSL disabled
authorOleksandr Natalenko <oleksandr@natalenko.name>
Sun, 18 Mar 2018 09:38:09 +0000 (10:38 +0100)
committerWillem Toorop <willem@nlnetlabs.nl>
Mon, 19 Mar 2018 14:25:40 +0000 (14:25 +0000)
If --without-ssl option is given, the following error applies:

===
./host2str.c:2017:74: error: unknown type name 'BIGNUM'
ldns_print_bignum_b64_line(ldns_buffer* output, const char* label, const BIGNUM* num)
                                                                         ^
./host2str.c:2025:11: warning: implicit declaration of function 'BN_bn2bin' is invalid in C99 [-Wimplicit-function-declaration]
                int i = BN_bn2bin(num, bignumbuf);
===

With that, ldns_print_bignum_b64_line() should be wrapped into HAVE_SSL ifdef.

Signed-off-by: Oleksandr Natalenko <oleksandr@natalenko.name>
host2str.c

index 73adb39a971fccf6e5852917ab8007587c295c9e..f459c476aca7d9d0ed29431ac1e0bc0ef782662a 100644 (file)
@@ -2012,6 +2012,7 @@ ldns_ed448_key2buffer_str(ldns_buffer *output, EVP_PKEY *p)
 }
 #endif
 
+#if defined(HAVE_SSL)
 /** print one b64 encoded bignum to a line in the keybuffer */
 static int
 ldns_print_bignum_b64_line(ldns_buffer* output, const char* label, const BIGNUM* num)
@@ -2041,6 +2042,7 @@ ldns_print_bignum_b64_line(ldns_buffer* output, const char* label, const BIGNUM*
        LDNS_FREE(bignumbuf);
        return 1;
 }
+#endif
 
 ldns_status
 ldns_key2buffer_str(ldns_buffer *output, const ldns_key *k)