summaryrefslogtreecommitdiffstats
path: root/kernel/crypto/asymmetric_keys
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/crypto/asymmetric_keys')
-rw-r--r--kernel/crypto/asymmetric_keys/Kconfig1
-rw-r--r--kernel/crypto/asymmetric_keys/pkcs7_parser.c4
-rw-r--r--kernel/crypto/asymmetric_keys/pkcs7_trust.c2
-rw-r--r--kernel/crypto/asymmetric_keys/x509_cert_parser.c8
4 files changed, 8 insertions, 7 deletions
diff --git a/kernel/crypto/asymmetric_keys/Kconfig b/kernel/crypto/asymmetric_keys/Kconfig
index 4870f2840..05bfe568c 100644
--- a/kernel/crypto/asymmetric_keys/Kconfig
+++ b/kernel/crypto/asymmetric_keys/Kconfig
@@ -14,6 +14,7 @@ config ASYMMETRIC_PUBLIC_KEY_SUBTYPE
select MPILIB
select PUBLIC_KEY_ALGO_RSA
select CRYPTO_HASH_INFO
+ select CRYPTO_AKCIPHER
help
This option provides support for asymmetric public key type handling.
If signature generation and/or verification are to be used,
diff --git a/kernel/crypto/asymmetric_keys/pkcs7_parser.c b/kernel/crypto/asymmetric_keys/pkcs7_parser.c
index 758acabf2..8f3056cd0 100644
--- a/kernel/crypto/asymmetric_keys/pkcs7_parser.c
+++ b/kernel/crypto/asymmetric_keys/pkcs7_parser.c
@@ -547,9 +547,7 @@ int pkcs7_sig_note_set_of_authattrs(void *context, size_t hdrlen,
struct pkcs7_signed_info *sinfo = ctx->sinfo;
if (!test_bit(sinfo_has_content_type, &sinfo->aa_set) ||
- !test_bit(sinfo_has_message_digest, &sinfo->aa_set) ||
- (ctx->msg->data_type == OID_msIndirectData &&
- !test_bit(sinfo_has_ms_opus_info, &sinfo->aa_set))) {
+ !test_bit(sinfo_has_message_digest, &sinfo->aa_set)) {
pr_warn("Missing required AuthAttr\n");
return -EBADMSG;
}
diff --git a/kernel/crypto/asymmetric_keys/pkcs7_trust.c b/kernel/crypto/asymmetric_keys/pkcs7_trust.c
index 90d6d4796..ecdb5a2ce 100644
--- a/kernel/crypto/asymmetric_keys/pkcs7_trust.c
+++ b/kernel/crypto/asymmetric_keys/pkcs7_trust.c
@@ -178,6 +178,8 @@ int pkcs7_validate_trust(struct pkcs7_message *pkcs7,
int cached_ret = -ENOKEY;
int ret;
+ *_trusted = false;
+
for (p = pkcs7->certs; p; p = p->next)
p->seen = false;
diff --git a/kernel/crypto/asymmetric_keys/x509_cert_parser.c b/kernel/crypto/asymmetric_keys/x509_cert_parser.c
index 021d39c0b..13c4e5a5f 100644
--- a/kernel/crypto/asymmetric_keys/x509_cert_parser.c
+++ b/kernel/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;
}
}
}