]> git.codecow.com Git - Monocypher.git/commitdiff
Revert "Added version number to binaries"
authorLoup Vaillant <loup@loup-vaillant.fr>
Sat, 19 Oct 2019 15:54:36 +0000 (17:54 +0200)
committerLoup Vaillant <loup@loup-vaillant.fr>
Sat, 19 Oct 2019 15:54:36 +0000 (17:54 +0200)
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
src/monocypher.h
tests/test.c

index 30b5fdb6cdce1d40e4f198ff42ae5f328f7a41e5..6a4b10fb776ae386ede7c18a94f81107b6d12fef 100644 (file)
@@ -1,5 +1,4 @@
 // Monocypher version __git__
-const char *monocypher_version = "__git__";
 
 #include "monocypher.h"
 
index a85c01d878bf955f784cf0f9e996c4315e0eb64d..c99561def611a2c213a89c5120b52758243addc4 100644 (file)
@@ -3,8 +3,6 @@
 #ifndef MONOCYPHER_H
 #define MONOCYPHER_H
 
-extern const char *monocypher_version;
-
 #include <inttypes.h>
 #include <stddef.h>
 
index 14548ab59733daf78c65ddef271b4b54d9a3bf69..c195e466375903d9b24ee6f5c1fa68842d7de491 100644 (file)
@@ -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);
     }