PAC Progress
Stefan (metze) Metzmacher
metze at samba.org
Mon Jul 4 09:43:18 GMT 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Stefan (metze) Metzmacher schrieb:
> Luke Howard schrieb:
>
>>>>I'm not sure it is worth the pidl mangling to 'peek into' that byte
>>>>buffer, and it is the management of that byte buffer that I'm having the
>>>>most trouble with. To me, it looks like the pointed-to BUFFERS on the
>>>>wire are padded behind to force the next structure to be 8 byte
>>>>aligned.
>>>
>>>
>>>Have you read the MSDN specification at:
>>>
>>>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnkerb/html/msdn_pac.asp
>>>
>>>It specifies that all buffer offsets are multiples of 8.
>
>
> yep, but that doesn't explain the padding to at the end of the last buffer,
> so this means that the buffersize should be also a multiple of 8 not only the offset
so we should maybe use something like this:
typedef [nodiscriminant,gensize,flag(NDR_ALIGN8)] union {
[case(PAC_TYPE_LOGON_INFO)] PAC_LOGON_INFO logon_info;
[case(PAC_TYPE_SRV_CHECKSUM)] PAC_SIGNATURE_DATA srv_cksum;
[case(PAC_TYPE_KDC_CHECKSUM)] PAC_SIGNATURE_DATA kdc_cksum;
[case(PAC_TYPE_LOGON_NAME)] PAC_LOGON_NAME logon_name;
} PAC_INFO;
typedef struct {
uint32 type;
[value(ndr_size_PAC_INFO_rounded(info,ndr->flags))] uint32 size;
[relative,switch_is(type),subcontext(0),subcontext_size(size)] PAC_INFO *info;
uint32 _pad; /* Top half of a 64 bit pointer? */
} PAC_BUFFER;
and a wrapper function like this
uint32_t ndr_size_PAC_INFO_rounded(struct PAC_INFO *info, uint32_t flags)
{
uint32_t s;
s = ndr_size_PAC_INFO(info, flags);
s = (s+7) & ~7;
return s;
}
- --
metze
Stefan Metzmacher <metze at samba.org> www.samba.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3-nr1 (Windows XP)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCyQS1m70gjA5TCD8RAtoRAJ4nx2/r6Ce1KP/sObaF0fOl0B8DWgCgjYWt
fQhrMkQbUP2QPgdXyi8sZ+8=
=hC0y
-----END PGP SIGNATURE-----
More information about the samba-technical
mailing list