8000 Update ntlmclient dependency · libgit2/libgit2@374cfd1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 374cfd1

Browse files
committed
Update ntlmclient dependency
1 parent 99e0d2a commit 374cfd1

File tree

7 files changed

+408
-274
lines changed

7 files changed

+408
-274
lines changed

deps/ntlmclient/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,5 @@ else()
3737
endif()
3838

3939
add_library(ntlmclient OBJECT ${SRC_NTLMCLIENT} ${SRC_NTLMCLIENT_UNICODE} ${SRC_NTLMCLIENT_CRYPTO})
40+
set_target_properties(ntlmclient PROPERTIES C_STANDARD 90)
41+
set_target_properties(ntlmclient PROPERTIES C_EXTENSIONS OFF)

deps/ntlmclient/crypt_openssl.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@
2626

2727
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(CRYPT_OPENSSL_DYNAMIC)
2828

29-
static inline HMAC_CTX *HMAC_CTX_new(void)
29+
NTLM_INLINE(HMAC_CTX *) HMAC_CTX_new(void)
3030
{
3131
return calloc(1, sizeof(HMAC_CTX));
3232
}
3333

34-
static inline int HMAC_CTX_reset(HMAC_CTX *ctx)
34+
NTLM_INLINE(int) HMAC_CTX_reset(HMAC_CTX *ctx)
3535
{
3636
ntlm_memzero(ctx, sizeof(HMAC_CTX));
3737
return 1;
3838
}
3939

40-
static inline void HMAC_CTX_free(HMAC_CTX *ctx)
40+
NTLM_INLINE(void) HMAC_CTX_free(HMAC_CTX *ctx)
4141
{
4242
free(ctx);
4343
}
@@ -48,7 +48,7 @@ static inline void HMAC_CTX_free(HMAC_CTX *ctx)
4848
(defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x03050000fL) || \
4949
defined(CRYPT_OPENSSL_DYNAMIC)
5050

51-
static inline void HMAC_CTX_cleanup(HMAC_CTX *ctx)
51+
NTLM_INLINE(void) HMAC_CTX_cleanup(HMAC_CTX *ctx)
5252
{
5353
NTLM_UNUSED(ctx);
5454
}

deps/ntlmclient/ntlm.c

+19-19
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static bool supports_unicode(ntlm_client *ntlm)
4343
false : true;
4444
}
4545

46-
static inline bool increment_size(size_t *out, size_t incr)
46+
NTLM_INLINE(bool) increment_size(size_t *out, size_t incr)
4747
{
4848
if (SIZE_MAX - *out < incr) {
4949
*out = (size_t)-1;
@@ -272,7 +272,7 @@ int ntlm_client_set_timestamp(ntlm_client *ntlm, uint64_t timestamp)
272272
return 0;
273273
}
274274

275-
static inline bool write_buf(
275+
NTLM_INLINE(bool) write_buf(
276276
ntlm_client *ntlm,
277277
ntlm_buf *out,
278278
const unsigned char *buf,
@@ -291,7 +291,7 @@ static inline bool write_buf(
291291
return true;
292292
}
293293

294-
static inline bool write_byte(
294+
NTLM_INLINE(bool) write_byte(
295295
ntlm_client *ntlm,
296296
ntlm_buf *out,
297297
uint8_t value)
@@ -305,7 +305,7 @@ static inline bool write_byte(
305305
return true;
306306
}
307307

308-
static inline bool write_int16(
308+
NTLM_INLINE(bool) write_int16(
309309
ntlm_client *ntlm,
310310
ntlm_buf *out,
311311
uint16_t value)
@@ -320,7 +320,7 @@ static inline bool write_int16( 9E81
320320
return true;
321321
}
322322

323-
static inline bool write_int32(
323+
NTLM_INLINE(bool) write_int32(
324324
ntlm_client *ntlm,
325325
ntlm_buf *out,
326326
uint32_t value)
@@ -337,7 +337,7 @@ static inline bool write_int32(
337337
return true;
338338
}
339339

340-
static inline bool write_version(
340+
NTLM_INLINE(bool) write_version(
341341
ntlm_client *ntlm,
342342
ntlm_buf *out,
343343
ntlm_version *version)
@@ -348,7 +348,7 @@ static inline bool write_version(
348348
write_int32(ntlm, out, version->reserved);
349349
}
350350

351-
static inline bool write_bufinfo(
351+
NTLM_INLINE(bool) write_bufinfo(
352352
ntlm_client *ntlm,
353353
ntlm_buf *out,
354354
size_t len,
@@ -369,7 +369,7 @@ static inline bool write_bufinfo(
369369
write_int32(ntlm, out, (uint32_t)offset);
370370
}
371371

372-
static inline bool read_buf(
372+
NTLM_INLINE(bool) read_buf(
373373
unsigned char *out,
374374
ntlm_client *ntlm,
375375
ntlm_buf *message,
@@ -386,7 +386,7 @@ static inline bool read_buf(
386386
return true;
387387
}
388388

389-
static inline bool read_byte(
389+
NTLM_INLINE(bool) read_byte(
390390
uint8_t *out,
391391
ntlm_client *ntlm,
392392
ntlm_buf *message)
@@ -400,7 +400,7 @@ static inline bool read_byte(
400400
return true;
401401
}
402402

403-
static inline bool read_int16(
403+
NTLM_INLINE(bool) read_int16(
404404
uint16_t *out,
405405
ntlm_client *ntlm,
406406
ntlm_buf *message)
@@ -418,7 +418,7 @@ static inline bool read_int16(
418418
return true;
419419
}
420420

421-
static inline bool read_int32(
421+
NTLM_INLINE(bool) read_int32(
422422
uint32_t *out,
423423
ntlm_client *ntlm,
424424
ntlm_buf *message)
@@ -438,7 +438,7 @@ static inline bool read_int32(
438438
return true;
439439
}
440440

441-
static inline bool read_int64(
441+
NTLM_INLINE(bool) read_int64(
442442
uint64_t *out,
443443
ntlm_client *ntlm,
444444
ntlm_buf *message)
@@ -462,7 +462,7 @@ static inline bool read_int64(
462462
return true;
463463
}
464464

465-
static inline bool read_version(
465+
NTLM_INLINE(bool) read_version(
466466
ntlm_version *out,
467467
ntlm_client *ntlm,
468468
ntlm_buf *message)
@@ -473,7 +473,7 @@ static inline bool read_version(
473473
read_int32(&out->reserved, ntlm, message);
474474
}
475475

476-
static inline bool read_bufinfo(
476+
NTLM_INLINE(bool) read_bufinfo(
477477
uint16_t *out_len,
478478
uint32_t *out_offset,
479479
ntlm_client *ntlm,
@@ -486,7 +486,7 @@ static inline bool read_bufinfo(
486486
read_int32(out_offset, ntlm, message);
487487
}
488488

489-
static inline bool read_string_unicode(
489+
NTLM_INLINE(bool) read_string_unicode(
490490
char **out,
491491
ntlm_client *ntlm,
492492
ntlm_buf *message,
@@ -504,7 +504,7 @@ static inline bool read_string_unicode(
504504
return ret;
505505
}
506506

507-
static inline bool read_string_ascii(
507+
NTLM_INLINE(bool) read_string_ascii(
508508
char **out,
509509
ntlm_client *ntlm,
510510
ntlm_buf *message,
@@ -526,7 +526,7 @@ static inline bool read_string_ascii(
526526
return true;
527527
}
528528

529-
static inline bool read_string(
529+
NTLM_INLINE(bool) read_string(
530530
char **out,
531531
ntlm_client *ntlm,
532532
ntlm_buf *message,
@@ -539,7 +539,7 @@ static inline bool read_string(
539539
return read_string_ascii(out, ntlm, message, string_len);
540540
}
541541

542-
static inline bool read_target_info(
542+
NTLM_INLINE(bool) read_target_info(
543543
char **server_out,
544544
char **domain_out,
545545
char **server_dns_out,
@@ -965,7 +965,7 @@ static void des_key_from_password(
965965
generate_odd_parity(out);
966966
}
967967

968-
static inline bool generate_lm_hash(
968+
NTLM_INLINE(bool) generate_lm_hash(
969969
ntlm_des_block out[2],
970970
ntlm_client *ntlm,
971971
const char *password)

deps/ntlmclient/unicode_builtin.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "ntlm.h&qu F438 ot;
1313
#include "unicode.h"
1414
#include "compat.h"
15+
#include "util.h"
1516

1617
typedef unsigned int UTF32; /* at least 32 bits */
1718
typedef unsigned short UTF16; /* at least 16 bits */
@@ -180,7 +181,7 @@ static ConversionResult ConvertUTF16toUTF8 (
180181
* definition of UTF-8 goes up to 4-byte sequences.
181182
*/
182183

183-
static inline bool isLegalUTF8(const UTF8 *source, int length) {
184+
NTLM_INLINE(bool) isLegalUTF8(const UTF8 *source, int length) {
184185
UTF8 a;
185186
const UTF8 *srcptr = source+length;
186187
switch (length) {
@@ -288,7 +289,7 @@ typedef enum {
288289
unicode_builtin_utf16_to_8
289290
} unicode_builtin_encoding_direction;
290291

291-
static inline bool unicode_builtin_encoding_convert(
292+
NTLM_INLINE(bool) unicode_builtin_encoding_convert(
292293
char **converted,
293294
size_t *converted_len,
294295
ntlm_client *ntlm,

deps/ntlmclient/unicode_iconv.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "ntlmclient.h"
1515
#include "unicode.h"
1616
#include "ntlm.h"
17+
#include "util.h"
1718
#include "compat.h"
1819

1920
typedef enum {
@@ -40,7 +41,7 @@ bool ntlm_unicode_init(ntlm_client *ntlm)
4041
return true;
4142
}
4243

43-
static inline bool unicode_iconv_encoding_convert(
44+
NTLM_INLINE(bool) unicode_iconv_encoding_convert(
4445
char **converted,
4546
size_t *converted_len,
4647
ntlm_client *ntlm,

0 commit comments

Comments
 (0)
0