1 /* This file is part of the Project Athena Zephyr Notification System.
2 * It contains source for the ZFormatAuthenticNotice function.
4 * Created by: Robert French
6 * $Id: ZFmtAuth.c,v 1.20 1999/01/22 23:19:06 ghudson Exp $
8 * Copyright (c) 1987,1988 by the Massachusetts Institute of Technology.
9 * For copying and distribution information, see the file
14 static char rcsid_ZFormatAuthenticNotice_c[] = "$Id: ZFmtAuth.c,v 1.20 1999/01/22 23:19:06 ghudson Exp $";
20 Code_t ZFormatAuthenticNotice(notice, buffer, buffer_len, len, session)
22 register char *buffer;
23 register int buffer_len;
33 newnotice.z_authent_len = 0;
34 newnotice.z_ascii_authent = "";
36 if ((retval = Z_FormatRawHeader(&newnotice, buffer, buffer_len,
37 &hdrlen, &ptr, NULL)) != ZERR_NONE)
41 newnotice.z_checksum = 0;
43 newnotice.z_checksum =
44 (ZChecksum_t)des_quad_cksum(buffer, NULL, ptr - buffer, 0, session);
46 if ((retval = Z_FormatRawHeader(&newnotice, buffer, buffer_len,
47 &hdrlen, NULL, NULL)) != ZERR_NONE)
52 if (newnotice.z_message_len+hdrlen > buffer_len)
55 (void) memcpy(ptr, newnotice.z_message, newnotice.z_message_len);
57 *len = hdrlen+newnotice.z_message_len;
59 if (*len > Z_MAXPKTLEN)