non-ascii password in kerberos authentication

Ken Raeburn raeburn at MIT.EDU
Mon Sep 17 04:38:23 EDT 2007


On Sep 17, 2007, at 04:26, Xu Qiang wrote:
> 				fprintf(stderr, "after convert, password is [%s]\n", password);
> =========================================================
> Look quite straightforward.
>
> But although my passed in password is [eeFair123], the converted  
> password is cut into only one char - [e]. It seems UCS-2LE is not  
> supported by the system library function "iconv()"?

It might be right... remember, in UCS-2LE, each character is  
represented with 16 bits, so 'e' would be (hex) 65 00, and that 00  
would be seen by fprintf (which doesn't cope with UCS-2) as the end  
of the string!  But the output buffer would presumably hold 65 00 65  
00 46 00 61 00 ....

Oh, hm....  This could also be a problem depending on how you're  
going to use this function.  Any of the krb5 library routines that  
use "char *" for the password won't be able to properly determine the  
length; you'd need to plug it in somewhere where a krb5_data object  
is used to access the password, by pointer and length.

Ken



More information about the krbdev mailing list