]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
handle compile without ecdsa.
authorWouter Wijngaards <wouter@NLnetLabs.nl>
Wed, 16 May 2012 07:43:08 +0000 (07:43 +0000)
committerWouter Wijngaards <wouter@NLnetLabs.nl>
Wed, 16 May 2012 07:43:08 +0000 (07:43 +0000)
host2str.c
keys.c

index eff1216a966234036e18a5506192344aabdcc335..c185e0f04db0bffb7efd1da5dd65d82cabf0c4cf 100644 (file)
@@ -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 00ab1402d39e52730b14a04da965d715b7d811cf..54f26681494f142bec5a54d4eb0c503805f5eea6 100644 (file)
--- 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: