Skip to content

Commit

Permalink
ssl: remove unneeded if block
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ordex authored and cron2 committed Apr 7, 2021
1 parent b8510ba commit 8af7c6b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/openvpn/ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
Expand Down

0 comments on commit 8af7c6b

Please sign in to comment.