summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorJoseph Sutton <josephsutton@catalyst.net.nz>2021-08-11 13:27:11 +1200
committerAndrew Bartlett <abartlet@samba.org>2021-10-14 18:59:31 +0000
commit28a5a586c8e9cd155d676dcfcb81a2587ace99d1 (patch)
tree86b9eb08c4d7f62f3c8e0330d03c5083c3ecb4c3 /source4
parent91e684f5dcb48b76e6a322c15acb53cbce5c275a (diff)
downloadsamba-28a5a586c8e9cd155d676dcfcb81a2587ace99d1.tar.gz
s4/heimdal/lib/krb5/pac.c: Align PAC buffers to match Windows
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14642 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4')
-rw-r--r--source4/heimdal/lib/krb5/pac.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/source4/heimdal/lib/krb5/pac.c b/source4/heimdal/lib/krb5/pac.c
index 3e45125d35e..6535a9bdcc4 100644
--- a/source4/heimdal/lib/krb5/pac.c
+++ b/source4/heimdal/lib/krb5/pac.c
@@ -62,10 +62,12 @@ struct krb5_pac_data {
#define PACTYPE_SIZE 8
#define PAC_INFO_BUFFER_SIZE 16
+#define PAC_LOGON_INFO 1
#define PAC_SERVER_CHECKSUM 6
#define PAC_PRIVSVR_CHECKSUM 7
#define PAC_LOGON_NAME 10
#define PAC_CONSTRAINED_DELEGATION 11
+#define PAC_UPN_DNS_INFO 12
#define PAC_TICKET_CHECKSUM 16
#define CHECK(r,f,l) \
@@ -1184,7 +1186,17 @@ _krb5_pac_sign(krb5_context context,
ret = krb5_enomem(context);
goto out;
}
- /* XXX if not aligned, fill_zeros */
+
+ if (p->pac->buffers[i].type == PAC_LOGON_INFO
+ || p->pac->buffers[i].type == PAC_UPN_DNS_INFO)
+ {
+ uint32_t rounded = (len + PAC_ALIGNMENT - 1) / PAC_ALIGNMENT
+ * PAC_ALIGNMENT;
+ uint32_t remaining = rounded - len;
+ CHECK(ret, fill_zeros(context, spdata, remaining), out);
+
+ len = rounded;
+ }
}
/* write header */