CVE-2022-2031 s4:kpasswd: Add MIT fallback for decoding setpw structure
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Mon, 30 May 2022 07:17:41 +0000 (19:17 +1200)
committerJule Anger <janger@samba.org>
Sun, 24 Jul 2022 09:42:01 +0000 (11:42 +0200)
commitf6c5a60336de8fd67a2ef371dd2ee4cf75c53904
tree9527616a8fec7cfd7f3a04727caa03239584d26e
parent1b38a28bcaebdae0128518605a422a194747a60f
CVE-2022-2031 s4:kpasswd: Add MIT fallback for decoding setpw structure

The target principal and realm fields of the setpw structure are
supposed to be optional, but in MIT Kerberos they are mandatory. For
better compatibility and ease of testing, fall back to parsing the
simpler (containing only the new password) structure if the MIT function
fails to decode it.

Although the target principal and realm fields should be optional, one
is not supposed to specified without the other, so we don't have to deal
with the case where only one is specified.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15047
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15049
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15074

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
source4/kdc/kpasswd-service-mit.c