]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
make stack-protector happy
authorNick Mathewson <nickm@torproject.org>
Thu, 10 Dec 2015 16:50:02 +0000 (11:50 -0500)
committerNick Mathewson <nickm@torproject.org>
Thu, 10 Dec 2015 16:50:02 +0000 (11:50 -0500)
src/common/crypto.c

index 3785074a83e12fa6f374323ec218ac4c7d67d8ec..6cef249bb862896c5df83769bd908a416338ef80 100644 (file)
@@ -2529,7 +2529,7 @@ crypto_strongest_rand_raw(uint8_t *out, size_t out_len)
 void
 crypto_strongest_rand(uint8_t *out, size_t out_len)
 {
-  const unsigned DLEN = SHA512_DIGEST_LENGTH;
+#define DLEN SHA512_DIGEST_LENGTH
   /* We're going to hash DLEN bytes from the system RNG together with some
    * bytes from the openssl PRNG, in order to yield DLEN bytes.
    */
@@ -2558,6 +2558,7 @@ crypto_strongest_rand(uint8_t *out, size_t out_len)
   }
   memwipe(tmp, 0, sizeof(tmp));
   memwipe(inp, 0, sizeof(inp));
+#undef DLEN
 }
 
 /** Seed OpenSSL's random number generator with bytes from the operating