krb5 commit: Modernize UTF-8/UCS-2 conversion code

Stefan Metzmacher metze at
Mon Apr 17 15:24:40 EDT 2017

Hi Robbie,

is there a reson why you still limit this to USC-2 and not use full UTF16

We had a lot of trouble with the limited unicode support of krb5 libraries
in Samba recently, see

For now we worked arround it in Samba by limiting random machine passwords
to unicode codepoints up to 0xffff.


> commit c4e8d444632140ecb47f31df133c0657f07f9be0
> Author: Robbie Harwood <rharwood at>
> Date:   Thu Apr 6 12:15:39 2017 -0400
>     Modernize UTF-8/UCS-2 conversion code
>     Remove unused entry points as we only need to convert between
>     little-endian UCS-2 byte buffers and UTF-8.  Rename and simplify the
>     remaining two function contracts.  Avoid pointer alignment and
>     endianness issues by operating on byte buffers and using store_16_le()
>     and load_16_le().  Avoid two-pass operation using k5buf.
>     [ghudson at simplified code using k5buf; simplified function
>     names and contracts; rewrote commit message]

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
Url :

More information about the krbdev mailing list