pygensec: Don't modify Python bytes objects
commit11cf625557351bd2bc73d8d858d2817f5fe680b6
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Mon, 19 Jul 2021 22:48:41 +0000 (20 10:48 +1200)
committerJule Anger <janger@samba.org>
Thu, 16 Sep 2021 08:07:12 +0000 (16 08:07 +0000)
tree2744895d2dee7adc9d68a2e4013d17c975b33cc1
parent52898d56abb0ec7ce29d9a03d0220fe887eeae1f
pygensec: Don't modify Python bytes objects

gensec_update() and gensec_unwrap() can both modify their input buffers
(for example, during the inplace RRC operation on GSSAPI tokens).
However, buffers obtained from Python bytes objects must not be modified
in any way. Create a copy of the input buffer so the original isn't
modified.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14817
(cherry picked from commit 6818d204897d0b7946dcfbedf79cd53fb9b3f159)
source4/auth/gensec/gensec_gssapi.c
source4/auth/gensec/pygensec.c