summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2004-08-12 18:43:35 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:57:56 -0500
commit425caa9b78e76d943988fcc53e1b2e38cdaa18be (patch)
treebc05fc3a8b44eacf93bbe903bc5f892298274b1d
parent71e149a8a3a25e5f10cd4896c46b32f55a5bbcc8 (diff)
downloadsamba-425caa9b78e76d943988fcc53e1b2e38cdaa18be.tar.gz
samba-425caa9b78e76d943988fcc53e1b2e38cdaa18be.tar.bz2
samba-425caa9b78e76d943988fcc53e1b2e38cdaa18be.zip
r1784: a few minor changes and debug the decoded PAC_DATA
metze (This used to be commit 250485b69fbdd494bfd6c69bae94662e24fb0117)
-rw-r--r--source4/libcli/auth/gensec_krb5.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/source4/libcli/auth/gensec_krb5.c b/source4/libcli/auth/gensec_krb5.c
index 260b256934..18053b5ded 100644
--- a/source4/libcli/auth/gensec_krb5.c
+++ b/source4/libcli/auth/gensec_krb5.c
@@ -96,9 +96,9 @@ NTSTATUS gensec_krb5_decode_pac(TALLOC_CTX *mem_ctx,
{
NTSTATUS status;
struct PAC_SIGNATURE_DATA srv_sig;
- uint8_t *srv_key = NULL;
+ struct PAC_SIGNATURE_DATA *srv_sig_ptr;
struct PAC_SIGNATURE_DATA kdc_sig;
- uint8_t *kdc_key = NULL;
+ struct PAC_SIGNATURE_DATA *kdc_sig_ptr;
struct PAC_LOGON_INFO *logon_info = NULL;
struct PAC_DATA pac_data;
DATA_BLOB tmp_blob;
@@ -111,6 +111,8 @@ NTSTATUS gensec_krb5_decode_pac(TALLOC_CTX *mem_ctx,
return status;
}
+ NDR_PRINT_DEBUG(PAC_DATA, &pac_data);
+
if (pac_data.num_buffers < 3) {
/* we need logon_ingo, service_key and kdc_key */
DEBUG(0,("less than 3 PAC buffers\n"));
@@ -129,14 +131,14 @@ NTSTATUS gensec_krb5_decode_pac(TALLOC_CTX *mem_ctx,
if (!pac_data.buffers[i].info) {
break;
}
- srv_key = (uint8_t *)&pac_data.buffers[i].info->srv_cksum.signature;
+ srv_sig_ptr = &pac_data.buffers[i].info->srv_cksum;
srv_sig = pac_data.buffers[i].info->srv_cksum;
break;
case PAC_TYPE_KDC_CHECKSUM:
if (!pac_data.buffers[i].info) {
break;
}
- kdc_key = (uint8_t *)&pac_data.buffers[i].info->kdc_cksum.signature;
+ kdc_sig_ptr = &pac_data.buffers[i].info->kdc_cksum;
kdc_sig = pac_data.buffers[i].info->kdc_cksum;
break;
case PAC_TYPE_UNKNOWN_10:
@@ -151,18 +153,18 @@ NTSTATUS gensec_krb5_decode_pac(TALLOC_CTX *mem_ctx,
return NT_STATUS_FOOBAR;
}
- if (!srv_key) {
+ if (!srv_sig_ptr) {
DEBUG(0,("PAC no srv_key\n"));
return NT_STATUS_FOOBAR;
}
- if (!kdc_key) {
+ if (!kdc_sig_ptr) {
DEBUG(0,("PAC no kdc_key\n"));
return NT_STATUS_FOOBAR;
}
/* clear the kdc_key */
- memset(kdc_key , '\0', 16);
+ memset((void *)kdc_sig_ptr , '\0', sizeof(*kdc_sig_ptr));
status = ndr_push_struct_blob(&tmp_blob, mem_ctx, &pac_data,
(ndr_push_flags_fn_t)ndr_push_PAC_DATA);
@@ -178,7 +180,7 @@ NTSTATUS gensec_krb5_decode_pac(TALLOC_CTX *mem_ctx,
}
/* clear the service_key */
- memset(srv_key , '\0', 16);
+ memset((void *)srv_sig_ptr , '\0', sizeof(*srv_sig_ptr));
status = ndr_push_struct_blob(&tmp_blob, mem_ctx, &pac_data,
(ndr_push_flags_fn_t)ndr_push_PAC_DATA);