Warmcat homepage andy@warmcat.com
libwebsockets
{"schema":"libjg2-1", "vpath":"/git/", "avatar":"/git/avatar/", "alang":"", "gen_ut":1752652159, "reponame":"openssl", "desc":"OpenSSL", "owner": { "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },"url":"https://warmcat.com/repo/openssl", "f":3, "items": [ {"schema":"libjg2-1", "cid":"df8500911c7dcfd52264620d88f6b45e", "commit": {"type":"commit", "time": 1489930434, "time_ofs": 60, "oid_tree": { "oid": "84f501d094ee321cfebcf0a333df1b1a4c879552", "alias": []}, "oid":{ "oid": "497910833e6992b4b8645900f2086a56f5557424", "alias": []}, "msg": "Make the CRYPTO_memcmp() prototype match memcmp()", "sig_commit": { "git_time": { "time": 1489930434, "offset": 60 }, "name": "Kurt Roeckx", "email": "kurt@roeckx.be", "md5": "07d47d7a232d566ec15a49b65d5dd9c1" }, "sig_author": { "git_time": { "time": 1487712034, "offset": 60 }, "name": "Kurt Roeckx", "email": "kurt@roeckx.be", "md5": "07d47d7a232d566ec15a49b65d5dd9c1" }}, "body": "Make the CRYPTO_memcmp() prototype match memcmp()\n\nReviewed-by: Andy Polyakov \u003cappro@openssl.org\u003e\nGH: #2633\n" , "diff": "diff --git a/crypto/cryptlib.c b/crypto/cryptlib.c\nindex b022365..71a5c35 100644\n--- a/crypto/cryptlib.c\n+++ b/crypto/cryptlib.c\n@@ -313,26 +313,15 @@ void OPENSSL_die(const char *message, const char *file, int line)\n }\n \n #if !defined(OPENSSL_CPUID_OBJ)\n-/* volatile unsigned char* pointers are there because\n- * 1. Accessing a variable declared volatile via a pointer\n- * that lacks a volatile qualifier causes undefined behavior.\n- * 2. When the variable itself is not volatile the compiler is\n- * not required to keep all those reads and can convert\n- * this into canonical memcmp() which doesn't read the whole block.\n- * Pointers to volatile resolve the first problem fully. The second\n- * problem cannot be resolved in any Standard-compliant way but this\n- * works the problem around. Compilers typically react to\n- * pointers to volatile by preserving the reads and writes through them.\n- * The latter is not required by the Standard if the memory pointed to\n- * is not volatile.\n- * Pointers themselves are volatile in the function signature to work\n- * around a subtle bug in gcc 4.6+ which causes writes through\n- * pointers to volatile to not be emitted in some rare,\n- * never needed in real life, pieces of code.\n+/*\n+ * The volatile is used to to ensure that the compiler generates code that reads\n+ * all values from the array and doesn't try to optimize this away. The standard\n+ * doesn't actually require this behavior if the original data pointed to is\n+ * not volatile, but compilers do this in practice anyway.\n+ *\n+ * There are also assembler versions of this function.\n */\n-int CRYPTO_memcmp(const volatile void * volatile in_a,\n- const volatile void * volatile in_b,\n- size_t len)\n+int CRYPTO_memcmp(const void * in_a, const void * in_b, size_t len)\n {\n size_t i;\n const volatile unsigned char *a \u003d in_a;\ndiff --git a/include/openssl/crypto.h b/include/openssl/crypto.h\nindex 8ee3e8a..3b75dbe 100644\n--- a/include/openssl/crypto.h\n+++ b/include/openssl/crypto.h\n@@ -347,9 +347,7 @@ int OPENSSL_gmtime_diff(int *pday, int *psec,\n * into a defined order as the return value when a !\u003d b is undefined, other\n * than to be non-zero.\n */\n-int CRYPTO_memcmp(const volatile void * volatile in_a,\n- const volatile void * volatile in_b,\n- size_t len);\n+int CRYPTO_memcmp(const void * in_a, const void * in_b, size_t len);\n \n /* Standard initialisation options */\n # define OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS 0x00000001L\n","s":{"c":1752652159,"u": 27652}} ],"g": 29064,"chitpc": 0,"ehitpc": 0,"indexed":0 , "ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}