summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/ZCkAuth.c5
-rw-r--r--lib/ZFmtAuth.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/ZCkAuth.c b/lib/ZCkAuth.c
index 13d3077..becf408 100644
--- a/lib/ZCkAuth.c
+++ b/lib/ZCkAuth.c
@@ -71,11 +71,14 @@ int ZCheckAuthentication(notice, from)
__Zephyr_realm, &cred))
return (ZAUTH_NO);
+#ifdef NOENCRYPTION
+ our_checksum = 0;
+#else
our_checksum = (ZChecksum_t)quad_cksum(notice->z_packet, NULL,
notice->z_default_format+
strlen(notice->z_default_format)+1-
notice->z_packet, 0, cred.session);
-
+#endif
/* if mismatched checksum, then the packet was corrupted */
return ((our_checksum == notice->z_checksum) ? ZAUTH_YES : ZAUTH_FAILED);
diff --git a/lib/ZFmtAuth.c b/lib/ZFmtAuth.c
index 7698058..d0bf6c2 100644
--- a/lib/ZFmtAuth.c
+++ b/lib/ZFmtAuth.c
@@ -41,9 +41,12 @@ Code_t ZFormatAuthenticNotice(notice, buffer, buffer_len, len, session)
&hdrlen, &ptr)) != ZERR_NONE)
return (retval);
+#ifdef NOENCRYPTION
+ newnotice.z_checksum = 0;
+#else
newnotice.z_checksum = (ZChecksum_t)quad_cksum(buffer, NULL, ptr - buffer,
0, session);
-
+#endif
if ((retval = Z_FormatRawHeader(&newnotice, buffer, buffer_len,
&hdrlen, (char **) 0)) != ZERR_NONE)
return (retval);