removed old patches that got merged into upstream

This commit is contained in:
Paul Wouters 2008-11-07 23:54:34 +00:00
parent 5b10b26476
commit 95b001154a
3 changed files with 0 additions and 197 deletions

View File

@ -1,73 +0,0 @@
diff -ruN ldns-1.2.0.orig/examples/ldns-key2ds.c ldns-1.2.0/examples/ldns-key2ds.c
--- ldns-1.2.0.orig/examples/ldns-key2ds.c 2007-08-08 17:46:18.000000000 -0400
+++ ldns-1.2.0/examples/ldns-key2ds.c 2007-08-08 17:46:36.000000000 -0400
@@ -15,13 +15,14 @@
void
usage(FILE *fp, char *prog) {
- fprintf(fp, "%s [-1|-2] keyfile\n", prog);
+ fprintf(fp, "%s [-n] [-1|-2] keyfile\n", prog);
fprintf(fp, " Generate a DS RR from the key\n");
fprintf(fp, " The following file will be created: ");
fprintf(fp, "K<name>+<alg>+<id>.ds\n");
fprintf(fp, " The base name (K<name>+<alg>+<id> will be printed to stdout\n");
fprintf(fp, "Options:\n");
- fprintf(fp, " -1 (default): use SHA1 for the DS hash\n");
+ fprintf(fp, " -n: do not write to file but to stdout\n");
+ fprintf(fp, " -1: (default): use SHA1 for the DS hash\n");
fprintf(fp, " -2: use SHA256 for the DS hash\n");
}
@@ -36,7 +37,8 @@
ldns_signing_algorithm alg;
ldns_hash h;
char *program = argv[0];
-
+ int nofile=0;
+
alg = 0;
h = LDNS_SHA1;
@@ -50,7 +52,10 @@
fprintf(stderr, "Error: Crypto library does not support SHA256 digests!");
#endif
h = LDNS_SHA256;
- }
+ }
+ if (strcmp(argv[0], "-n") == 0) {
+ nofile=1;
+ }
argv++, argc--;
}
@@ -89,18 +94,21 @@
dsname = LDNS_XMALLOC(char, strlen(owner) + 16);
snprintf(dsname, strlen(owner) + 15, "K%s+%03u+%05u.ds", owner, alg, (unsigned int) ldns_calc_keytag(k));
- dsfp = fopen(dsname, "w");
- if (!dsfp) {
- fprintf(stderr, "Unable to open %s: %s\n", dsname, strerror(errno));
- exit(EXIT_FAILURE);
- } else {
- ldns_rr_print(dsfp, ds);
- fclose(dsfp);
+ if (nofile)
+ ldns_rr_print(stdout,ds);
+ else {
+ dsfp = fopen(dsname, "w");
+ if (!dsfp) {
+ fprintf(stderr, "Unable to open %s: %s\n", dsname, strerror(errno));
+ exit(EXIT_FAILURE);
+ } else {
+ ldns_rr_print(dsfp, ds);
+ fclose(dsfp);
+ fprintf(stdout, "K%s+%03u+%05u\n", owner, alg, (unsigned int) ldns_calc_keytag(k));
+ }
}
ldns_rr_free(ds);
- fprintf(stdout, "K%s+%03u+%05u\n", owner, alg, (unsigned int) ldns_calc_keytag(k));
-
ldns_rr_free(k);
free(owner);
LDNS_FREE(dsname);

View File

@ -1,68 +0,0 @@
Index: dnssec.c
===================================================================
--- dnssec.c (revision 2398)
+++ dnssec.c (revision 2400)
@@ -718,8 +718,15 @@
}
break;
case LDNS_SHA256:
- ldns_rr_free(ds);
- return NULL; /* not implemented */
+ #ifdef SHA256_DIGEST_LENGTH
+ digest = LDNS_XMALLOC(uint8_t, SHA256_DIGEST_LENGTH);
+ if (!digest) {
+ ldns_rr_free(ds);
+ return NULL;
+ }
+ #else
+ return NULL;
+ #endif
break;
}
@@ -771,6 +778,14 @@
break;
case LDNS_SHA256:
+#ifdef SHA256_DIGEST_LENGTH
+ (void) SHA256((unsigned char *) ldns_buffer_begin(data_buf),
+ ldns_buffer_position(data_buf),
+ (unsigned char*) digest);
+ tmp = ldns_rdf_new_frm_data(LDNS_RDF_TYPE_HEX, SHA256_DIGEST_LENGTH,
+ digest);
+ ldns_rr_push_rdf(ds, tmp);
+#endif
break;
}
Index: examples/ldns-key2ds.c
===================================================================
--- examples/ldns-key2ds.c (revision 2398)
+++ examples/ldns-key2ds.c (revision 2400)
@@ -9,6 +9,7 @@
#include "config.h"
#include <ldns/ldns.h>
+#include <openssl/ssl.h>
#include <errno.h>
@@ -45,6 +46,9 @@
h = LDNS_SHA1;
}
if (strcmp(argv[0], "-2") == 0) {
+ #ifndef SHA256_DIGEST_LENGTH
+ fprintf(stderr, "Error: Crypto library does not support SHA256 digests!");
+ #endif
h = LDNS_SHA256;
}
argv++, argc--;
@@ -73,7 +77,7 @@
owner = ldns_rdf2str(ldns_rr_owner(k));
alg = ldns_rdf2native_int8(ldns_rr_dnskey_algorithm(k));
- ds = ldns_key_rr2ds(k, LDNS_SHA1);
+ ds = ldns_key_rr2ds(k, h);
if (!ds) {
fprintf(stderr, "Conversion to a DS RR failed\n");
ldns_rr_free(k);

View File

@ -1,56 +0,0 @@
Index: zone.c
===================================================================
--- zone.c (revision 2480)
+++ zone.c (revision 2482)
@@ -181,7 +181,8 @@
/* also set the prev */
my_prev = ldns_rdf_clone(origin);
} else {
- my_origin = ldns_dname_new_frm_str(".");
+ my_origin = NULL;
+ /*my_origin = ldns_dname_new_frm_str(".");*/
my_prev = NULL;
}
@@ -198,6 +199,10 @@
}
soa_seen = true;
ldns_zone_set_soa(newzone, rr);
+ /* set origin to soa if not specified */
+ if (!my_origin) {
+ my_origin = ldns_rdf_clone(ldns_rr_owner(rr));
+ }
continue;
}
Index: rr.c
===================================================================
--- rr.c (revision 2480)
+++ rr.c (revision 2482)
@@ -417,11 +417,22 @@
ldns_rr_descriptor_field_type(desc, r_cnt),
rd);
- /* check if the origin should be concatenated */
- if (rd_strlen > 1 && !ldns_dname_str_absolute(rd) && origin) {
+ /* check if the origin should be used or concatenated */
+ if (rd_strlen == 1 && ldns_rdf_data(r)[1] == '@') {
+ ldns_rdf_deep_free(r);
+ if (origin) {
+ r = ldns_rdf_clone(origin);
+ } else {
+ /* if this is the SOA, use its own owner name */
+ if (rr_type == LDNS_RR_TYPE_SOA) {
+ r = ldns_rdf_clone(ldns_rr_owner(new));
+ } else {
+ r = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_DNAME, ".");
+ }
+ }
+ } else if (rd_strlen > 1 && !ldns_dname_str_absolute(rd) && origin) {
if (!ldns_dname_cat(r, origin)) {
- /* don't change this (yet MIEK */
- /* return LDNS_STATUS_SYNTAX_ERR; */
+ return LDNS_STATUS_ERR;
}
}
break;