15 Commits

Author SHA1 Message Date
551f0c32fa base: Fix code spelling
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2023-11-28 21:34:35 -05:00
c05294e2c5 base: Remove unused variable assignment in JSON string parsing 2023-01-04 00:43:35 -06:00
c132e6ff49 lib/base: Avoid compiler warning about use-after-free on Fedora 36
While the local stack pointers could be thought of as "only"
numbers that are not invalidated by the memory they point at
being freed, any use of the pointer after the free is undefined
and so warned about (at best).

gcc version 12.2.1 20220819 (Red Hat 12.2.1-1) (GCC)

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2022-11-17 09:42:48 -05:00
2c8be80a25 lib/base: Correct realloc() paramters, to allocate one more byte, not 1 byte
The entry condition here is p == pend so this is really just 1 + p - p, eg just 1.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2022-11-17 09:42:48 -05:00
1429814eda base: HEIM_JSON_F_TRY_DECODE_DATA cannot work
The idea with HEIM_JSON_F_TRY_DECODE_DATA is that on parsing of JSON
texts, if we find a base64-encoded string, decode it.  But a lot of
strings that aren't base64-encoded can be decoded anyways, leaving a
mess.

Insted we should -in a future commit- implement this only for the string
values of "heimdal-type-data-76d7fca2-d0da-4b20-a126-1a10f8a0eae6" names
in singleton objects.
2022-10-02 22:46:37 -05:00
8364bdd8f3 base: Add JSON string non-ASCII escaping options
- Add HEIM_JSON_F_ESCAPE_NON_ASCII to indicate that non-ASCII must be
   escaped as \uXXXX.

 - Add HEIM_JSON_F_NO_ESCAPE_NON_ASCII to force non-escaping of BMP
   codepoints.

 - If the locale's codeset is not UTF-8 and
   HEIM_JSON_F_NO_ESCAPE_NON_ASCII is not set, then set
   HEIM_JSON_F_ESCAPE_NON_ASCII.
2022-10-02 22:46:37 -05:00
03f06b9472 base: Prettier JSON output / options
- Add flags for indenting with 2, 4, or 8 spaces, still defaulting to
   tabs if none of those are set.

 - Don't emit a newline before emitting scalar values in dicts.
2022-10-01 00:15:37 -05:00
c6a46f0c96 base: Implement JSON string escaping
We encode JSON in the KDC's audit logs, and soon in bx509d's /get-tgts.
Therefore, we should be reasonable in terms of what we encode.
2022-09-29 17:05:24 -05:00
37afa01be3 rename roken base64, fixes 2014-08-22 20:57:24 -07:00
1fad1f8984 lib/base: Rename strbuf to heim_strbuf to avoid conflict with stropts.h on linux 2014-03-24 23:07:52 -05:00
9f979d20d7 prefix json functions 2013-07-16 13:06:57 +02:00
b301e47fb8 rename heim_serialize to heim_copy_serialize to follow create/copy/get semantics 2013-06-03 21:46:20 -07:00
58ff480763 rewrite send to kdc to be more agressive, try kdcs in paralell and easier to configure behavior 2013-02-10 19:02:52 -08:00
029de6cfa4 pass back an heim_error from hx509_cert_init 2012-10-07 06:33:13 -07:00
98809e86ce Move base into lib
This involves reverting dd267e8fc3,
    but that gets lost in the move.

    This builds on Ubuntu and Windows at this time.
2012-06-20 19:32:08 -05:00