]> git.puffer.fish Git - mirror/frr.git/commitdiff
sha256: fix clang warning
authorVincent JARDIN <vincent.jardin@6wind.com>
Wed, 27 Sep 2017 21:29:49 +0000 (23:29 +0200)
committerVincent JARDIN <vincent.jardin@6wind.com>
Mon, 2 Oct 2017 07:14:03 +0000 (09:14 +0200)
t0 and t1 are not used, but want do really want them to be reset to secure
the stack.
Suggested by Quentin: let's use memset() to be consistent.

lib/sha256.c

index a1b77901eed919987957972faadd8026b7afacdd..e902021545a7bf9c33e89e153eb43a793b5434f1 100644 (file)
@@ -192,7 +192,8 @@ static void SHA256_Transform(uint32_t *state, const unsigned char block[64])
        /* Clean the stack. */
        memset(W, 0, 256);
        memset(S, 0, 32);
-       t0 = t1 = 0;
+       memset(t0, 0, sizeof(t0));
+       memset(t1, 0, sizeof(t0));
 }
 
 static unsigned char PAD[64] = {