From 5fd7d4c62f9028489eede7b41e27fee96f0a3432 Mon Sep 17 00:00:00 2001 From: Karl Ramm Date: Fri, 3 Apr 2009 03:52:36 +0000 Subject: fix yet another instance of the checksum computation --- server/kstuff.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'server/kstuff.c') 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; -- cgit v1.2.3