summaryrefslogtreecommitdiff
path: root/lib/ZCkZAut.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ZCkZAut.c')
-rw-r--r--lib/ZCkZAut.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/ZCkZAut.c b/lib/ZCkZAut.c
index 19ec6d1..46e6472 100644
--- a/lib/ZCkZAut.c
+++ b/lib/ZCkZAut.c
@@ -103,9 +103,16 @@ Code_t ZCheckZcodeAuthentication(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 server/kstuff.c:ZCheckRealmAuthentication */
+ /* 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;