FreeBSD/contrib/ntp/libntp/authkeys.c
/*
 * auth_delkeys - delete non-autokey untrusted keys, and clear all info
 *                except the trusted bit of non-autokey trusted keys, in
 *		  preparation for rereading the keys file.
 */
delete non-autokey untrusted keys, and clear all info
except the trusted bit of non-autokey trusted keys, in
preparation for rereading the keys file.
delete non - autokey untrusted keys and clear all info except the trusted bit of non - autokey trusted keys in preparation for rereading the keys file .
void
auth_delkeys(void)
{
	symkey *	sk;
	ITER_DLIST_BEGIN(key_listhead, sk, llink, symkey)
		if (sk->keyid > NTP_MAXKEY) {	
			continue;
		}
		if (KEY_TRUSTED & sk->flags) {
			if (sk->secret != NULL) {
				memset(sk->secret, 0, sk->secretsize);
				free(sk->secret);
				sk->secret = NULL; 
			}
			sk->keyacclist = keyacc_all_free(sk->keyacclist);
			sk->secretsize = 0;
			sk->lifetime = 0;
		} else {
			freesymkey(sk);
		}
	ITER_DLIST_END()
}
void auth_delkeys ( void ) { symkey * sk ; ITER_DLIST_BEGIN ( key_listhead , sk , llink , symkey ) if ( sk -> keyid > NTP_MAXKEY ) { continue ; } if ( KEY_TRUSTED & sk -> flags ) { if ( sk -> secret != NULL ) { memset ( sk -> secret , 0 , sk -> secretsize ) ; free ( sk -> secret ) ; sk -> secret = NULL ; } sk -> keyacclist = keyacc_all_free ( sk -> keyacclist ) ; sk -> secretsize = 0 ; sk -> lifetime = 0 ; } else { freesymkey ( sk ) ; } ITER_DLIST_END ( ) }
auth_delkeys - delete non-autokey untrusted keys, and clear all info
                except the trusted bit of non-autokey trusted keys, in
                preparation for rereading the keys file.
auth_delkeys - delete non - autokey untrusted keys and clear all info except the trusted bit of non - autokey trusted keys in preparation for rereading the keys file .
/* autokey */ /*
		 * Don't lose info as to which keys are trusted. Make
		 * sure there are no dangling pointers!
		 */ /* TALOS-CAN-0054 */