]> git.ipfire.org Git - thirdparty/krb5.git/commit
Make k5buf more flexible for binary data
authorGreg Hudson <ghudson@mit.edu>
Mon, 13 Mar 2023 21:42:50 +0000 (17:42 -0400)
committerGreg Hudson <ghudson@mit.edu>
Fri, 24 Mar 2023 18:45:58 +0000 (14:45 -0400)
commitfc1ad91f68a06dfc9b082897120985d45438fa9f
tree21762c8bdeef858858cbf43946e5ae4c78810c54
parentceb0d82f0a9f69615ca4f5ff3bbf92af17f610ac
Make k5buf more flexible for binary data

Remove the invariant that buf.data is always zero-terminated, to allow
marshalling of binary data into precisely allocated fixed regions.
Add k5_buf_cstring() to zero-terminate the buffer and retrieve the
data pointer.  Adjust all callers that build C strings appropriately.

Add a k5_buf_add_byte() convenience wrapper alongside the integer
marshalling wrappers.  Change k5_buf_init_fixed() to accept a void
pointer so it can more conveniently be used with uint8_t arrays.
25 files changed:
src/clients/ksu/authorization.c
src/clients/kvno/kvno.c
src/include/k5-buf.h
src/kadmin/dbutil/tdumputil.c
src/kadmin/server/auth_acl.c
src/kdc/kdc_util.c
src/lib/gssapi/spnego/negoex_util.c
src/lib/kadm5/logger.c
src/lib/krb5/krb/chpw.c
src/lib/krb5/krb/kerrs.c
src/lib/krb5/krb/preauth_otp.c
src/lib/krb5/os/dnsglue.c
src/lib/krb5/os/dnssrv.c
src/lib/krb5/os/expand_path.c
src/lib/krb5/os/localauth_rule.c
src/lib/krb5/os/trace.c
src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.c
src/plugins/kdb/ldap/libkdb_ldap/ldap_principal.c
src/plugins/kdb/ldap/libkdb_ldap/ldap_realm.c
src/plugins/preauth/pkinit/pkinit_crypto_openssl.c
src/util/support/json.c
src/util/support/k5buf.c
src/util/support/libkrb5support-fixed.exports
src/util/support/t_k5buf.c
src/util/support/utf8_conv.c