442f2f622351de8497dcdf488123a0618c631511
[openwrt/staging/blogic.git] / patches / verify.patch
1 --- a/compat/verification/pkcs7_trust.c
2 +++ b/compat/verification/pkcs7_trust.c
3 @@ -115,7 +115,7 @@ static int pkcs7_validate_trust_one(struct pkcs7_message *pkcs7,
4 return -ENOKEY;
5
6 matched:
7 - ret = verify_signature(key, sig);
8 + ret = public_key_verify_signature(key->public_key, sig);
9 key_put(key);
10 if (ret < 0) {
11 if (ret == -ENOMEM)
12 --- a/compat/verification/x509_public_key.c
13 +++ b/compat/verification/x509_public_key.c
14 @@ -13,11 +13,8 @@
15 #include <linux/module.h>
16 #include <linux/kernel.h>
17 #include <linux/slab.h>
18 -#include <keys/asymmetric-subtype.h>
19 -#include <keys/asymmetric-parser.h>
20 #include <keys/system_keyring.h>
21 #include <crypto/hash.h>
22 -#include "asymmetric_keys.h"
23 #include "x509_parser.h"
24
25 /*
26 @@ -159,6 +156,7 @@ not_self_signed:
27 return 0;
28 }
29
30 +#if 0
31 /*
32 * Attempt to parse a data blob for a key as an X509 certificate.
33 */
34 @@ -276,3 +274,4 @@ module_exit(x509_key_exit);
35
36 MODULE_DESCRIPTION("X.509 certificate parser");
37 MODULE_LICENSE("GPL");
38 +#endif
39 --- a/include/crypto/pkcs7.h
40 +++ b/include/crypto/pkcs7.h
41 @@ -2,5 +2,10 @@
42 #ifndef CPTCFG_BPAUTO_PKCS7
43 #include_next <crypto/pkcs7.h>
44 #else
45 +#define pkcs7_verify LINUX_BACKPORT(pkcs7_verify)
46 +#define pkcs7_get_content_data LINUX_BACKPORT(pkcs7_get_content_data)
47 +#define pkcs7_parse_message LINUX_BACKPORT(pkcs7_parse_message)
48 +#define pkcs7_free_message LINUX_BACKPORT(pkcs7_free_message)
49 +#define pkcs7_validate_trust LINUX_BACKPORT(pkcs7_validate_trust)
50 #include <crypto/backport-pkcs7.h>
51 #endif /* CPTCFG_BPAUTO_PKCS7 */
52 --- a/compat/verification/x509_parser.h
53 +++ b/compat/verification/x509_parser.h
54 @@ -13,6 +13,10 @@
55 #include <crypto/public_key.h>
56 #include <keys/asymmetric-type.h>
57
58 +#define x509_decode_time LINUX_BACKPORT(x509_decode_time)
59 +#define x509_cert_parse LINUX_BACKPORT(x509_cert_parse)
60 +#define x509_free_certificate LINUX_BACKPORT(x509_free_certificate)
61 +
62 struct x509_certificate {
63 struct x509_certificate *next;
64 struct x509_certificate *signer; /* Certificate that signed this one */