ell.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] cert: Fix logic in cert_parse_asn1_time check
@ 2022-10-31 10:53 Andrew Zaborowski
  2022-10-31 10:53 ` [PATCH 2/4] cert: Check validity dates in l_certchain_verify Andrew Zaborowski
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Andrew Zaborowski @ 2022-10-31 10:53 UTC (permalink / raw)
  To: ell

Fix wrong operator in a condition that ended up being always true.
---
 ell/cert.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ell/cert.c b/ell/cert.c
index b4f5df7..ab469c2 100644
--- a/ell/cert.c
+++ b/ell/cert.c
@@ -236,7 +236,7 @@ static uint64_t cert_parse_asn1_time(const uint8_t *data, size_t len,
 		return L_TIME_INVALID;
 
 	if (unlikely((len != i + 1 || data[i] != 'Z') &&
-			(len != i + 5 || data[i] != '+' || data[i] != '-')))
+			(len != i + 5 || (data[i] != '+' && data[i] != '-'))))
 		return L_TIME_INVALID;
 
 	tm.tm_year = (data[0] - '0') * 10 + (data[1] - '0');
-- 
2.34.1


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

end of thread, other threads:[~2022-11-01 14:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-31 10:53 [PATCH 1/4] cert: Fix logic in cert_parse_asn1_time check Andrew Zaborowski
2022-10-31 10:53 ` [PATCH 2/4] cert: Check validity dates in l_certchain_verify Andrew Zaborowski
2022-11-01 14:04   ` Denis Kenzior
2022-10-31 10:53 ` [PATCH 3/4] build: Generate an expired test certificate Andrew Zaborowski
2022-10-31 10:53 ` [PATCH 4/4] unit: Minimal l_certchain_verify validity dates test Andrew Zaborowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).