diff --git a/src/ntlm.c b/src/ntlm.c index 60a0787..cdd1725 100644 --- a/src/ntlm.c +++ b/src/ntlm.c @@ -78,12 +78,12 @@ int ntlm_init_ctx(struct ntlm_ctx **ctx) _ctx = calloc(1, sizeof(struct ntlm_ctx)); if (!_ctx) return ENOMEM; - _ctx->from_oem = iconv_open("UTF16LE", "UTF-8"); + _ctx->from_oem = iconv_open("UTF-16LE", "UTF-8"); if (_ctx->from_oem == (iconv_t) -1) { ret = errno; } - _ctx->to_oem = iconv_open("UTF-8", "UTF16LE"); + _ctx->to_oem = iconv_open("UTF-8", "UTF-16LE"); if (_ctx->to_oem == (iconv_t) -1) { iconv_close(_ctx->from_oem); ret = errno; diff --git a/src/ntlm_crypto.c b/src/ntlm_crypto.c index d71e45b..8d315ed 100644 --- a/src/ntlm_crypto.c +++ b/src/ntlm_crypto.c @@ -50,7 +50,7 @@ int NTOWFv1(const char *password, struct ntlm_key *result) int ret; len = strlen(password); - retstr = u8_conv_to_encoding("UTF16LE", iconveh_error, + retstr = u8_conv_to_encoding("UTF-16LE", iconveh_error, (const uint8_t *)password, len, NULL, NULL, &out); if (!retstr) return ERR_CRYPTO; @@ -254,7 +254,7 @@ int NTOWFv2(struct ntlm_ctx *ctx, struct ntlm_key *nt_hash, offs += len; } - retstr = (uint8_t *)u8_conv_to_encoding("UTF16LE", iconveh_error, + retstr = (uint8_t *)u8_conv_to_encoding("UTF-16LE", iconveh_error, upcased, offs, NULL, NULL, &out); if (!retstr) return ERR_CRYPTO;