From 238fdb8f65835bb71bd931b5c0c22860b5cde51e Mon Sep 17 00:00:00 2001 From: Marko Kreen Date: Tue, 19 Mar 2013 22:05:34 +0200 Subject: [PATCH] Refresh libusual --- Makefile | 4 +++- include/bouncer.h | 2 +- lib | 2 +- src/util.c | 13 ++++++------- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 81947a6..5f5b339 100644 --- a/Makefile +++ b/Makefile @@ -67,7 +67,9 @@ EXTRA_DIST = AUTHORS COPYRIGHT Makefile \ # libusual files (fixme: list should be provided by libusual...) LIBUSUAL_DIST = $(filter-out %/config.h, $(wildcard \ - lib/usual/*.[chg] lib/m4/*.m4 \ + lib/usual/*.[chg] \ + lib/usual/*/*.[ch] \ + lib/m4/*.m4 \ lib/usual/config.h.in \ lib/mk/*.mk \ lib/mk/antimake.mk lib/mk/antimake.txt \ diff --git a/include/bouncer.h b/include/bouncer.h index 5dc47eb..545ed2c 100644 --- a/include/bouncer.h +++ b/include/bouncer.h @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/lib b/lib index 94874aa..36e0ec5 160000 --- a/lib +++ b/lib @@ -1 +1 @@ -Subproject commit 94874aa20c111788e1b9b79c4b6e7cd3e6cf6271 +Subproject commit 36e0ec5425ebfe3fd449a9b05813f5aba758b421 diff --git a/src/util.c b/src/util.c index e9c1f8c..b7fc0aa 100644 --- a/src/util.c +++ b/src/util.c @@ -22,8 +22,7 @@ #include "bouncer.h" -#define MD5_COMPAT -#include +#include int log_socket_prefix(enum LogLevel lev, void *ctx, char *dst, unsigned int dstlen) { @@ -80,13 +79,13 @@ void pg_md5_encrypt(const char *part1, const char *part2, size_t part2len, char *dest) { - MD5_CTX ctx; + struct md5_ctx ctx; uint8_t hash[MD5_DIGEST_LENGTH]; - MD5_Init(&ctx); - MD5_Update(&ctx, part1, strlen(part1)); - MD5_Update(&ctx, part2, part2len); - MD5_Final(hash, &ctx); + md5_reset(&ctx); + md5_update(&ctx, part1, strlen(part1)); + md5_update(&ctx, part2, part2len); + md5_final(&ctx, hash); memcpy(dest, "md5", 3); hash2hex(hash, dest + 3); -- 2.40.0