Skip to content

Commit 7624c1f

Browse files
kchaniveckygasimo5
authored andcommitted
BF: swap UTF16LE with UTF-16LE in libunistring calls
Signed-off-by: kchaniveckyga <kchaniveckyga@fortinet.com>
1 parent 9492bfa commit 7624c1f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/ntlm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ int ntlm_init_ctx(struct ntlm_ctx **ctx)
7878
_ctx = calloc(1, sizeof(struct ntlm_ctx));
7979
if (!_ctx) return ENOMEM;
8080

81-
_ctx->from_oem = iconv_open("UTF16LE", "UTF-8");
81+
_ctx->from_oem = iconv_open("UTF-16LE", "UTF-8");
8282
if (_ctx->from_oem == (iconv_t) -1) {
8383
ret = errno;
8484
}
8585

86-
_ctx->to_oem = iconv_open("UTF-8", "UTF16LE");
86+
_ctx->to_oem = iconv_open("UTF-8", "UTF-16LE");
8787
if (_ctx->to_oem == (iconv_t) -1) {
8888
iconv_close(_ctx->from_oem);
8989
ret = errno;

src/ntlm_crypto.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ int NTOWFv1(const char *password, struct ntlm_key *result)
5050
int ret;
5151

5252
len = strlen(password);
53-
retstr = u8_conv_to_encoding("UTF16LE", iconveh_error,
53+
retstr = u8_conv_to_encoding("UTF-16LE", iconveh_error,
5454
(const uint8_t *)password, len,
5555
NULL, NULL, &out);
5656
if (!retstr) return ERR_CRYPTO;
@@ -254,7 +254,7 @@ int NTOWFv2(struct ntlm_ctx *ctx, struct ntlm_key *nt_hash,
254254
offs += len;
255255
}
256256

257-
retstr = (uint8_t *)u8_conv_to_encoding("UTF16LE", iconveh_error,
257+
retstr = (uint8_t *)u8_conv_to_encoding("UTF-16LE", iconveh_error,
258258
upcased, offs, NULL, NULL, &out);
259259
if (!retstr) return ERR_CRYPTO;
260260

0 commit comments

Comments
 (0)