From: Miek Gieben Date: Tue, 1 Mar 2005 11:22:57 +0000 (+0000) Subject: removed printfs and other debugging stuff X-Git-Tag: release-0.50~336 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7455dce9eb0fdd9cc57c64ddc4dd609ef004c680;p=thirdparty%2Fldns.git removed printfs and other debugging stuff --- diff --git a/dnssec.c b/dnssec.c index dbd8a201..23076035 100644 --- a/dnssec.c +++ b/dnssec.c @@ -104,11 +104,7 @@ ldns_verify_rrsig(ldns_rr_list *rrset, ldns_rr *rrsig, ldns_rr_list *keys) sig_algo = ldns_rdf2native_int8(ldns_rr_rdf(rrsig, 1)); result = false; - printf("trying to verify I\n"); - /* create a buffer with b64 signature rdata */ - ldns_rdf_print(stdout, ldns_rr_rdf(rrsig, 8)); - printf("was sig data\n"); if (ldns_rdf2buffer_wire(rawsig_buf, ldns_rr_rdf(rrsig, 8)) != LDNS_STATUS_OK) { ldns_buffer_free(rawsig_buf); @@ -125,7 +121,6 @@ ldns_verify_rrsig(ldns_rr_list *rrset, ldns_rr *rrsig, ldns_rr_list *keys) ldns_rr_list_rr(rrset, i), orig_ttl); } - ldns_rr_list_print(stdout, rrset); /* sort the rrset in canonical order */ ldns_rr_list_sort(rrset); @@ -144,12 +139,8 @@ ldns_verify_rrsig(ldns_rr_list *rrset, ldns_rr *rrsig, ldns_rr_list *keys) return false; } - printf("trying to verify II\n"); - for(i = 0; i < ldns_rr_list_rr_count(keys); i++) { current_key = ldns_rr_list_rr(keys, i); - ldns_rr_print(stdout, current_key); - printf("\n"); key_buf = ldns_buffer_new(MAX_PACKETLEN); /* put the key-data in a buffer, that's the third rdf, with * the base64 encoded key data */ @@ -241,22 +232,15 @@ ldns_verify_rrsig_rsasha1(ldns_buffer *sig, ldns_buffer *rrset, ldns_buffer *key RSA *rsakey; unsigned char *sha1_hash; - printf("trying to verify III\n"); - rsakey = ldns_key_buf2rsa(key); if (!rsakey) { return false; } - BN_print_fp(stdout, rsakey->n); printf("\n->n\n"); - BN_print_fp(stdout, rsakey->e); printf("\n->e\n"); - printf("trying to verify IV\n"); - printf("size %d\n", ldns_buffer_position(rrset) ); - printf("size %x\n", ldns_buffer_begin(rrset) ); + sha1_hash = SHA1(ldns_buffer_begin(rrset), ldns_buffer_position(rrset), NULL); if (!sha1_hash) { return false; } - printf("trying to verify V\n"); if (RSA_verify(NID_sha1, sha1_hash, SHA_DIGEST_LENGTH, ldns_buffer_begin(sig), ldns_buffer_position(sig), rsakey) == 1) { diff --git a/host2wire.c b/host2wire.c index a12c6db0..ce318407 100644 --- a/host2wire.c +++ b/host2wire.c @@ -114,40 +114,12 @@ ldns_rrsig2buffer_wire(ldns_buffer *buffer, ldns_rr *rr) return LDNS_STATUS_ERR; } -#if 0 - if (ldns_rr_owner(rr)) { - (void) ldns_dname2buffer_wire(buffer, ldns_rr_owner(rr)); - } - - if (ldns_buffer_reserve(buffer, 4)) { - (void) ldns_buffer_write_u16(buffer, ldns_rr_get_type(rr)); - (void) ldns_buffer_write_u16(buffer, ldns_rr_get_class(rr)); - } - - if (ldns_buffer_reserve(buffer, 6)) { - ldns_buffer_write_u32(buffer, ldns_rr_ttl(rr)); - /* remember pos for later */ - rdl_pos = ldns_buffer_position(buffer); - ldns_buffer_write_u16(buffer, 0); - } -#endif - - /* now convert all the rdfs, except the actual signature data + /* Convert all the rdfs, except the actual signature data * rdf number 8 - the last, hence: -1 */ for (i = 0; i < ldns_rr_rd_count(rr) - 1; i++) { (void) ldns_rdf2buffer_wire(buffer, ldns_rr_rdf(rr, i)); } -#if 0 - if (rdl_pos != 0) { - ldns_buffer_write_u16_at(buffer, - rdl_pos, - ldns_buffer_position(buffer) - - rdl_pos - - 2 - ); - } -#endif return ldns_buffer_status(buffer); }