summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@herrb.eu>2017-02-28 19:18:25 +0100
committerAdam Jackson <ajax@redhat.com>2017-02-28 14:18:26 -0500
commit3f61c7a09b220805ee6778f4bf2f429e3df8e37a (patch)
tree4b119438f15df58a307b668a34cb7bbac6eb4566 /include
parentb5c98aa6779b97882246b03c5dea646bd1355991 (diff)
Use timingsafe_memcmp() to compare MIT-MAGIC-COOKIES CVE-2017-2624
Provide the function definition for systems that don't have it. Signed-off-by: Matthieu Herrb <matthieu@herrb.eu> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> (cherry picked from commit d7ac755f0b618eb1259d93c8a16ec6e39a18627c)
Diffstat (limited to 'include')
-rw-r--r--include/dix-config.h.in3
-rw-r--r--include/os.h5
2 files changed, 8 insertions, 0 deletions
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index 4f020e5d8..4b86c1a3c 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -238,6 +238,9 @@
/* Define to 1 if you have the <sys/utsname.h> header file. */
#undef HAVE_SYS_UTSNAME_H
+/* Define to 1 if you have the `timingsafe_memcmp' function. */
+#undef HAVE_TIMINGSAFE_MEMCMP
+
/* Define to 1 if you have the <tslib.h> header file. */
#undef HAVE_TSLIB_H
diff --git a/include/os.h b/include/os.h
index d2c41b402..aa231f550 100644
--- a/include/os.h
+++ b/include/os.h
@@ -590,6 +590,11 @@ extern _X_EXPORT char *
strndup(const char *str, size_t n);
#endif
+#ifndef HAVE_TIMINGSAFE_MEMCMP
+extern _X_EXPORT int
+timingsafe_memcmp(const void *b1, const void *b2, size_t len);
+#endif
+
/* Logging. */
typedef enum _LogParameter {
XLOG_FLUSH,