OpenDNSSEC-enforcer  2.0.3
policy_ext.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 Jerry Lundström <lundstrom.jerry@gmail.com>
3  * Copyright (c) 2014 .SE (The Internet Infrastructure Foundation).
4  * Copyright (c) 2014 OpenDNSSEC AB (svb)
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
20  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
22  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
24  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
25  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  *
28  */
29 
30 #include "policy.h"
31 
32 #include "db_error.h"
33 #include "duration.h"
34 #include "log.h"
35 
36 #include <string.h>
37 
38 static int __xmlNode2policy(policy_t* policy, xmlNodePtr policy_node, int* updated) {
39  xmlNodePtr node;
40  xmlNodePtr node2;
41  xmlNodePtr node3;
42  xmlNodePtr node4;
43  xmlChar* xml_text = NULL;
44  duration_type* duration = NULL;
45  int check_if_updated = 0;
46  int update_this = 1;
47  int denial_optout = 0;
48  int keys_shared = 0;
49  int signatures_max_zone_ttl = 0;
50  int keys_purge = 0;
51  int denial_ttl = 0;
52  unsigned int passthrough = 0;
53 
54  if (!policy) {
55  return DB_ERROR_UNKNOWN;
56  }
57  if (!policy_node) {
58  return DB_ERROR_UNKNOWN;
59  }
60 
61  /*
62  * If updated is set we will check if the content is changed and set the
63  * integer pointed by updated to non-zero.
64  */
65  if (updated) {
66  *updated = 0;
67  check_if_updated = 1;
68  }
69 
70  if (!(xml_text = xmlGetProp(policy_node, (xmlChar*)"name"))) {
71  return DB_ERROR_UNKNOWN;
72  }
73  ods_log_deeebug("[policy_*_from_xml] policy %s", (char*)xml_text);
74  if (check_if_updated) {
75  update_this = 0;
76  if (!policy_name(policy)) {
77  *updated = 1;
78  update_this = 1;
79  }
80  else if (strcmp(policy_name(policy), (char*)xml_text)) {
81  *updated = 1;
82  update_this = 1;
83  }
84  }
85  if (update_this) {
86  if (policy_set_name(policy, (char*)xml_text)) {
87  if (xml_text) {
88  xmlFree(xml_text);
89  }
90  return DB_ERROR_UNKNOWN;
91  }
92  }
93  if (xml_text) {
94  xmlFree(xml_text);
95  xml_text = NULL;
96  }
97 
98  for (node = policy_node->children; node; node = node->next) {
99  if (node->type != XML_ELEMENT_NODE) {
100  continue;
101  }
102 
103  if (!strcmp((char*)node->name, "Description")) {
104  if (!(xml_text = xmlNodeGetContent(node))) {
105  return DB_ERROR_UNKNOWN;
106  }
107  ods_log_deeebug("[policy_*_from_xml] description %s", (char*)xml_text);
108  if (check_if_updated) {
109  update_this = 0;
110  if (!policy_description(policy)) {
111  *updated = 1;
112  update_this = 1;
113  }
114  else if (strcmp(policy_description(policy), (char*)xml_text)) {
115  *updated = 1;
116  update_this = 1;
117  }
118  }
119  if (update_this) {
120  if (policy_set_description(policy, (char*)xml_text)) {
121  if (xml_text) {
122  xmlFree(xml_text);
123  }
124  return DB_ERROR_UNKNOWN;
125  }
126  }
127  if (xml_text) {
128  xmlFree(xml_text);
129  xml_text = NULL;
130  }
131  }
132  else if (!strcmp((char*)node->name, "Passthrough")) {
133  passthrough = 1;
134  }
135  else if (!strcmp((char*)node->name, "Signatures")) {
136  for (node2 = node->children; node2; node2 = node2->next) {
137  if (node2->type != XML_ELEMENT_NODE) {
138  continue;
139  }
140 
141  if (!strcmp((char*)node2->name, "Resign")) {
142  if (!(xml_text = xmlNodeGetContent(node2))) {
143  return DB_ERROR_UNKNOWN;
144  }
145  ods_log_deeebug("[policy_*_from_xml] signature resign %s", (char*)xml_text);
146  if (!(duration = duration_create_from_string((char*)xml_text))) {
147  if (xml_text) {
148  xmlFree(xml_text);
149  }
150  return DB_ERROR_UNKNOWN;
151  }
152  if (xml_text) {
153  xmlFree(xml_text);
154  xml_text = NULL;
155  }
156  if (check_if_updated) {
157  update_this = 0;
158  if (policy_signatures_resign(policy) != duration2time(duration)) {
159  *updated = 1;
160  update_this = 1;
161  }
162  }
163  if (update_this) {
164  if (policy_set_signatures_resign(policy, duration2time(duration))) {
165  duration_cleanup(duration);
166  return DB_ERROR_UNKNOWN;
167  }
168  }
169  duration_cleanup(duration);
170  duration = NULL;
171  }
172  else if (!strcmp((char*)node2->name, "Refresh")) {
173  if (!(xml_text = xmlNodeGetContent(node2))) {
174  return DB_ERROR_UNKNOWN;
175  }
176  ods_log_deeebug("[policy_*_from_xml] signature refresh %s", (char*)xml_text);
177  if (!(duration = duration_create_from_string((char*)xml_text))) {
178  if (xml_text) {
179  xmlFree(xml_text);
180  }
181  return DB_ERROR_UNKNOWN;
182  }
183  if (xml_text) {
184  xmlFree(xml_text);
185  xml_text = NULL;
186  }
187  if (check_if_updated) {
188  update_this = 0;
189  if (policy_signatures_refresh(policy) != duration2time(duration)) {
190  *updated = 1;
191  update_this = 1;
192  }
193  }
194  if (update_this) {
195  if (policy_set_signatures_refresh(policy, duration2time(duration))) {
196  duration_cleanup(duration);
197  return DB_ERROR_UNKNOWN;
198  }
199  }
200  duration_cleanup(duration);
201  duration = NULL;
202  }
203  else if (!strcmp((char*)node2->name, "Validity")) {
204  for (node3 = node2->children; node3; node3 = node3->next) {
205  if (node3->type != XML_ELEMENT_NODE) {
206  continue;
207  }
208 
209  if (!strcmp((char*)node3->name, "Default")) {
210  if (!(xml_text = xmlNodeGetContent(node3))) {
211  return DB_ERROR_UNKNOWN;
212  }
213  ods_log_deeebug("[policy_*_from_xml] signature validity default %s", (char*)xml_text);
214  if (!(duration = duration_create_from_string((char*)xml_text))) {
215  if (xml_text) {
216  xmlFree(xml_text);
217  }
218  return DB_ERROR_UNKNOWN;
219  }
220  if (xml_text) {
221  xmlFree(xml_text);
222  xml_text = NULL;
223  }
224  if (check_if_updated) {
225  update_this = 0;
226  if (policy_signatures_validity_default(policy) != duration2time(duration)) {
227  *updated = 1;
228  update_this = 1;
229  }
230  }
231  if (update_this) {
232  if (policy_set_signatures_validity_default(policy, duration2time(duration))) {
233  duration_cleanup(duration);
234  return DB_ERROR_UNKNOWN;
235  }
236  }
237  duration_cleanup(duration);
238  duration = NULL;
239  }
240  else if (!strcmp((char*)node3->name, "Denial")) {
241  if (!(xml_text = xmlNodeGetContent(node3))) {
242  return DB_ERROR_UNKNOWN;
243  }
244  ods_log_deeebug("[policy_*_from_xml] signature validity denial %s", (char*)xml_text);
245  if (!(duration = duration_create_from_string((char*)xml_text))) {
246  if (xml_text) {
247  xmlFree(xml_text);
248  }
249  return DB_ERROR_UNKNOWN;
250  }
251  if (xml_text) {
252  xmlFree(xml_text);
253  xml_text = NULL;
254  }
255  if (check_if_updated) {
256  update_this = 0;
257  if (policy_signatures_validity_denial(policy) != duration2time(duration)) {
258  *updated = 1;
259  update_this = 1;
260  }
261  }
262  if (update_this) {
263  if (policy_set_signatures_validity_denial(policy, duration2time(duration))) {
264  duration_cleanup(duration);
265  return DB_ERROR_UNKNOWN;
266  }
267  }
268  duration_cleanup(duration);
269  duration = NULL;
270  }
271  else if (!strcmp((char*)node3->name, "Keyset")) {
272  if (!(xml_text = xmlNodeGetContent(node3))) {
273  return DB_ERROR_UNKNOWN;
274  }
275  ods_log_deeebug("[policy_*_from_xml] signature validity keyset %s", (char*)xml_text);
276  if (!(duration = duration_create_from_string((char*)xml_text))) {
277  if (xml_text) {
278  xmlFree(xml_text);
279  }
280  return DB_ERROR_UNKNOWN;
281  }
282  if (xml_text) {
283  xmlFree(xml_text);
284  xml_text = NULL;
285  }
286  if (check_if_updated) {
287  update_this = 0;
288  if (policy_signatures_validity_keyset(policy) != duration2time(duration)) {
289  *updated = 1;
290  update_this = 1;
291  }
292  }
293  if (update_this) {
294  if (policy_set_signatures_validity_keyset(policy, duration2time(duration))) {
295  duration_cleanup(duration);
296  return DB_ERROR_UNKNOWN;
297  }
298  }
299  duration_cleanup(duration);
300  duration = NULL;
301  }
302  else {
303  ods_log_deeebug("[policy_*_from_xml] unknown %s", (char*)node3->name);
304  return DB_ERROR_UNKNOWN;
305  }
306  }
307  }
308  else if (!strcmp((char*)node2->name, "Jitter")) {
309  if (!(xml_text = xmlNodeGetContent(node2))) {
310  return DB_ERROR_UNKNOWN;
311  }
312  ods_log_deeebug("[policy_*_from_xml] signature jitter %s", (char*)xml_text);
313  if (!(duration = duration_create_from_string((char*)xml_text))) {
314  if (xml_text) {
315  xmlFree(xml_text);
316  }
317  return DB_ERROR_UNKNOWN;
318  }
319  if (xml_text) {
320  xmlFree(xml_text);
321  xml_text = NULL;
322  }
323  if (check_if_updated) {
324  update_this = 0;
325  if (policy_signatures_jitter(policy) != duration2time(duration)) {
326  *updated = 1;
327  update_this = 1;
328  }
329  }
330  if (update_this) {
331  if (policy_set_signatures_jitter(policy, duration2time(duration))) {
332  duration_cleanup(duration);
333  return DB_ERROR_UNKNOWN;
334  }
335  }
336  duration_cleanup(duration);
337  duration = NULL;
338  }
339  else if (!strcmp((char*)node2->name, "InceptionOffset")) {
340  if (!(xml_text = xmlNodeGetContent(node2))) {
341  return DB_ERROR_UNKNOWN;
342  }
343  ods_log_deeebug("[policy_*_from_xml] signature inception offset %s", (char*)xml_text);
344  if (!(duration = duration_create_from_string((char*)xml_text))) {
345  if (xml_text) {
346  xmlFree(xml_text);
347  }
348  return DB_ERROR_UNKNOWN;
349  }
350  if (xml_text) {
351  xmlFree(xml_text);
352  xml_text = NULL;
353  }
354  if (check_if_updated) {
355  update_this = 0;
356  if (policy_signatures_inception_offset(policy) != duration2time(duration)) {
357  *updated = 1;
358  update_this = 1;
359  }
360  }
361  if (update_this) {
362  if (policy_set_signatures_inception_offset(policy, duration2time(duration))) {
363  duration_cleanup(duration);
364  return DB_ERROR_UNKNOWN;
365  }
366  }
367  duration_cleanup(duration);
368  duration = NULL;
369  }
370  else if (!strcmp((char*)node2->name, "MaxZoneTTL")) {
371  signatures_max_zone_ttl = 1;
372  if (!(xml_text = xmlNodeGetContent(node2))) {
373  return DB_ERROR_UNKNOWN;
374  }
375  ods_log_deeebug("[policy_*_from_xml] signature max zone ttl %s", (char*)xml_text);
376  if (!(duration = duration_create_from_string((char*)xml_text))) {
377  if (xml_text) {
378  xmlFree(xml_text);
379  }
380  return DB_ERROR_UNKNOWN;
381  }
382  if (xml_text) {
383  xmlFree(xml_text);
384  xml_text = NULL;
385  }
386  if (check_if_updated) {
387  update_this = 0;
388  if (policy_signatures_max_zone_ttl(policy) != duration2time(duration)) {
389  *updated = 1;
390  update_this = 1;
391  }
392  }
393  if (update_this) {
394  if (policy_set_signatures_max_zone_ttl(policy, duration2time(duration))) {
395  duration_cleanup(duration);
396  return DB_ERROR_UNKNOWN;
397  }
398  }
399  duration_cleanup(duration);
400  duration = NULL;
401  }
402  else {
403  ods_log_deeebug("[policy_*_from_xml] unknown %s", (char*)node2->name);
404  return DB_ERROR_UNKNOWN;
405  }
406  }
407  }
408  else if (!strcmp((char*)node->name, "Denial")) {
409  for (node2 = node->children; node2; node2 = node2->next) {
410  if (node2->type != XML_ELEMENT_NODE) {
411  continue;
412  }
413 
414  if (!strcmp((char*)node2->name, "NSEC")) {
415  ods_log_deeebug("[policy_*_from_xml] denial nsec");
416  if (check_if_updated) {
417  update_this = 0;
419  *updated = 1;
420  update_this = 1;
421  }
422  }
423  if (update_this) {
425  return DB_ERROR_UNKNOWN;
426  }
427  }
428  }
429  else if (!strcmp((char*)node2->name, "NSEC3")) {
430  ods_log_deeebug("[policy_*_from_xml] denial nsec3");
431  if (check_if_updated) {
432  update_this = 0;
434  *updated = 1;
435  update_this = 1;
436  }
437  }
438  if (update_this) {
440  return DB_ERROR_UNKNOWN;
441  }
442  }
443 
444  for (node3 = node2->children; node3; node3 = node3->next) {
445  if (node3->type != XML_ELEMENT_NODE) {
446  continue;
447  }
448 
449  if (!strcmp((char*)node3->name, "TTL")) {
450  denial_ttl = 1;
451  if (!(xml_text = xmlNodeGetContent(node3))) {
452  return DB_ERROR_UNKNOWN;
453  }
454  ods_log_deeebug("[policy_*_from_xml] denial ttl %s", (char*)xml_text);
455  if (!(duration = duration_create_from_string((char*)xml_text))) {
456  if (xml_text) {
457  xmlFree(xml_text);
458  }
459  return DB_ERROR_UNKNOWN;
460  }
461  if (xml_text) {
462  xmlFree(xml_text);
463  xml_text = NULL;
464  }
465  if (check_if_updated) {
466  update_this = 0;
467  if (policy_denial_ttl(policy) != duration2time(duration)) {
468  *updated = 1;
469  update_this = 1;
470  }
471  }
472  if (update_this) {
473  if (policy_set_denial_ttl(policy, duration2time(duration))) {
474  duration_cleanup(duration);
475  return DB_ERROR_UNKNOWN;
476  }
477  }
478  duration_cleanup(duration);
479  duration = NULL;
480  }
481  else if (!strcmp((char*)node3->name, "OptOut")) {
482  denial_optout = 1;
483  ods_log_deeebug("[policy_*_from_xml] denial optout");
484  if (check_if_updated) {
485  update_this = 0;
486  if (!policy_denial_optout(policy)) {
487  *updated = 1;
488  update_this = 1;
489  }
490  }
491  if (update_this) {
492  if (policy_set_denial_optout(policy, 1)) {
493  return DB_ERROR_UNKNOWN;
494  }
495  }
496  }
497  else if (!strcmp((char*)node3->name, "Resalt")) {
498  if (!(xml_text = xmlNodeGetContent(node3))) {
499  return DB_ERROR_UNKNOWN;
500  }
501  ods_log_deeebug("[policy_*_from_xml] denial resalt %s", (char*)xml_text);
502  if (!(duration = duration_create_from_string((char*)xml_text))) {
503  if (xml_text) {
504  xmlFree(xml_text);
505  }
506  return DB_ERROR_UNKNOWN;
507  }
508  if (xml_text) {
509  xmlFree(xml_text);
510  xml_text = NULL;
511  }
512  if (check_if_updated) {
513  update_this = 0;
514  if (policy_denial_resalt(policy) != duration2time(duration)) {
515  *updated = 1;
516  update_this = 1;
517  }
518  }
519  if (update_this) {
520  if (policy_set_denial_resalt(policy, duration2time(duration))) {
521  duration_cleanup(duration);
522  return DB_ERROR_UNKNOWN;
523  }
524  }
525  duration_cleanup(duration);
526  duration = NULL;
527  }
528  else if (!strcmp((char*)node3->name, "Hash")) {
529  for (node4 = node3->children; node4; node4 = node4->next) {
530  if (node4->type != XML_ELEMENT_NODE) {
531  continue;
532  }
533 
534  if (!strcmp((char*)node4->name, "Algorithm")) {
535  if (!(xml_text = xmlNodeGetContent(node4))) {
536  return DB_ERROR_UNKNOWN;
537  }
538  ods_log_deeebug("[policy_*_from_xml] denial algorithm %s", (char*)xml_text);
539  if (check_if_updated) {
540  update_this = 0;
541  if (policy_denial_algorithm(policy) != (unsigned int)atoi((char*)xml_text)) {
542  *updated = 1;
543  update_this = 1;
544  }
545  }
546  if (update_this) {
547  if (policy_set_denial_algorithm(policy, (unsigned int)atoi((char*)xml_text))) {
548  if (xml_text) {
549  xmlFree(xml_text);
550  }
551  return DB_ERROR_UNKNOWN;
552  }
553  }
554  if (xml_text) {
555  xmlFree(xml_text);
556  xml_text = NULL;
557  }
558  }
559  else if (!strcmp((char*)node4->name, "Iterations")) {
560  if (!(xml_text = xmlNodeGetContent(node4))) {
561  return DB_ERROR_UNKNOWN;
562  }
563  ods_log_deeebug("[policy_*_from_xml] denial iterations %s", (char*)xml_text);
564  if (check_if_updated) {
565  update_this = 0;
566  if (policy_denial_iterations(policy) != (unsigned int)atoi((char*)xml_text)) {
567  *updated = 1;
568  update_this = 1;
569  }
570  }
571  if (update_this) {
572  if (policy_set_denial_iterations(policy, (unsigned int)atoi((char*)xml_text))) {
573  if (xml_text) {
574  xmlFree(xml_text);
575  }
576  return DB_ERROR_UNKNOWN;
577  }
578  }
579  if (xml_text) {
580  xmlFree(xml_text);
581  xml_text = NULL;
582  }
583  }
584  else if (!strcmp((char*)node4->name, "Salt")) {
585  if (!(xml_text = xmlGetProp(node4, (xmlChar*)"length"))) {
586  return DB_ERROR_UNKNOWN;
587  }
588  ods_log_deeebug("[policy_*_from_xml] denial salt length %s", (char*)xml_text);
589  if (check_if_updated) {
590  update_this = 0;
591  if (policy_denial_salt_length(policy) != (unsigned int)atoi((char*)xml_text)) {
592  *updated = 1;
593  update_this = 1;
594  }
595  }
596  if (update_this) {
597  if (policy_set_denial_salt_length(policy, (unsigned int)atoi((char*)xml_text))) {
598  if (xml_text) {
599  xmlFree(xml_text);
600  }
601  return DB_ERROR_UNKNOWN;
602  }
603  }
604  if (xml_text) {
605  xmlFree(xml_text);
606  xml_text = NULL;
607  }
608  }
609  else {
610  ods_log_deeebug("[policy_*_from_xml] unknown %s", (char*)node4->name);
611  return DB_ERROR_UNKNOWN;
612  }
613  }
614  }
615  else {
616  ods_log_deeebug("[policy_*_from_xml] unknown %s", (char*)node3->name);
617  return DB_ERROR_UNKNOWN;
618  }
619  }
620  }
621  else {
622  ods_log_deeebug("[policy_*_from_xml] unknown %s", (char*)node2->name);
623  return DB_ERROR_UNKNOWN;
624  }
625  }
626  }
627  else if (!strcmp((char*)node->name, "Keys")) {
628  for (node2 = node->children; node2; node2 = node2->next) {
629  if (node2->type != XML_ELEMENT_NODE) {
630  continue;
631  }
632 
633  if (!strcmp((char*)node2->name, "TTL")) {
634  if (!(xml_text = xmlNodeGetContent(node2))) {
635  return DB_ERROR_UNKNOWN;
636  }
637  ods_log_deeebug("[policy_*_from_xml] keys ttl %s", (char*)xml_text);
638  if (!(duration = duration_create_from_string((char*)xml_text))) {
639  if (xml_text) {
640  xmlFree(xml_text);
641  }
642  return DB_ERROR_UNKNOWN;
643  }
644  if (xml_text) {
645  xmlFree(xml_text);
646  xml_text = NULL;
647  }
648  if (check_if_updated) {
649  update_this = 0;
650  if (policy_keys_ttl(policy) != duration2time(duration)) {
651  *updated = 1;
652  update_this = 1;
653  }
654  }
655  if (update_this) {
656  if (policy_set_keys_ttl(policy, duration2time(duration))) {
657  duration_cleanup(duration);
658  return DB_ERROR_UNKNOWN;
659  }
660  }
661  duration_cleanup(duration);
662  duration = NULL;
663  }
664  else if (!strcmp((char*)node2->name, "RetireSafety")) {
665  if (!(xml_text = xmlNodeGetContent(node2))) {
666  return DB_ERROR_UNKNOWN;
667  }
668  ods_log_deeebug("[policy_*_from_xml] keys retire safety %s", (char*)xml_text);
669  if (!(duration = duration_create_from_string((char*)xml_text))) {
670  if (xml_text) {
671  xmlFree(xml_text);
672  }
673  return DB_ERROR_UNKNOWN;
674  }
675  if (xml_text) {
676  xmlFree(xml_text);
677  xml_text = NULL;
678  }
679  if (check_if_updated) {
680  update_this = 0;
681  if (policy_keys_retire_safety(policy) != duration2time(duration)) {
682  *updated = 1;
683  update_this = 1;
684  }
685  }
686  if (update_this) {
687  if (policy_set_keys_retire_safety(policy, duration2time(duration))) {
688  duration_cleanup(duration);
689  return DB_ERROR_UNKNOWN;
690  }
691  }
692  duration_cleanup(duration);
693  duration = NULL;
694  }
695  else if (!strcmp((char*)node2->name, "PublishSafety")) {
696  if (!(xml_text = xmlNodeGetContent(node2))) {
697  return DB_ERROR_UNKNOWN;
698  }
699  ods_log_deeebug("[policy_*_from_xml] keys publish safety %s", (char*)xml_text);
700  if (!(duration = duration_create_from_string((char*)xml_text))) {
701  if (xml_text) {
702  xmlFree(xml_text);
703  }
704  return DB_ERROR_UNKNOWN;
705  }
706  if (xml_text) {
707  xmlFree(xml_text);
708  xml_text = NULL;
709  }
710  if (check_if_updated) {
711  update_this = 0;
712  if (policy_keys_publish_safety(policy) != duration2time(duration)) {
713  *updated = 1;
714  update_this = 1;
715  }
716  }
717  if (update_this) {
718  if (policy_set_keys_publish_safety(policy, duration2time(duration))) {
719  duration_cleanup(duration);
720  return DB_ERROR_UNKNOWN;
721  }
722  }
723  duration_cleanup(duration);
724  duration = NULL;
725  }
726  else if (!strcmp((char*)node2->name, "ShareKeys")) {
727  keys_shared = 1;
728  ods_log_deeebug("[policy_*_from_xml] keys shared keys");
729  if (check_if_updated) {
730  update_this = 0;
731  if (!policy_keys_shared(policy)) {
732  *updated = 1;
733  update_this = 1;
734  }
735  }
736  if (update_this) {
737  if (policy_set_keys_shared(policy, 1)) {
738  return DB_ERROR_UNKNOWN;
739  }
740  }
741  }
742  else if (!strcmp((char*)node2->name, "Purge")) {
743  keys_purge = 1;
744  if (!(xml_text = xmlNodeGetContent(node2))) {
745  return DB_ERROR_UNKNOWN;
746  }
747  ods_log_deeebug("[policy_*_from_xml] keys purge %s", (char*)xml_text);
748  if (!(duration = duration_create_from_string((char*)xml_text))) {
749  if (xml_text) {
750  xmlFree(xml_text);
751  }
752  return DB_ERROR_UNKNOWN;
753  }
754  if (xml_text) {
755  xmlFree(xml_text);
756  xml_text = NULL;
757  }
758  if (check_if_updated) {
759  update_this = 0;
760  if (policy_keys_purge_after(policy) != duration2time(duration)) {
761  *updated = 1;
762  update_this = 1;
763  }
764  }
765  if (update_this) {
766  if (policy_set_keys_purge_after(policy, duration2time(duration))) {
767  duration_cleanup(duration);
768  return DB_ERROR_UNKNOWN;
769  }
770  }
771  duration_cleanup(duration);
772  duration = NULL;
773  }
774  else if (!strcmp((char*)node2->name, "KSK")) {
775  continue;
776  }
777  else if (!strcmp((char*)node2->name, "ZSK")) {
778  continue;
779  }
780  else if (!strcmp((char*)node2->name, "CSK")) {
781  continue;
782  }
783  else {
784  ods_log_deeebug("[policy_*_from_xml] unknown %s", (char*)node2->name);
785  return DB_ERROR_UNKNOWN;
786  }
787  }
788  }
789  else if (!strcmp((char*)node->name, "Zone")) {
790  for (node2 = node->children; node2; node2 = node2->next) {
791  if (node2->type != XML_ELEMENT_NODE) {
792  continue;
793  }
794 
795  if (!strcmp((char*)node2->name, "PropagationDelay")) {
796  if (!(xml_text = xmlNodeGetContent(node2))) {
797  return DB_ERROR_UNKNOWN;
798  }
799  ods_log_deeebug("[policy_*_from_xml] zone propagation delay %s", (char*)xml_text);
800  if (!(duration = duration_create_from_string((char*)xml_text))) {
801  if (xml_text) {
802  xmlFree(xml_text);
803  }
804  return DB_ERROR_UNKNOWN;
805  }
806  if (xml_text) {
807  xmlFree(xml_text);
808  xml_text = NULL;
809  }
810  if (check_if_updated) {
811  update_this = 0;
812  if (policy_zone_propagation_delay(policy) != duration2time(duration)) {
813  *updated = 1;
814  update_this = 1;
815  }
816  }
817  if (update_this) {
818  if (policy_set_zone_propagation_delay(policy, duration2time(duration))) {
819  duration_cleanup(duration);
820  return DB_ERROR_UNKNOWN;
821  }
822  }
823  duration_cleanup(duration);
824  duration = NULL;
825  }
826  else if (!strcmp((char*)node2->name, "SOA")) {
827  for (node3 = node2->children; node3; node3 = node3->next) {
828  if (node3->type != XML_ELEMENT_NODE) {
829  continue;
830  }
831 
832  if (!strcmp((char*)node3->name, "TTL")) {
833  if (!(xml_text = xmlNodeGetContent(node3))) {
834  return DB_ERROR_UNKNOWN;
835  }
836  ods_log_deeebug("[policy_*_from_xml] zone soa ttl %s", (char*)xml_text);
837  if (!(duration = duration_create_from_string((char*)xml_text))) {
838  if (xml_text) {
839  xmlFree(xml_text);
840  }
841  return DB_ERROR_UNKNOWN;
842  }
843  if (xml_text) {
844  xmlFree(xml_text);
845  xml_text = NULL;
846  }
847  if (check_if_updated) {
848  update_this = 0;
849  if (policy_zone_soa_ttl(policy) != duration2time(duration)) {
850  *updated = 1;
851  update_this = 1;
852  }
853  }
854  if (update_this) {
855  if (policy_set_zone_soa_ttl(policy, duration2time(duration))) {
856  duration_cleanup(duration);
857  return DB_ERROR_UNKNOWN;
858  }
859  }
860  duration_cleanup(duration);
861  duration = NULL;
862  }
863  else if (!strcmp((char*)node3->name, "Minimum")) {
864  if (!(xml_text = xmlNodeGetContent(node3))) {
865  return DB_ERROR_UNKNOWN;
866  }
867  ods_log_deeebug("[policy_*_from_xml] zone soa minimum %s", (char*)xml_text);
868  if (!(duration = duration_create_from_string((char*)xml_text))) {
869  if (xml_text) {
870  xmlFree(xml_text);
871  }
872  return DB_ERROR_UNKNOWN;
873  }
874  if (xml_text) {
875  xmlFree(xml_text);
876  xml_text = NULL;
877  }
878  if (check_if_updated) {
879  update_this = 0;
880  if (policy_zone_soa_minimum(policy) != duration2time(duration)) {
881  *updated = 1;
882  update_this = 1;
883  }
884  }
885  if (update_this) {
886  if (policy_set_zone_soa_minimum(policy, duration2time(duration))) {
887  duration_cleanup(duration);
888  return DB_ERROR_UNKNOWN;
889  }
890  }
891  duration_cleanup(duration);
892  duration = NULL;
893  }
894  else if (!strcmp((char*)node3->name, "Serial")) {
895  if (!(xml_text = xmlNodeGetContent(node3))) {
896  return DB_ERROR_UNKNOWN;
897  }
898  ods_log_deeebug("[policy_*_from_xml] zone soa serial %s", (char*)xml_text);
899  if (check_if_updated) {
900  update_this = 0;
901  if (strcmp(policy_zone_soa_serial_text(policy), (char*)xml_text)) {
902  *updated = 1;
903  update_this = 1;
904  }
905  }
906  if (update_this) {
907  if (policy_set_zone_soa_serial_text(policy, (char*)xml_text)) {
908  if (xml_text) {
909  xmlFree(xml_text);
910  }
911  return DB_ERROR_UNKNOWN;
912  }
913  }
914  if (xml_text) {
915  xmlFree(xml_text);
916  xml_text = NULL;
917  }
918  }
919  else {
920  ods_log_deeebug("[policy_*_from_xml] unknown %s", (char*)node3->name);
921  return DB_ERROR_UNKNOWN;
922  }
923  }
924  }
925  else {
926  ods_log_deeebug("[policy_*_from_xml] unknown %s", (char*)node2->name);
927  return DB_ERROR_UNKNOWN;
928  }
929  }
930  }
931  else if (!strcmp((char*)node->name, "Parent")) {
932  for (node2 = node->children; node2; node2 = node2->next) {
933  if (node2->type != XML_ELEMENT_NODE) {
934  continue;
935  }
936 
937  if (!strcmp((char*)node2->name, "RegistrationDelay")) {
938  if (!(xml_text = xmlNodeGetContent(node2))) {
939  return DB_ERROR_UNKNOWN;
940  }
941  ods_log_deeebug("[policy_*_from_xml] parent registration delay %s", (char*)xml_text);
942  if (!(duration = duration_create_from_string((char*)xml_text))) {
943  if (xml_text) {
944  xmlFree(xml_text);
945  }
946  return DB_ERROR_UNKNOWN;
947  }
948  if (xml_text) {
949  xmlFree(xml_text);
950  xml_text = NULL;
951  }
952  if (check_if_updated) {
953  update_this = 0;
954  if (policy_parent_registration_delay(policy) != duration2time(duration)) {
955  *updated = 1;
956  update_this = 1;
957  }
958  }
959  if (update_this) {
960  if (policy_set_parent_registration_delay(policy, duration2time(duration))) {
961  duration_cleanup(duration);
962  return DB_ERROR_UNKNOWN;
963  }
964  }
965  duration_cleanup(duration);
966  duration = NULL;
967  }
968  else if (!strcmp((char*)node2->name, "PropagationDelay")) {
969  if (!(xml_text = xmlNodeGetContent(node2))) {
970  return DB_ERROR_UNKNOWN;
971  }
972  ods_log_deeebug("[policy_*_from_xml] parent propagation delay %s", (char*)xml_text);
973  if (!(duration = duration_create_from_string((char*)xml_text))) {
974  if (xml_text) {
975  xmlFree(xml_text);
976  }
977  return DB_ERROR_UNKNOWN;
978  }
979  if (xml_text) {
980  xmlFree(xml_text);
981  xml_text = NULL;
982  }
983  if (check_if_updated) {
984  update_this = 0;
985  if (policy_parent_propagation_delay(policy) != duration2time(duration)) {
986  *updated = 1;
987  update_this = 1;
988  }
989  }
990  if (update_this) {
991  if (policy_set_parent_propagation_delay(policy, duration2time(duration))) {
992  duration_cleanup(duration);
993  return DB_ERROR_UNKNOWN;
994  }
995  }
996  duration_cleanup(duration);
997  duration = NULL;
998  }
999  else if (!strcmp((char*)node2->name, "SOA")) {
1000  for (node3 = node2->children; node3; node3 = node3->next) {
1001  if (node3->type != XML_ELEMENT_NODE) {
1002  continue;
1003  }
1004 
1005  if (!strcmp((char*)node3->name, "TTL")) {
1006  if (!(xml_text = xmlNodeGetContent(node3))) {
1007  return DB_ERROR_UNKNOWN;
1008  }
1009  ods_log_deeebug("[policy_*_from_xml] parent soa ttl %s", (char*)xml_text);
1010  if (!(duration = duration_create_from_string((char*)xml_text))) {
1011  if (xml_text) {
1012  xmlFree(xml_text);
1013  }
1014  return DB_ERROR_UNKNOWN;
1015  }
1016  if (xml_text) {
1017  xmlFree(xml_text);
1018  xml_text = NULL;
1019  }
1020  if (check_if_updated) {
1021  update_this = 0;
1022  if (policy_parent_soa_ttl(policy) != duration2time(duration)) {
1023  *updated = 1;
1024  update_this = 1;
1025  }
1026  }
1027  if (update_this) {
1028  if (policy_set_parent_soa_ttl(policy, duration2time(duration))) {
1029  duration_cleanup(duration);
1030  return DB_ERROR_UNKNOWN;
1031  }
1032  }
1033  duration_cleanup(duration);
1034  duration = NULL;
1035  }
1036  else if (!strcmp((char*)node3->name, "Minimum")) {
1037  if (!(xml_text = xmlNodeGetContent(node3))) {
1038  return DB_ERROR_UNKNOWN;
1039  }
1040  ods_log_deeebug("[policy_*_from_xml] parent soa minimum %s", (char*)xml_text);
1041  if (!(duration = duration_create_from_string((char*)xml_text))) {
1042  if (xml_text) {
1043  xmlFree(xml_text);
1044  }
1045  return DB_ERROR_UNKNOWN;
1046  }
1047  if (xml_text) {
1048  xmlFree(xml_text);
1049  xml_text = NULL;
1050  }
1051  if (check_if_updated) {
1052  update_this = 0;
1053  if (policy_parent_soa_minimum(policy) != duration2time(duration)) {
1054  *updated = 1;
1055  update_this = 1;
1056  }
1057  }
1058  if (update_this) {
1059  if (policy_set_parent_soa_minimum(policy, duration2time(duration))) {
1060  duration_cleanup(duration);
1061  return DB_ERROR_UNKNOWN;
1062  }
1063  }
1064  duration_cleanup(duration);
1065  duration = NULL;
1066  }
1067  else {
1068  ods_log_deeebug("[policy_*_from_xml] unknown %s", (char*)node3->name);
1069  return DB_ERROR_UNKNOWN;
1070  }
1071  }
1072  }
1073  else if (!strcmp((char*)node2->name, "DS")) {
1074  for (node3 = node2->children; node3; node3 = node3->next) {
1075  if (node3->type != XML_ELEMENT_NODE) {
1076  continue;
1077  }
1078 
1079  if (!strcmp((char*)node3->name, "TTL")) {
1080  if (!(xml_text = xmlNodeGetContent(node3))) {
1081  return DB_ERROR_UNKNOWN;
1082  }
1083  ods_log_deeebug("[policy_*_from_xml] parent ds ttl %s", (char*)xml_text);
1084  if (!(duration = duration_create_from_string((char*)xml_text))) {
1085  if (xml_text) {
1086  xmlFree(xml_text);
1087  }
1088  return DB_ERROR_UNKNOWN;
1089  }
1090  if (xml_text) {
1091  xmlFree(xml_text);
1092  xml_text = NULL;
1093  }
1094  if (check_if_updated) {
1095  update_this = 0;
1096  if (policy_parent_ds_ttl(policy) != duration2time(duration)) {
1097  *updated = 1;
1098  update_this = 1;
1099  }
1100  }
1101  if (update_this) {
1102  if (policy_set_parent_ds_ttl(policy, duration2time(duration))) {
1103  duration_cleanup(duration);
1104  return DB_ERROR_UNKNOWN;
1105  }
1106  }
1107  duration_cleanup(duration);
1108  duration = NULL;
1109  }
1110  else {
1111  ods_log_deeebug("[policy_*_from_xml] unknown %s", (char*)node3->name);
1112  return DB_ERROR_UNKNOWN;
1113  }
1114  }
1115  }
1116  else {
1117  ods_log_deeebug("[policy_*_from_xml] unknown %s", (char*)node2->name);
1118  return DB_ERROR_UNKNOWN;
1119  }
1120  }
1121  }
1122  else {
1123  ods_log_deeebug("[policy_*_from_xml] unknown %s", (char*)node->name);
1124  return DB_ERROR_UNKNOWN;
1125  }
1126  }
1127 
1128  if (xml_text) {
1129  xmlFree(xml_text);
1130  xml_text = NULL;
1131  }
1132  duration_cleanup(duration);
1133  duration = NULL;
1134 
1135  /*
1136  * If we did not find these XML elements we need to disable them
1137  */
1138  if (!denial_optout) {
1139  ods_log_deeebug("[policy_*_from_xml] - denial optout");
1140  if (check_if_updated) {
1141  update_this = 0;
1142  if (policy_denial_optout(policy)) {
1143  *updated = 1;
1144  update_this = 1;
1145  }
1146  }
1147  if (update_this) {
1148  if (policy_set_denial_optout(policy, 0)) {
1149  return DB_ERROR_UNKNOWN;
1150  }
1151  }
1152  }
1153  if (!keys_shared) {
1154  ods_log_deeebug("[policy_*_from_xml] - keys shared keys");
1155  if (check_if_updated) {
1156  update_this = 0;
1157  if (policy_keys_shared(policy)) {
1158  *updated = 1;
1159  update_this = 1;
1160  }
1161  }
1162  if (update_this) {
1163  if (policy_set_keys_shared(policy, 0)) {
1164  return DB_ERROR_UNKNOWN;
1165  }
1166  }
1167  }
1168  if (!signatures_max_zone_ttl) {
1169  ods_log_deeebug("[policy_*_from_xml] - signatures max zone ttl");
1170 
1171  if (policy_signatures_max_zone_ttl(policy) != 86400)
1172  {
1173  if (policy_set_signatures_max_zone_ttl(policy, 86400)) {
1174  return DB_ERROR_UNKNOWN;
1175  }
1176  if (check_if_updated) *updated = 1;
1177  }
1178  }
1179  if (!keys_purge) {
1180  ods_log_deeebug("[policy_*_from_xml] - keys purge");
1181  if (check_if_updated) {
1182  update_this = 0;
1183  if (policy_keys_purge_after(policy)) {
1184  *updated = 1;
1185  update_this = 1;
1186  }
1187  }
1188  if (update_this) {
1189  if (policy_set_keys_purge_after(policy, 0)) {
1190  return DB_ERROR_UNKNOWN;
1191  }
1192  }
1193  }
1194  if (!denial_ttl) {
1195  ods_log_deeebug("[policy_*_from_xml] - denial ttl");
1196  if (check_if_updated) {
1197  update_this = 0;
1198  if (policy_denial_ttl(policy)) {
1199  *updated = 1;
1200  update_this = 1;
1201  }
1202  }
1203  if (update_this) {
1204  if (policy_set_denial_ttl(policy, 0)) {
1205  return DB_ERROR_UNKNOWN;
1206  }
1207  }
1208  }
1209  /* Check if passtrough has toggled */
1210  if (passthrough != policy_passthrough(policy)) {
1211  ods_log_deeebug("[policy_*_from_xml] - passthrough set to %d",
1212  passthrough);
1213  if (check_if_updated)
1214  *updated = 1;
1215  if (policy_set_passthrough(policy, passthrough)) {
1216  return DB_ERROR_UNKNOWN;
1217  }
1218  }
1219 
1220  return DB_OK;
1221 }
1222 
1223 int policy_create_from_xml(policy_t* policy, xmlNodePtr policy_node) {
1224  if (!policy) {
1225  return DB_ERROR_UNKNOWN;
1226  }
1227  if (!policy_node) {
1228  return DB_ERROR_UNKNOWN;
1229  }
1230 
1231  return __xmlNode2policy(policy, policy_node, NULL);
1232 }
1233 
1234 int policy_update_from_xml(policy_t* policy, xmlNodePtr policy_node, int* updated) {
1235  if (!policy) {
1236  return DB_ERROR_UNKNOWN;
1237  }
1238  if (!policy_node) {
1239  return DB_ERROR_UNKNOWN;
1240  }
1241  if (!updated) {
1242  return DB_ERROR_UNKNOWN;
1243  }
1244 
1245  return __xmlNode2policy(policy, policy_node, updated);
1246 }
1247 
1249  if (!policy) {
1250  return NULL;
1251  }
1252  if (!policy->dbo) {
1253  return NULL;
1254  }
1255  if (db_value_not_empty(&(policy->id))) {
1256  return NULL;
1257  }
1258 
1260  &(policy->id));
1261 }
int policy_set_signatures_refresh(policy_t *policy, unsigned int signatures_refresh)
Definition: policy.c:1196
int policy_set_zone_soa_serial_text(policy_t *policy, const char *zone_soa_serial)
Definition: policy.c:1463
int policy_set_signatures_jitter(policy_t *policy, unsigned int signatures_jitter)
Definition: policy.c:1206
int policy_set_description(policy_t *policy, const char *description_text)
Definition: policy.c:1164
unsigned int policy_denial_resalt(const policy_t *policy)
Definition: policy.c:917
unsigned int policy_parent_registration_delay(const policy_t *policy)
Definition: policy.c:1045
int policy_set_signatures_inception_offset(policy_t *policy, unsigned int signatures_inception_offset)
Definition: policy.c:1216
#define DB_ERROR_UNKNOWN
Definition: db_error.h:40
const char * policy_name(const policy_t *policy)
Definition: policy.c:813
db_value_t id
Definition: policy.h:62
int policy_set_denial_ttl(policy_t *policy, unsigned int denial_ttl)
Definition: policy.c:1289
unsigned int policy_signatures_max_zone_ttl(const policy_t *policy)
Definition: policy.c:885
unsigned int policy_denial_algorithm(const policy_t *policy)
Definition: policy.c:925
unsigned int policy_signatures_refresh(const policy_t *policy)
Definition: policy.c:837
unsigned int policy_signatures_validity_default(const policy_t *policy)
Definition: policy.c:861
int policy_set_keys_retire_safety(policy_t *policy, unsigned int keys_retire_safety)
Definition: policy.c:1393
int policy_set_signatures_max_zone_ttl(policy_t *policy, unsigned int signatures_max_zone_ttl)
Definition: policy.c:1256
unsigned int policy_parent_propagation_delay(const policy_t *policy)
Definition: policy.c:1053
int policy_set_denial_type(policy_t *policy, policy_denial_type_t denial_type)
Definition: policy.c:1266
int policy_set_keys_shared(policy_t *policy, unsigned int keys_shared)
Definition: policy.c:1413
int db_value_not_empty(const db_value_t *value)
Definition: db_value.c:347
unsigned int policy_signatures_validity_denial(const policy_t *policy)
Definition: policy.c:869
const db_connection_t * db_object_connection(const db_object_t *object)
Definition: db_object.c:320
int policy_set_signatures_resign(policy_t *policy, unsigned int signatures_resign)
Definition: policy.c:1186
unsigned int policy_passthrough(const policy_t *policy)
Definition: policy.c:1085
int policy_set_parent_registration_delay(policy_t *policy, unsigned int parent_registration_delay)
Definition: policy.c:1480
unsigned int policy_signatures_jitter(const policy_t *policy)
Definition: policy.c:845
policy_denial_type
Definition: policy.h:40
int policy_update_from_xml(policy_t *policy, xmlNodePtr policy_node, int *updated)
Definition: policy_ext.c:1234
unsigned int policy_signatures_inception_offset(const policy_t *policy)
Definition: policy.c:853
int policy_set_parent_soa_minimum(policy_t *policy, unsigned int parent_soa_minimum)
Definition: policy.c:1520
unsigned int policy_zone_propagation_delay(const policy_t *policy)
Definition: policy.c:1005
unsigned int policy_denial_iterations(const policy_t *policy)
Definition: policy.c:933
int policy_set_keys_ttl(policy_t *policy, unsigned int keys_ttl)
Definition: policy.c:1383
int policy_set_signatures_validity_default(policy_t *policy, unsigned int signatures_validity_default)
Definition: policy.c:1226
unsigned int policy_zone_soa_ttl(const policy_t *policy)
Definition: policy.c:1013
unsigned int policy_keys_publish_safety(const policy_t *policy)
Definition: policy.c:981
int policy_set_keys_publish_safety(policy_t *policy, unsigned int keys_publish_safety)
Definition: policy.c:1403
policy_key_list_t * policy_get_policy_keys(const policy_t *policy)
Definition: policy_ext.c:1248
int policy_set_zone_soa_minimum(policy_t *policy, unsigned int zone_soa_minimum)
Definition: policy.c:1453
int policy_set_denial_salt_length(policy_t *policy, unsigned int denial_salt_length)
Definition: policy.c:1337
unsigned int policy_parent_ds_ttl(const policy_t *policy)
Definition: policy.c:1061
int policy_create_from_xml(policy_t *policy, xmlNodePtr policy_node)
Definition: policy_ext.c:1223
const char * policy_zone_soa_serial_text(const policy_t *policy)
Definition: policy.c:1029
unsigned int policy_denial_ttl(const policy_t *policy)
Definition: policy.c:909
int policy_set_zone_propagation_delay(policy_t *policy, unsigned int zone_propagation_delay)
Definition: policy.c:1433
int policy_set_parent_propagation_delay(policy_t *policy, unsigned int parent_propagation_delay)
Definition: policy.c:1490
unsigned int policy_parent_soa_minimum(const policy_t *policy)
Definition: policy.c:1077
unsigned int policy_denial_optout(const policy_t *policy)
Definition: policy.c:901
unsigned int policy_keys_retire_safety(const policy_t *policy)
Definition: policy.c:973
int policy_set_zone_soa_ttl(policy_t *policy, unsigned int zone_soa_ttl)
Definition: policy.c:1443
db_object_t * dbo
Definition: policy.h:61
const char * policy_description(const policy_t *policy)
Definition: policy.c:821
#define DB_OK
Definition: db_error.h:36
int policy_set_passthrough(policy_t *policy, unsigned int passthrough)
Definition: policy.c:1530
void ods_log_deeebug(const char *format,...)
Definition: log.c:34
int policy_set_name(policy_t *policy, const char *name_text)
Definition: policy.c:1142
Definition: policy.h:60
int policy_set_denial_iterations(policy_t *policy, unsigned int denial_iterations)
Definition: policy.c:1323
unsigned int policy_denial_salt_length(const policy_t *policy)
Definition: policy.c:941
unsigned int policy_parent_soa_ttl(const policy_t *policy)
Definition: policy.c:1069
int policy_set_denial_resalt(policy_t *policy, unsigned int denial_resalt)
Definition: policy.c:1299
unsigned int policy_signatures_validity_keyset(const policy_t *policy)
Definition: policy.c:877
unsigned int policy_keys_shared(const policy_t *policy)
Definition: policy.c:989
int policy_set_denial_algorithm(policy_t *policy, unsigned int denial_algorithm)
Definition: policy.c:1309
unsigned int policy_zone_soa_minimum(const policy_t *policy)
Definition: policy.c:1021
unsigned int policy_keys_purge_after(const policy_t *policy)
Definition: policy.c:997
int policy_set_signatures_validity_keyset(policy_t *policy, unsigned int signatures_validity_keyset)
Definition: policy.c:1246
int policy_set_denial_optout(policy_t *policy, unsigned int denial_optout)
Definition: policy.c:1279
policy_key_list_t * policy_key_list_new_get_by_policy_id(const db_connection_t *connection, const db_value_t *policy_id)
Definition: policy_key.c:1299
int policy_set_keys_purge_after(policy_t *policy, unsigned int keys_purge_after)
Definition: policy.c:1423
int policy_set_signatures_validity_denial(policy_t *policy, unsigned int signatures_validity_denial)
Definition: policy.c:1236
int policy_set_parent_ds_ttl(policy_t *policy, unsigned int parent_ds_ttl)
Definition: policy.c:1500
unsigned int policy_keys_ttl(const policy_t *policy)
Definition: policy.c:965
unsigned int policy_signatures_resign(const policy_t *policy)
Definition: policy.c:829
int policy_set_parent_soa_ttl(policy_t *policy, unsigned int parent_soa_ttl)
Definition: policy.c:1510