run-test11: run-test11.o $(LIBDNS_OBJECTS) $(LIBOBJS)
$(LINK) ${LIBS} -o $@ $+
run-test18: run-test18.o $(LIBDNS_OBJECTS) $(LIBOBJS)
- $(LINK) ${LIBS} -o $@ $+
+ $(LINK) ${LIBS} -lssl -o $@ $+
doc:
doxygen libdns.doxygen
current_sig = ldns_rr_new_frm_type(LDNS_RR_TYPE_RRSIG);
/* set the type on the new signature */
- orig_ttl = ldns_key_ttl(current_key);
+ orig_ttl = ldns_key_origttl(current_key);
/* set the ttl from the priv key on the rrset */
for (i = 0; i < ldns_rr_list_rr_count(rrset); i++) {
/* fill in what we now of the signature */
/* set the orig_ttl */
+ printf("orig ttl %d\n", orig_ttl);
(void)ldns_rr_rrsig_set_origttl(current_sig, ldns_native2rdf_int32(LDNS_RDF_TYPE_INT32, orig_ttl));
/* the signers name */
(void)ldns_rr_rrsig_set_signame(current_sig,
(void)ldns_rr_rrsig_set_typecovered(current_sig,
ldns_native2rdf_int16(LDNS_RDF_TYPE_TYPE,
ldns_rr_get_type(ldns_rr_list_rr(rrset_clone, 0))));
+ printf("Sig before signing\n\n[");
+ ldns_rr_print(stdout, current_sig);
+ printf("]\n");
/* right now, we have: a key, a semi-sig and an rrset. For
* which we can create the sig and base64 encode that and
sigdata_rdf = ldns_rdf_new_frm_data(LDNS_RDF_TYPE_B64, siglen,
ldns_buffer_begin(b64sig));
- /* FREE(sha1_hash); - don't free -> invalid pointer */
ldns_buffer_free(b64sig);
return sigdata_rdf;
}
&siglen, key);
sigdata_rdf = ldns_rdf_new_frm_data(LDNS_RDF_TYPE_B64, siglen,
ldns_buffer_begin(b64sig));
- /* ldns_buffer_free(b64sig); can't free this buffer ?? */
+ ldns_buffer_free(b64sig); /* can't free this buffer ?? */
return sigdata_rdf;
}
if (!newkey) {
return NULL;
} else {
+ /* some defaults - not sure wether to do this */
ldns_key_set_flags(newkey, 256);
+ ldns_key_set_origttl(newkey, 0);
ldns_key_set_keytag(newkey, 0);
ldns_key_set_inception(newkey, 0);
ldns_key_set_expiration(newkey, 0);
break;
}
ldns_key_set_algorithm(k, alg);
- /* some defaults - not sure wether to this there or not */
- ldns_key_set_flags(k, 256);
- ldns_key_set_inception(k, 0);
- ldns_key_set_expiration(k, 0);
- ldns_key_set_keytag(k,0);
return k;
}
}
void
-ldns_key_set_ttl(ldns_key *k, uint32_t t)
+ldns_key_set_origttl(ldns_key *k, uint32_t t)
{
k->_extra.dnssec.orig_ttl = t;
}
}
uint32_t
-ldns_key_ttl(ldns_key *k)
+ldns_key_origttl(ldns_key *k)
{
return k->_extra.dnssec.orig_ttl;
}
void ldns_key_set_rsa_key(ldns_key *k, RSA *r);
void ldns_key_set_dsa_key(ldns_key *k, DSA *d);
void ldns_key_set_hmac_key(ldns_key *k, unsigned char *hmac);
-void ldns_key_set_ttl(ldns_key *k, uint32_t t);
+void ldns_key_set_origttl(ldns_key *k, uint32_t t);
void ldns_key_set_inception(ldns_key *k, uint32_t i);
void ldns_key_set_expiration(ldns_key *k, uint32_t e);
void ldns_key_set_pubkey_owner(ldns_key *k, ldns_rdf *r);
RSA * ldns_key_rsa_key(ldns_key *k);
DSA * ldns_key_dsa_key(ldns_key *k);
unsigned char * ldns_key_hmac_key(ldns_key *k);
-uint32_t ldns_key_ttl(ldns_key *k);
+uint32_t ldns_key_origttl(ldns_key *k);
uint32_t ldns_key_inception(ldns_key *k);
uint32_t ldns_key_expiration(ldns_key *k);
uint16_t ldns_key_keytag(ldns_key *k);
owner = ldns_dname_new_frm_str("miek.nl");
ldns_key_set_pubkey_owner(privkey, owner);
+ ldns_key_set_origttl(privkey, 1800);
+ SSL_load_error_strings();
ldns_key_list_push_key(keys, privkey);
ldns_rr_list_push_rr(rrs, rr);