Skip to content

Commit

Permalink
crypto: asymmetric_keys - remove always false comparison
Browse files Browse the repository at this point in the history
commit 4dd17c9 upstream.

hour, min and sec are unsigned int and they can never be less than zero.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
sudip authored and Greg Kroah-Hartman committed Dec 10, 2015
1 parent 5f8b236 commit 6b8b7d4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crypto/asymmetric_keys/x509_cert_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -546,9 +546,9 @@ int x509_decode_time(time64_t *_t, size_t hdrlen,
if (year < 1970 ||
mon < 1 || mon > 12 ||
day < 1 || day > mon_len ||
hour < 0 || hour > 23 ||
min < 0 || min > 59 ||
sec < 0 || sec > 59)
hour > 23 ||
min > 59 ||
sec > 59)
goto invalid_time;

*_t = mktime64(year, mon, day, hour, min, sec);
Expand Down

0 comments on commit 6b8b7d4

Please sign in to comment.