1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
/* This file is part of the Project Athena Zephyr Notification System.
* It contains source for the ZFormatAuthenticNotice function.
*
* Created by: Robert French
*
* $Source$
* $Author$
*
* Copyright (c) 1987,1988 by the Massachusetts Institute of Technology.
* For copying and distribution information, see the file
* "mit-copyright.h".
*/
/* $Header$ */
#ifndef lint
static char rcsid_ZFormatAuthenticNotice_c[] = "$Header$";
#endif
#include <zephyr/mit-copyright.h>
#include <zephyr/zephyr_internal.h>
#ifdef KERBEROS
Code_t ZFormatAuthenticNotice(notice, buffer, buffer_len, len, session)
ZNotice_t *notice;
register char *buffer;
register int buffer_len;
int *len;
C_Block session;
{
ZNotice_t newnotice;
char *ptr;
int retval, hdrlen;
newnotice = *notice;
newnotice.z_auth = 1;
newnotice.z_authent_len = 0;
newnotice.z_ascii_authent = "";
if ((retval = Z_FormatRawHeader(&newnotice, buffer, buffer_len,
&hdrlen, &ptr)) != ZERR_NONE)
return (retval);
#ifdef NOENCRYPTION
newnotice.z_checksum = 0;
#else
newnotice.z_checksum = (ZChecksum_t)des_quad_cksum(buffer, NULL,
ptr - buffer, 0,
session);
#endif
if ((retval = Z_FormatRawHeader(&newnotice, buffer, buffer_len,
&hdrlen, (char **) 0)) != ZERR_NONE)
return (retval);
ptr = buffer+hdrlen;
if (newnotice.z_message_len+hdrlen > buffer_len)
return (ZERR_PKTLEN);
bcopy(newnotice.z_message, ptr, newnotice.z_message_len);
*len = hdrlen+newnotice.z_message_len;
if (*len > Z_MAXPKTLEN)
return (ZERR_PKTLEN);
return (ZERR_NONE);
}
#endif
|