#if !defined(lint) && !defined(__INSIGHT__)
static char sos__rcsid[] = "bathos.c,v 1.1.1.1 1995/06/16 21:10:49 seth Exp";
static char sos__copyright[] = "Copyright (c) 1994, 1995 SOS Corporation";
static char sos__contact[] = "SOS Corporation <sos-info@soscorp.com> +1 800 SOS UNIX";
#endif /* not lint */

/*
 * ++Copyright Released Product++
 *
 * Copyright (c) 1994, 1995 Sources of Supply Corporation ("SOS").
 * All rights reserved.
 *
 * The SOS Released Product License Agreement specifies the terms and
 * conditions for redistribution.  You may find the License Agreement
 * in the file LICENSE.
 *
 * SOS Corporation
 * 461 5th Ave.; 16th floor
 * New York, NY 10017
 *
 * +1 800 SOS UNIX
 * <sos-info@soscorp.com>
 *
 * --Copyright Released Product--
 */

/*
 * External entry points for core Brimstone functions
 */

#include "sos.h"
#include "interface.h"


/*
 * External symbols for user's fun and enjoyment.
 */
int	bs_debug=0;
char	bs_auth_extended[EXTENDED_SIZE];



/*
 * Generate a fake challenge that looks impressive
 * (and is also identical to DHASH authentication type)
 */
int
BS_GenDefChallenge(char *buf, int bufsize)
{
  unsigned char dynamic_challenge[8];

  if (bufsize < 48)
    {
      sprintf(bs_auth_extended,"Supplied challenge buffer is too small (%d)",bufsize);
      return(BS_LOSE);
    }

  /* Overkill?  :-) */
  sos_get_rand(dynamic_challenge, sizeof(dynamic_challenge));

  sprintf(buf,"Challenge: %08X %08X",*((int *)(&(dynamic_challenge[0]))),*((int *)(&(dynamic_challenge[4]))));

  return(BS_WIN);
}
