FreeBSD/contrib/ntp/ntpd/ntp_crypto.c
/*
 * crypto_update_taichange - eventually trigger crypto_update
 *
 * This is called when a change in 'sys_tai' is detected. This will
 * happen shortly after a leap second is detected, but unhappily also
 * early after system start; also, the crypto stuff might be unused and
 * an unguarded call to crypto_update() causes a crash.
 *
 * This function makes sure that there already *is* a valid crypto block
 * for the use with autokey, and only calls 'crypto_update()' if it can
 * succeed.
 *
 * Returns void (no errors)
 */
eventually trigger crypto_update
This is called when a change in 'sys_tai' is detected. This will
happen shortly after a leap second is detected, but unhappily also
early after system start; also, the crypto stuff might be unused and
an unguarded call to crypto_update() causes a crash.

This function makes sure that there already *is* a valid crypto block
for the use with autokey, and only calls 'crypto_update()' if it can
succeed.

Returns void (no errors)
eventually trigger crypto_update This is called when a change in ' sys_tai ' is detected . This will happen shortly after a leap second is detected but unhappily also early after system start ; also the crypto stuff might be unused and an unguarded call to crypto_update () causes a crash . This function makes sure that there already * is * a valid crypto block for the use with autokey and only calls ' crypto_update () ' if it can succeed . Returns void ( no errors )
void
crypto_update_taichange(void)
{
	static const u_int len = 3 * sizeof(u_int32);
	if (sign_digest == NULL || sign_pkey == NULL)
		return;
	if (tai_leap.ptr == NULL || ntohl(tai_leap.vallen) != len)
		return;
	crypto_update();
}
void crypto_update_taichange ( void ) { static const u_int len = 3 * sizeof ( u_int32 ) ; if ( sign_digest == NULL || sign_pkey == NULL ) return ; if ( tai_leap . ptr == NULL || ntohl ( tai_leap . vallen ) != len ) return ; crypto_update ( ) ; }
crypto_update_taichange - eventually trigger crypto_update
 This is called when a change in 'sys_tai' is detected.
crypto_update_taichange - eventually trigger crypto_update This is called when a change in ' sys_tai ' is detected .
/* check if the signing digest algo is available */ /* check size of TAI extension block */ /* crypto_update should at least not crash here! */