summaryrefslogtreecommitdiff
path: root/server/kstuff.c
diff options
context:
space:
mode:
authorGravatar Karl Ramm <kcr@1ts.org>2009-04-03 03:52:36 +0000
committerGravatar Karl Ramm <kcr@1ts.org>2009-04-03 03:52:36 +0000
commit5fd7d4c62f9028489eede7b41e27fee96f0a3432 (patch)
tree3297842db3512c92cde5ac523dae6af9ce484027 /server/kstuff.c
parent0371c85f2661c041bedc1a9ab21acace224b302e (diff)
fix yet another instance of the checksum computation
Diffstat (limited to 'server/kstuff.c')
-rw-r--r--server/kstuff.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/server/kstuff.c b/server/kstuff.c
index 3a013e1..4ad951d 100644
--- a/server/kstuff.c
+++ b/server/kstuff.c
@@ -440,7 +440,7 @@ ZCheckRealmAuthentication(ZNotice_t *notice,
if (notice->z_num_other_fields)
x = notice->z_other_fields[notice->z_num_other_fields - 1];
else {
- /* see also lib/ZCkZaut.c:ZCheckZcodeAuthentication */
+ /* see also ZCheckAuthentication and lib/ZCkZaut.c:ZCheckZcodeAuthentication */
/* XXXXXXXXXXXXXXXXXXXXXXX */
x = cksum1_base + strlen(cksum1_base) + 1; /* multinotice */
if (notice->z_num_hdr_fields > 17)
@@ -730,9 +730,16 @@ ZCheckAuthentication(ZNotice_t *notice,
cksum1_base = notice->z_multinotice;
if (notice->z_num_other_fields)
x = notice->z_other_fields[notice->z_num_other_fields - 1];
- else
- x = cksum1_base + strlen(cksum1_base) + 1; /* multiuid */
- cksum1_len = x + strlen(x) + 1 - cksum1_base;
+ else {
+ /* see also ZCheckRealmAuthentication and lib/ZCkZaut.c:ZCheckZcodeAuthentication */
+ /* XXXXXXXXXXXXXXXXXXXXXXX */
+ x = cksum1_base + strlen(cksum1_base) + 1; /* multinotice */
+ if (notice->z_num_hdr_fields > 17)
+ x = x + strlen(x) + 1; /* multiuid */
+ if (notice->z_num_hdr_fields > 18)
+ x = x + strlen(x) + 1; /* sender */
+ }
+ cksum1_len = x + strlen(x) + 1 - cksum1_base; /* charset / extra field */
/* last part is the message body */
cksum2_base = notice->z_message;