Lines Matching refs:dkp
125 static int create_parent_file (const char *fname, int phase, int ttl, const dki_t *dkp);
137 dki_t *dkp;
287 if ( (dkp = (dki_t*)zkt_search (data, searchtag, keyname)) == NULL )
289 else if ( dkp == (void *) 01 )
291 if ( (c = dki_setstatus_preservetime (dkp, action)) != 0 )
295 if ( (dkp = (dki_t *)zkt_search (data, searchtag, keyname)) == NULL )
297 else if ( dkp == (void *) 01 )
299 dki_remove (dkp);
302 if ( (dkp = (dki_t *)zkt_search (data, searchtag, keyname)) == NULL )
304 else if ( dkp == (void *) 01 )
306 dki_destroy (dkp);
309 if ( (dkp = (dki_t *)zkt_search (data, searchtag, keyname)) == NULL )
311 else if ( dkp == (void *) 01 )
313 if ( (c = dki_setstatus (dkp, action)) != 0 )
396 dki_t *dkp;
403 if ( pathflag && (dkp = (dki_t *)zkt_search (list, 0, keyname)) != NULL )
408 dir = dkp->dname;
419 dkp = dki_new (dir, keyname, DKI_ZSK, conf->k_algo, conf->z_bits, conf->z_random, conf->z_life / DAYSEC);
421 dkp = dki_new (dir, keyname, DKI_KSK, conf->k_algo, conf->k_bits, conf->k_random, conf->k_life / DAYSEC);
422 if ( dkp == NULL )
426 dki_setstatus (dkp, DKI_PUB);
451 dki_t *dkp;
499 dkp = keylist;
502 dir = dkp->dname;
525 for ( dkp = keylist; dkp; dkp = dkp->next )
526 if ( dki_isksk (dkp) )
528 if ( dki_status (dkp) == DKI_ACT )
530 else if ( dki_status (dkp) == DKI_PUB )
531 standby = dkp;
547 for ( dkp = keylist; dkp; dkp = dkp->next )
550 dki_prt_dnskey (dkp, stdout);
558 dkp = dki_new (dir, keyname, DKI_KSK, conf->k_algo, conf->k_bits, conf->k_random, conf->k_life / DAYSEC);
559 if ( dkp == NULL )
564 dki_setstatus (dkp, DKI_PUB); /* new key will be the new standby */
567 // dkp = keylist; /* use old key to create the parent file */
568 if ( (dkp = (dki_t *)dki_findalgo (keylist, 1, conf->k_algo, 'a', 1)) == NULL ) /* find the oldest active ksk to create the parent file */
570 if ( !create_parent_file (path, phase, key_ttl, dkp) )
587 dkp = keylist->next; /* set dkp to new ksk */
588 if ( !create_parent_file (path, phase, key_ttl, dkp) )
605 dkp = keylist; /* set dkp to old ksk */
606 dki_remove (dkp);
615 static int create_parent_file (const char *fname, int phase, int ttl, const dki_t *dkp)
621 if ( dkp == NULL || (phase != 1 && phase != 2) )
632 dki_prt_dnskeyttl (dkp, fp, ttl);
640 dki_t *dkp;
665 if ( (dkp = dki_read (dir, dentp->d_name)) )
667 // fprintf (stderr, "parsedir: tssearch (%d %s)\n", dkp, dkp->name);
669 dki_tadd (listp, dkp, 1);
671 dki_add (listp, dkp);
682 dki_t *dkp;
689 if ( (dkp = dki_read (path, file)) ) /* read DNS key file ... */
691 dki_tadd (listp, dkp, 1); /* ... and add to tree */
693 dki_add (listp, dkp); /* ... and add to list */