FreeBSD/contrib/ntp/libntp/authkeys.c
/*
 * authistrustedip - determine if the IP is OK for the keyid
 */
determine if the IP is OK for the keyid
determine if the IP is OK for the keyid
int
 authistrustedip(
 	keyid_t		keyno,
	sockaddr_u *	sau
	)
{
	symkey *	sk;
	if (keyno == cache_keyid) {
		return (KEY_TRUSTED & cache_flags) &&
		    keyacc_contains(cache_keyacclist, sau, TRUE);
	} else {
		authkeyuncached++;
		sk = auth_findkey(keyno);
		INSIST(NULL != sk);
		return (KEY_TRUSTED & sk->flags) &&
		    keyacc_contains(sk->keyacclist, sau, TRUE);
	}
}
int authistrustedip ( keyid_t keyno , sockaddr_u * sau ) { symkey * sk ; if ( keyno == cache_keyid ) { return ( KEY_TRUSTED & cache_flags ) && keyacc_contains ( cache_keyacclist , sau , TRUE ) ; } else { authkeyuncached ++ ; sk = auth_findkey ( keyno ) ; INSIST ( NULL != sk ) ; return ( KEY_TRUSTED & sk -> flags ) && keyacc_contains ( sk -> keyacclist , sau , TRUE ) ; } }
authistrustedip - determine if the IP is OK for the keyid
authistrustedip - determine if the IP is OK for the keyid
/* That specific key was already used to authenticate the
	 * packet. Therefore, the key *must* exist...  There's a chance
	 * that is not trusted, though.
	 */