aboutsummaryrefslogtreecommitdiff
path: root/crypto/asymmetric_keys/x509_cert_parser.c
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@linaro.org>2017-04-07 16:50:41 +0800
committerAlex Shi <alex.shi@linaro.org>2017-04-07 16:50:41 +0800
commit11cbb42a86895b88ac906a6768c998f9e98a37e2 (patch)
tree3eaeec2cff4c7e34add793c77079cdc85b058bb8 /crypto/asymmetric_keys/x509_cert_parser.c
parent95ffb43f1ba759fb1205a8ce38a7ea5bab6be02d (diff)
parent95bcc3e563748f65c9fc0eb1bbc3f99b76efd4b2 (diff)
Merge remote-tracking branch 'origin/v4.4/topic/hibernate' into hikey-mainline-rebase-4.4hikey-hibernate-v4.4
Conflicts: arch/arm64/Makefile arch/arm64/kernel/arm64ksyms.c arch/arm64/kernel/asm-offsets.c arch/arm64/kvm/hyp/fpsimd.S drivers/firmware/psci.c fs/proc/task_mmu.c mm/memcontrol.c
Diffstat (limited to 'crypto/asymmetric_keys/x509_cert_parser.c')
-rw-r--r--crypto/asymmetric_keys/x509_cert_parser.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/asymmetric_keys/x509_cert_parser.c b/crypto/asymmetric_keys/x509_cert_parser.c
index 021d39c0ba75..13c4e5a5fe8c 100644
--- a/crypto/asymmetric_keys/x509_cert_parser.c
+++ b/crypto/asymmetric_keys/x509_cert_parser.c
@@ -494,7 +494,7 @@ int x509_decode_time(time64_t *_t, size_t hdrlen,
unsigned char tag,
const unsigned char *value, size_t vlen)
{
- static const unsigned char month_lengths[] = { 31, 29, 31, 30, 31, 30,
+ static const unsigned char month_lengths[] = { 31, 28, 31, 30, 31, 30,
31, 31, 30, 31, 30, 31 };
const unsigned char *p = value;
unsigned year, mon, day, hour, min, sec, mon_len;
@@ -540,9 +540,9 @@ int x509_decode_time(time64_t *_t, size_t hdrlen,
if (year % 4 == 0) {
mon_len = 29;
if (year % 100 == 0) {
- year /= 100;
- if (year % 4 != 0)
- mon_len = 28;
+ mon_len = 28;
+ if (year % 400 == 0)
+ mon_len = 29;
}
}
}