All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] key: return proper value and avoid leak
@ 2016-10-11 21:38 Thomas Hindoe Paaboel Andersen
  2016-10-12 15:46 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Hindoe Paaboel Andersen @ 2016-10-11 21:38 UTC (permalink / raw)
  To: ell

[-- Attachment #1: Type: text/plain, Size: 731 bytes --]

The return value was incorrect for bool. The code should also go to
'done' to free sig_hash.
---
 ell/key.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/ell/key.c b/ell/key.c
index ad88d81..a71bdc8 100644
--- a/ell/key.c
+++ b/ell/key.c
@@ -603,8 +603,10 @@ LIB_EXPORT bool l_key_verify(struct l_key *key,
 	uint8_t *sig_hash = l_malloc(len_sig);
 
 	/* Other checksum types are not yet supported */
-	if (checksum != L_CHECKSUM_NONE)
-		return -EINVAL;
+	if (checksum != L_CHECKSUM_NONE) {
+		success = false;
+		goto done;
+	}
 
 	/* The keyctl verify implementation compares the verify results
 	 * before we get a chance to unpad it. Instead, use the *encrypt*
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-10-12 15:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-11 21:38 [PATCH] key: return proper value and avoid leak Thomas Hindoe Paaboel Andersen
2016-10-12 15:46 ` Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.