From 77ef53fcabcb89c88c53bf924e100fa156bad1fc Mon Sep 17 00:00:00 2001 From: Loup Vaillant Date: Sat, 19 Oct 2019 17:54:36 +0200 Subject: [PATCH] Revert "Added version number to binaries" This reverts commit 30737a99843ac9f33698ea7e06afae1e7c6133df. Exposing version numbers in the binary can expose them to attackers. Without the version number, they have to try the exploit and hope. With the version number, they may perform a cheap check before they proceed any further. Better not take the risk. Furthermore, changing the length of the string may break ABI. This will happen if a version number (major, minor, or patch) ever reaches 10. That patch was nice, but it potentially impact security and stability. Not worth it in the end. --- src/monocypher.c | 1 - src/monocypher.h | 2 -- tests/test.c | 2 -- 3 files changed, 5 deletions(-) diff --git a/src/monocypher.c b/src/monocypher.c index 30b5fdb..6a4b10f 100644 --- a/src/monocypher.c +++ b/src/monocypher.c @@ -1,5 +1,4 @@ // Monocypher version __git__ -const char *monocypher_version = "__git__"; #include "monocypher.h" diff --git a/src/monocypher.h b/src/monocypher.h index a85c01d..c99561d 100644 --- a/src/monocypher.h +++ b/src/monocypher.h @@ -3,8 +3,6 @@ #ifndef MONOCYPHER_H #define MONOCYPHER_H -extern const char *monocypher_version; - #include #include diff --git a/tests/test.c b/tests/test.c index 14548ab..c195e46 100644 --- a/tests/test.c +++ b/tests/test.c @@ -856,8 +856,6 @@ static int p_auth() int main(int argc, char *argv[]) { - printf("\nMonocypher version: %s\n", monocypher_version); - if (argc > 1) { sscanf(argv[1], "%" PRIu64 "", &random_state); } -- 2.47.3