diff options
author | Robert S. French <rfrench@mit.edu> | 1988-05-17 17:21:01 +0000 |
---|---|---|
committer | Robert S. French <rfrench@mit.edu> | 1988-05-17 17:21:01 +0000 |
commit | 031ec0f258f152c1e20905b381aa7f5974db1f3d (patch) | |
tree | 1c15619ec8a5192e2d5095c6efde5e9a47ddc7ce /lib/ZMkAuth.c | |
parent | 4d21b4b5da809cdf4499190a1e27bff679a90422 (diff) |
All sorts of changes for ver 0.2
Diffstat (limited to 'lib/ZMkAuth.c')
-rw-r--r-- | lib/ZMkAuth.c | 59 |
1 files changed, 32 insertions, 27 deletions
diff --git a/lib/ZMkAuth.c b/lib/ZMkAuth.c index 136b37f..0b7901b 100644 --- a/lib/ZMkAuth.c +++ b/lib/ZMkAuth.c @@ -1,5 +1,5 @@ /* This file is part of the Project Athena Zephyr Notification System. - * It contains source for the internal Zephyr routines. + * It contains source for the ZMakeAuthentication function. * * Created by: Robert French * @@ -20,34 +20,39 @@ static char rcsid_ZMakeAuthentication_c[] = "$Header$"; #include <zephyr/zephyr_internal.h> -Code_t ZMakeAuthentication(notice,buffer,buffer_len,len) - ZNotice_t *notice; - ZPacket_t buffer; - int buffer_len; - int *len; +Code_t ZMakeAuthentication(notice, buffer, buffer_len, len) + ZNotice_t *notice; + char *buffer; + int buffer_len; + int *len; { - int retval,result; - KTEXT_ST authent; +#ifdef KERBEROS + int retval, result; + KTEXT_ST authent; - notice->z_auth = 1; - if ((result = mk_ap_req(&authent,SERVER_SERVICE, - SERVER_INSTANCE,__Zephyr_realm,0)) - != MK_AP_OK) - return (result+krb_err_base); - notice->z_authent_len = authent.length; - notice->z_ascii_authent = (char *)malloc((unsigned)authent.length*3); - if (!notice->z_ascii_authent) - return (ENOMEM); - if ((retval = ZMakeAscii(notice->z_ascii_authent, - authent.length*3, - authent.dat, - authent.length)) != ZERR_NONE) { - free(notice->z_ascii_authent); - return (retval); - } - retval = Z_FormatRawHeader(notice,buffer,buffer_len,len); + notice->z_auth = 1; + if ((result = krb_mk_req(&authent, SERVER_SERVICE, + SERVER_INSTANCE, __Zephyr_realm, 0)) + != MK_AP_OK) + return (result+krb_err_base); + notice->z_authent_len = authent.length; + notice->z_ascii_authent = (char *)malloc((unsigned)authent.length*3); + if (!notice->z_ascii_authent) + return (ENOMEM); + if ((retval = ZMakeAscii(notice->z_ascii_authent, + authent.length*3, + authent.dat, + authent.length)) != ZERR_NONE) { free(notice->z_ascii_authent); - notice->z_authent_len = 0; - return (retval); + } + retval = Z_FormatRawHeader(notice, buffer, buffer_len, len); + free(notice->z_ascii_authent); + notice->z_authent_len = 0; + + return (retval); +#else + notice->z_authent_len = 0; + return (Z_FormatRawHeader(notice, buffer, buffer_len, len)); +#endif } |