contrib/ldns/dnssec_sign.c
static void
ldns_key_list_filter_for_non_dnskey(ldns_key_list *key_list)
{
	int saw_zsk = 0;
	size_t i;
	for(i=0; i<ldns_key_list_key_count(key_list); i++)
		if(!(ldns_key_flags(ldns_key_list_key(key_list, i))&LDNS_KEY_SEP_KEY)) {
			saw_zsk = 1;
			break;
		}
	if(!saw_zsk)
		return;
	/* else filter all KSKs */
	for(i=0; i<ldns_key_list_key_count(key_list); i++)
		if((ldns_key_flags(ldns_key_list_key(key_list, i))&LDNS_KEY_SEP_KEY))
			ldns_key_set_use(ldns_key_list_key(key_list, i), 0);
}
/** If there are no ZSKs use KSK as ZSK */
If there are no ZSKs use KSK as ZSK
If there are no ZSKs use KSK as ZSK
static void
ldns_key_list_filter_for_non_dnskey(ldns_key_list *key_list)
{
	int saw_zsk = 0;
	size_t i;
	for(i=0; i<ldns_key_list_key_count(key_list); i++)
		if(!(ldns_key_flags(ldns_key_list_key(key_list, i))&LDNS_KEY_SEP_KEY)) {
			saw_zsk = 1;
			break;
		}
	if(!saw_zsk)
		return;
	for(i=0; i<ldns_key_list_key_count(key_list); i++)
		if((ldns_key_flags(ldns_key_list_key(key_list, i))&LDNS_KEY_SEP_KEY))
			ldns_key_set_use(ldns_key_list_key(key_list, i), 0);
}
static void ldns_key_list_filter_for_non_dnskey ( ldns_key_list * key_list ) { int saw_zsk = 0 ; size_t i ; for ( i = 0 ; i < ldns_key_list_key_count ( key_list ) ; i ++ ) if ( ! ( ldns_key_flags ( ldns_key_list_key ( key_list , i ) ) & LDNS_KEY_SEP_KEY ) ) { saw_zsk = 1 ; break ; } if ( ! saw_zsk ) return ; for ( i = 0 ; i < ldns_key_list_key_count ( key_list ) ; i ++ ) if ( ( ldns_key_flags ( ldns_key_list_key ( key_list , i ) ) & LDNS_KEY_SEP_KEY ) ) ldns_key_set_use ( ldns_key_list_key ( key_list , i ) , 0 ) ; }
If there are no ZSKs use KSK as ZSK
If there are no ZSKs use KSK as ZSK
/* else filter all KSKs */