FreeBSD/contrib/ntp/ntpd/ntp_crypto.c
/*
 * crypto_config - configure data from the crypto command.
 */
configure data from the crypto command.
configure data from the crypto command .
void
crypto_config(
	int	item,		
	char	*cp		
	)
{
	int	nid;
	DPRINTF(1, ("crypto_config: item %d %s\n", item, cp));
	switch (item) {
	case CRYPTO_CONF_PRIV:
		if (NULL != host_filename)
			free(host_filename);
		host_filename = estrdup(cp);
		break;
	case CRYPTO_CONF_IDENT:
		if (NULL != ident_filename)
			free(ident_filename);
		ident_filename = estrdup(cp);
		break;
	case CRYPTO_CONF_PW:
		if (NULL != passwd)
			free(passwd);
		passwd = estrdup(cp);
		break;
	case CRYPTO_CONF_RAND:
		if (NULL != rand_file)
			free(rand_file);
		rand_file = estrdup(cp);
		break;
	case CRYPTO_CONF_NID:
		nid = OBJ_sn2nid(cp);
		if (nid == 0)
			msyslog(LOG_ERR,
			    "crypto_config: invalid digest name %s", cp);
		else
			crypto_nid = nid;
		break;
	}
}
void crypto_config ( int item , char * cp ) { int nid ; DPRINTF ( 1 , ( " \n " , item , cp ) ) ; switch ( item ) { case CRYPTO_CONF_PRIV : if ( NULL != host_filename ) free ( host_filename ) ; host_filename = estrdup ( cp ) ; break ; case CRYPTO_CONF_IDENT : if ( NULL != ident_filename ) free ( ident_filename ) ; ident_filename = estrdup ( cp ) ; break ; case CRYPTO_CONF_PW : if ( NULL != passwd ) free ( passwd ) ; passwd = estrdup ( cp ) ; break ; case CRYPTO_CONF_RAND : if ( NULL != rand_file ) free ( rand_file ) ; rand_file = estrdup ( cp ) ; break ; case CRYPTO_CONF_NID : nid = OBJ_sn2nid ( cp ) ; if ( nid == 0 ) msyslog ( LOG_ERR , " " , cp ) ; else crypto_nid = nid ; break ; } }
crypto_config - configure data from the crypto command.
crypto_config - configure data from the crypto command .
/* configuration item */ /* item name */ /*
	 * Set host name (host).
	 */ /*
	 * Set group name (ident).
	 */ /*
	 * Set private key password (pw).
	 */ /*
	 * Set random seed file name (randfile).
	 */ /*
	 * Set message digest NID.
	 */