}
+/* Init the random source
+ * apps must call this
+ */
+ldns_status ldns_init_random(uint16_t num) {
+ FILE *rand;
+ uint8_t *buf;
+
+ buf = LDNS_XMALLOC(uint8_t, num);
+ if (!buf) {
+ return LDNS_STATUS_ERR;;
+ }
+
+ if ((rand = fopen("r", "/dev/random")) == NULL) {
+ LDNS_FREE(buf);
+ return LDNS_STATUS_ERR;
+ }
+ if ((fread(buf, sizeof(uint8_t), (size_t)num, rand) != num)) {
+ LDNS_FREE(buf);
+ fclose(rand);
+ return LDNS_STATUS_ERR;
+ }
+ LDNS_FREE(buf);
+ RAND_seed((const void *)buf, (int)num);
+ return LDNS_STATUS_OK;
+}
exit(EXIT_FAILURE);
}
+ ldns_random_init(1000); /* init the random engine */
+
/* create an rdf from the domain name */
domain = ldns_dname_new_frm_str(argv[0]);
*/
ldns_zone *ldns_zone_sign(ldns_zone *zone, ldns_key_list *key_list, ldns_key_list *key_signing_key_list);
+ldns_status ldns_init_random(uint16_t num);
#endif /* _LDNS_DNSSEC_H_ */