]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
ssl: remove unneeded if block
authorAntonio Quartulli <antonio@openvpn.net>
Mon, 5 Apr 2021 12:28:27 +0000 (14:28 +0200)
committerGert Doering <gert@greenie.muc.de>
Wed, 7 Apr 2021 12:45:55 +0000 (14:45 +0200)
There is no need to check the result of a boolean function and then
assign a constant value to a variable based on that check.

Directly assign the return value of the function to the variable.

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20210405122827.16836-1-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg22045.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/ssl.c

index 9d18c6e5b83fc0e5830a020107a74310970f2724..d8662d000305cae53f86e031a5a7adc7ce9beb7e 100644 (file)
@@ -1592,7 +1592,6 @@ openvpn_PRF(const uint8_t *secret,
             uint8_t *output,
             int output_len)
 {
-    bool ret = true;
     /* concatenate seed components */
 
     struct buffer seed = alloc_buf(strlen(label)
@@ -1614,10 +1613,8 @@ openvpn_PRF(const uint8_t *secret,
     }
 
     /* compute PRF */
-    if (!ssl_tls1_PRF(BPTR(&seed), BLEN(&seed), secret, secret_len, output, output_len))
-    {
-        ret = false;
-    }
+    bool ret = ssl_tls1_PRF(BPTR(&seed), BLEN(&seed), secret, secret_len,
+                            output, output_len);
 
     buf_clear(&seed);
     free_buf(&seed);