aboutsummaryrefslogtreecommitdiff
path: root/libtokencap
diff options
context:
space:
mode:
Diffstat (limited to 'libtokencap')
-rw-r--r--libtokencap/Makefile4
-rw-r--r--libtokencap/libtokencap.so.c17
2 files changed, 19 insertions, 2 deletions
diff --git a/libtokencap/Makefile b/libtokencap/Makefile
index df594e8e..858f0dcb 100644
--- a/libtokencap/Makefile
+++ b/libtokencap/Makefile
@@ -18,8 +18,8 @@ HELPER_PATH = $(PREFIX)/lib/afl
VERSION = $(shell grep '^\#define VERSION ' ../config.h | cut -d '"' -f2)
-CFLAGS ?= -O3 -funroll-loops -I ../include/
-CFLAGS += -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign
+CFLAGS ?= -O3 -funroll-loops
+CFLAGS += -I ../include/ -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign
ifeq "$(shell uname)" "Linux"
TARGETS = libtokencap.so
diff --git a/libtokencap/libtokencap.so.c b/libtokencap/libtokencap.so.c
index d67e4e16..e4f531c8 100644
--- a/libtokencap/libtokencap.so.c
+++ b/libtokencap/libtokencap.so.c
@@ -142,6 +142,9 @@ static void __tokencap_load_mappings(void) {
}
+ base += size;
+ size = 0;
+
}
}
@@ -687,6 +690,20 @@ bool strcsequal(const void* s1, const void* s2) {
}
+/* bcmp/memcmp BSD flavors, similar to CRYPTO_memcmp */
+
+int timingsafe_bcmp(const void* mem1, const void* mem2, size_t len) {
+
+ return bcmp(mem1, mem2, len);
+
+}
+
+int timingsafe_memcmp(const void* mem1, const void* mem2, size_t len) {
+
+ return memcmp(mem1, mem2, len);
+
+}
+
/* Init code to open the output file (or default to stderr). */
__attribute__((constructor)) void __tokencap_init(void) {