If I'd have to guess the encrypted buffer format in sasl_encode/sasl_decode should match what gss_wrap()/gss_unwrap() uses, and dlls/kerberos/unixlib.c,seal_message_no_vector()/ unseal_message_no_vector() already treats it like data+token. So, the other side of the wire sees a compatible encrypted buffer layout.