summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Jeffrey Hutzelman <jhutz@cmu.edu>2013-02-16 23:02:36 -0500
committerGravatar Karl Ramm <kcr@1ts.org>2013-02-16 23:15:48 -0500
commit9ec3d325048ab72c6f6e037820e33aa8538b7b51 (patch)
tree0b0d9360d4bb6087be3a178e31cc233b3c48f148 /lib
parent3a81b9732b089c7431013d02a99c911b9241e6ca (diff)
Don't try to checksum with NULL creds
If we have no Kerberos credentials, we cannot create a checksum. This can happen if, for example, we end up with an expired TGT. In this case, instead of crashing, just leave the zero checksum. This fixes #80
Diffstat (limited to 'lib')
-rw-r--r--lib/ZMkAuth.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ZMkAuth.c b/lib/ZMkAuth.c
index 8989481..8d7ea0c 100644
--- a/lib/ZMkAuth.c
+++ b/lib/ZMkAuth.c
@@ -123,7 +123,7 @@ ZMakeZcodeRealmAuthentication(register ZNotice_t *notice,
krb5_auth_context authctx;
krb5_data *authent;
char *cksum_start, *cstart, *cend;
- int cksum_len, zcode_len = 0, phdr_adj;
+ int cksum_len, zcode_len = 0, phdr_adj = 0;
notice->z_ascii_authent = NULL;
@@ -167,7 +167,7 @@ ZMakeZcodeRealmAuthentication(register ZNotice_t *notice,
result = Z_NewFormatRawHeader(notice, buffer, buffer_len, phdr_len,
&cksum_start, &cksum_len, &cstart, &cend);
notice->z_authent_len = 0;
- if (!result)
+ if (!result && creds != NULL)
result = Z_InsertZcodeChecksum(keyblock, notice, buffer, cksum_start,
cksum_len, cstart, cend, buffer_len,
&phdr_adj, 0);