Mon, 23 Nov 2020 01:41:50 -0600
Delete a bunch of unused zephyr stuff
* Remove unused `ZSetFD`.
* Remove `__HM_set` which is never read.
* Remove `__Zephyr_open` global, which is redundant with `__Zephyr_fd != -1`.
* Remove `ZSetSrv.c`, as `ZSetServerState` is never called.
Consequently, remove `__Zephyr_server` global and all things that check it as it will never be TRUE.
* Remove zephyr internal debug code, as `ZSetDebug` is never called.
Also, make a couple debug messages go to libpurple.
* Remove unused `ZNewLocateUser` compatibility macro.
Testing Done:
Compile only.
Reviewed at https://reviews.imfreedom.org/r/249/
| 2086 | 1 | /* This file is part of the Project Athena Zephyr Notification System. |
| 2 | * It contains source for the ZCheckAuthentication function. | |
| 3 | * | |
| 4 | * Created by: Robert French | |
| 5 | * | |
| 6 | * Copyright (c) 1987,1991 by the Massachusetts Institute of Technology. | |
| 7 | * For copying and distribution information, see the file | |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
8 | * "mit-copyright.h". |
| 2086 | 9 | */ |
| 10 | ||
|
8791
655f64e6d1e2
[gaim-migrate @ 9553]
Christian Hammond <chipx86@chipx86.com>
parents:
8354
diff
changeset
|
11 | #include "internal.h" |
| 2086 | 12 | |
| 13 | /* Check authentication of the notice. | |
| 14 | If it looks authentic but fails the Kerberos check, return -1. | |
| 15 | If it looks authentic and passes the Kerberos check, return 1. | |
| 16 | If it doesn't look authentic, return 0 | |
| 17 | ||
| 18 | When not using Kerberos, return true if the notice claims to be authentic. | |
| 19 | */ | |
|
40166
811f82db29dd
zephyr: Modernize K&R function prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
20 | Code_t |
|
811f82db29dd
zephyr: Modernize K&R function prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
21 | ZCheckAuthentication(ZNotice_t *notice, struct sockaddr_in *from) |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
22 | { |
| 2086 | 23 | #ifdef ZEPHYR_USES_KERBEROS |
| 24 | int result; | |
| 25 | ZChecksum_t our_checksum; | |
| 26 | CREDENTIALS cred; | |
| 27 | ||
| 28 | /* If the value is already known, return it. */ | |
| 29 | if (notice->z_checked_auth != ZAUTH_UNSET) | |
| 30 | return (notice->z_checked_auth); | |
| 31 | ||
| 32 | if (!notice->z_auth) | |
| 33 | return (ZAUTH_NO); | |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
34 | |
|
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
35 | if ((result = krb_get_cred(SERVER_SERVICE, SERVER_INSTANCE, |
| 2086 | 36 | __Zephyr_realm, &cred)) != 0) |
| 37 | return (ZAUTH_NO); | |
| 38 | ||
| 39 | #ifdef NOENCRYPTION | |
| 40 | our_checksum = 0; | |
| 41 | #else | |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
42 | our_checksum = des_quad_cksum(notice->z_packet, NULL, |
| 2086 | 43 | notice->z_default_format+ |
| 44 | strlen(notice->z_default_format)+1- | |
| 8354 | 45 | notice->z_packet, 0, (C_Block *)cred.session); |
| 2086 | 46 | #endif |
| 47 | /* if mismatched checksum, then the packet was corrupted */ | |
| 48 | return ((our_checksum == notice->z_checksum) ? ZAUTH_YES : ZAUTH_FAILED); | |
| 49 | ||
| 50 | #else | |
| 51 | return (notice->z_auth ? ZAUTH_YES : ZAUTH_NO); | |
| 52 | #endif | |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
53 | } |