CVE-2022-2031 lib:krb5_wrap: Generate valid error codes in smb_krb5_mk_error()
commit38c83abffd325ee23649c190b8ffb3d27a2bdb68
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Fri, 27 May 2022 07:29:34 +0000 (27 19:29 +1200)
committerJule Anger <janger@samba.org>
Sun, 24 Jul 2022 09:55:51 +0000 (24 11:55 +0200)
treeb9496a652840a78ee43935623b0cb1d9f2f55afb
parentb1003099c202d05b7d3f570fe313039aebdec3f9
CVE-2022-2031 lib:krb5_wrap: Generate valid error codes in smb_krb5_mk_error()

The error code passed in will be an offset from ERROR_TABLE_BASE_krb5,
so we need to subtract that before creating the error. Heimdal does this
internally, so it isn't needed there.

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>
lib/krb5_wrap/krb5_samba.c
selftest/knownfail_mit_kdc