Lines Matching refs:dkp
137 static int create_parent_file (const char *fname, int phase, int ttl, const dki_t *dkp);
152 dki_t *dkp;
343 if ( (dkp = (dki_t*)zkt_search (data, searchtag, keyname)) == NULL )
345 else if ( dkp == (void *) 01 )
347 if ( (c = dki_setstatus_preservetime (dkp, action)) != 0 )
351 if ( (dkp = (dki_t *)zkt_search (data, searchtag, keyname)) == NULL )
353 else if ( dkp == (void *) 01 )
355 dki_remove (dkp);
358 if ( (dkp = (dki_t *)zkt_search (data, searchtag, keyname)) == NULL )
360 else if ( dkp == (void *) 01 )
362 dki_destroy (dkp);
365 if ( (dkp = (dki_t *)zkt_search (data, searchtag, keyname)) == NULL )
367 else if ( dkp == (void *) 01 )
369 if ( (c = dki_setstatus (dkp, action)) != 0 )
373 if ( (dkp = (dki_t *)zkt_search (data, searchtag, keyname)) == NULL )
375 else if ( dkp == (void *) 01 )
377 dki_prt_dnskey (dkp, stdout);
489 dki_t *dkp;
496 if ( pathflag && (dkp = (dki_t *)zkt_search (list, 0, keyname)) != NULL )
501 dir = dkp->dname;
512 dkp = dki_new (dir, keyname, DKI_ZSK, conf->k_algo, conf->z_bits, conf->z_random, conf->z_life / DAYSEC);
514 dkp = dki_new (dir, keyname, DKI_KSK, conf->k_algo, conf->k_bits, conf->k_random, conf->k_life / DAYSEC);
515 if ( dkp == NULL )
519 dki_setstatus (dkp, DKI_PUB);
544 dki_t *dkp;
592 dkp = keylist;
595 dir = dkp->dname;
618 for ( dkp = keylist; dkp; dkp = dkp->next )
619 if ( dki_isksk (dkp) )
621 if ( dki_status (dkp) == DKI_ACT )
623 else if ( dki_status (dkp) == DKI_PUB )
624 standby = dkp;
640 for ( dkp = keylist; dkp; dkp = dkp->next )
643 dki_prt_dnskey (dkp, stdout);
651 dkp = dki_new (dir, keyname, DKI_KSK, conf->k_algo, conf->k_bits, conf->k_random, conf->k_life / DAYSEC);
652 if ( dkp == NULL )
657 dki_setstatus (dkp, DKI_PUB); /* new key will be the new standby */
660 // dkp = keylist; /* use old key to create the parent file */
661 if ( (dkp = (dki_t *)dki_findalgo (keylist, 1, conf->k_algo, 'a', 1)) == NULL ) /* find the oldest active ksk to create the parent file */
663 if ( !create_parent_file (path, phase, key_ttl, dkp) )
680 dkp = keylist->next; /* set dkp to new ksk */
681 if ( !create_parent_file (path, phase, key_ttl, dkp) )
698 dkp = keylist; /* set dkp to old ksk */
699 dki_remove (dkp);
708 static int create_parent_file (const char *fname, int phase, int ttl, const dki_t *dkp)
714 if ( dkp == NULL || (phase != 1 && phase != 2) )
725 dki_prt_dnskeyttl (dkp, fp, ttl);
733 dki_t *dkp;
758 if ( (dkp = dki_read (dir, dentp->d_name)) )
760 // fprintf (stderr, "parsedir: tssearch (%d %s)\n", dkp, dkp->name);
762 dki_tadd (listp, dkp, 1);
764 dki_add (listp, dkp);
775 dki_t *dkp;
782 if ( (dkp = dki_read (path, file)) ) /* read DNS key file ... */
784 dki_tadd (listp, dkp, 1); /* ... and add to tree */
786 dki_add (listp, dkp); /* ... and add to list */