Add link-time warnings to MD5 wrapper functions Let's get the word out that these functions are deprecated and should be switched away from.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
diff --git a/src/md5.c b/src/md5.c
index da99876..00769aa 100644
--- a/src/md5.c
+++ b/src/md5.c
@@ -28,6 +28,7 @@
#include <stdlib.h>
#include <dlfcn.h>
#include <md5.h>
+#include "local-link.h"
static void (*libmd_MD5Init)(MD5_CTX *);
static void (*libmd_MD5Update)(MD5_CTX *, const uint8_t *, size_t);
@@ -65,6 +66,8 @@ MD5Init(MD5_CTX *context)
libmd_wrapper(MD5Init);
libmd_MD5Init(context);
}
+libbsd_link_warning(MD5Init,
+ "This function is a deprecated wrapper, use libmd instead.");
void
MD5Update(MD5_CTX *context, const uint8_t *data, size_t len)
@@ -72,6 +75,8 @@ MD5Update(MD5_CTX *context, const uint8_t *data, size_t len)
libmd_wrapper(MD5Update);
libmd_MD5Update(context, data, len);
}
+libbsd_link_warning(MD5Update,
+ "This function is a deprecated wrapper, use libmd instead.");
void
MD5Pad(MD5_CTX *context)
@@ -79,6 +84,8 @@ MD5Pad(MD5_CTX *context)
libmd_wrapper(MD5Pad);
libmd_MD5Pad(context);
}
+libbsd_link_warning(MD5Pad,
+ "This function is a deprecated wrapper, use libmd instead.");
void
MD5Final(uint8_t digest[MD5_DIGEST_LENGTH], MD5_CTX *context)
@@ -86,6 +93,8 @@ MD5Final(uint8_t digest[MD5_DIGEST_LENGTH], MD5_CTX *context)
libmd_wrapper(MD5Final);
libmd_MD5Final(digest, context);
}
+libbsd_link_warning(MD5Final,
+ "This function is a deprecated wrapper, use libmd instead.");
void
MD5Transform(uint32_t state[4], const uint8_t block[MD5_BLOCK_LENGTH])
@@ -93,6 +102,8 @@ MD5Transform(uint32_t state[4], const uint8_t block[MD5_BLOCK_LENGTH])
libmd_wrapper(MD5Transform);
libmd_MD5Transform(state, block);
}
+libbsd_link_warning(MD5Transform,
+ "This function is a deprecated wrapper, use libmd instead.");
char *
MD5End(MD5_CTX *context, char *buf)
@@ -100,6 +111,8 @@ MD5End(MD5_CTX *context, char *buf)
libmd_wrapper(MD5End);
return libmd_MD5End(context, buf);
}
+libbsd_link_warning(MD5End,
+ "This function is a deprecated wrapper, use libmd instead.");
char *
MD5File(const char *filename, char *buf)
@@ -107,6 +120,8 @@ MD5File(const char *filename, char *buf)
libmd_wrapper(MD5File);
return MD5File(filename, buf);
}
+libbsd_link_warning(MD5File,
+ "This function is a deprecated wrapper, use libmd instead.");
char *
MD5FileChunk(const char *filename, char *buf, off_t offset, off_t length)
@@ -114,6 +129,8 @@ MD5FileChunk(const char *filename, char *buf, off_t offset, off_t length)
libmd_wrapper(MD5FileChunk);
return libmd_MD5FileChunk(filename, buf, offset, length);
}
+libbsd_link_warning(MD5FileChunk,
+ "This function is a deprecated wrapper, use libmd instead.");
char *
MD5Data(const uint8_t *data, size_t len, char *buf)
@@ -121,3 +138,5 @@ MD5Data(const uint8_t *data, size_t len, char *buf)
libmd_wrapper(MD5Data);
return libmd_MD5Data(data, len, buf);
}
+libbsd_link_warning(MD5Data,
+ "This function is a deprecated wrapper, use libmd instead.");