From: Wouter Wijngaards Date: Wed, 16 May 2012 07:43:08 +0000 (+0000) Subject: handle compile without ecdsa. X-Git-Tag: release-1.6.13~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9060f17fa952620b71179f8fbe32aaab7897dacf;p=thirdparty%2Fldns.git handle compile without ecdsa. --- diff --git a/host2str.c b/host2str.c index eff1216a..c185e0f0 100644 --- a/host2str.c +++ b/host2str.c @@ -1938,12 +1938,13 @@ ldns_key2buffer_str(ldns_buffer *output, const ldns_key *k) NULL #endif ); - -#endif +#else + goto error; +#endif /* GOST */ break; -#ifdef USE_ECDSA case LDNS_SIGN_ECDSAP256SHA256: case LDNS_SIGN_ECDSAP384SHA384: +#ifdef USE_ECDSA ldns_buffer_printf(output, "Private-key-format: v1.2\n"); ldns_buffer_printf(output, "Algorithm: %d (", ldns_key_algorithm(k)); status=ldns_algorithm2buffer_str(output, (ldns_algorithm)ldns_key_algorithm(k)); @@ -1968,8 +1969,10 @@ ldns_key2buffer_str(ldns_buffer *output, const ldns_key *k) EC_KEY_free(ec); } #endif /* splint */ +#else + goto error; +#endif /* ECDSA */ break; -#endif case LDNS_SIGN_HMACMD5: /* there's not much of a format defined for TSIG */ /* It's just a binary blob, Same for all algorithms */ diff --git a/keys.c b/keys.c index 00ab1402..54f26681 100644 --- a/keys.c +++ b/keys.c @@ -913,11 +913,14 @@ ldns_key_new_frm_algorithm(ldns_signing_algorithm alg, uint16_t size) return NULL; } #endif /* splint */ +#else + ldns_key_free(k); + return NULL; #endif /* HAVE_SSL and USE_GOST */ break; -#ifdef USE_ECDSA case LDNS_SIGN_ECDSAP256SHA256: case LDNS_SIGN_ECDSAP384SHA384: +#ifdef USE_ECDSA if(alg == LDNS_SIGN_ECDSAP256SHA256) ec = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); else if(alg == LDNS_SIGN_ECDSAP384SHA384) @@ -944,8 +947,11 @@ ldns_key_new_frm_algorithm(ldns_signing_algorithm alg, uint16_t size) return NULL; } #endif /* splint */ +#else + ldns_key_free(k); + return NULL; +#endif /* ECDSA */ break; -#endif } ldns_key_set_algorithm(k, alg); return k; @@ -1473,11 +1479,14 @@ ldns_key2rr(const ldns_key *k) } #endif /* splint */ internal_data = 1; +#else + ldns_rr_free(pubkey); + return NULL; #endif /* HAVE_SSL and USE_GOST */ break; -#ifdef USE_ECDSA case LDNS_SIGN_ECDSAP256SHA256: case LDNS_SIGN_ECDSAP384SHA384: +#ifdef USE_ECDSA ldns_rr_push_rdf(pubkey, ldns_native2rdf_int8( LDNS_RDF_TYPE_ALG, ldns_key_algorithm(k))); bin = NULL; @@ -1504,8 +1513,11 @@ ldns_key2rr(const ldns_key *k) * to the pkey */ EC_KEY_free(ec); internal_data = 1; +#else + ldns_rr_free(pubkey); + return NULL; +#endif /* ECDSA */ break; -#endif case LDNS_SIGN_HMACMD5: case LDNS_SIGN_HMACSHA1: case LDNS_SIGN_HMACSHA256: