Re: [PATCH v7 3/4] x509: Add support for parsing x509 certs with ECDSA keys

From: kernel test robot
Date: Thu Feb 11 2021 - 03:05:32 EST


Hi Stefan,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on cryptodev/master]
[also build test ERROR on crypto/master security/next-testing v5.11-rc7 next-20210125]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Stefan-Berger/Add-support-for-x509-certs-with-NIST-p256-and-p192-keys/20210201-232803
base: https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
config: x86_64-randconfig-a011-20200911 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/6e1523b0e77785c263bcb639b87a862ae59731a4
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Stefan-Berger/Add-support-for-x509-certs-with-NIST-p256-and-p192-keys/20210201-232803
git checkout 6e1523b0e77785c263bcb639b87a862ae59731a4
# save the attached .config to linux build tree
make W=1 ARCH=x86_64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

ld: crypto/asymmetric_keys/public_key.o: in function `software_key_determine_akcipher':
>> crypto/asymmetric_keys/public_key.c:97: undefined reference to `parse_OID'


vim +97 crypto/asymmetric_keys/public_key.c

61
62 /*
63 * Determine the crypto algorithm name.
64 */
65 static
66 int software_key_determine_akcipher(const char *encoding,
67 const char *hash_algo,
68 const struct public_key *pkey,
69 char alg_name[CRYPTO_MAX_ALG_NAME])
70 {
71 int n;
72
73 if (strcmp(encoding, "pkcs1") == 0) {
74 /* The data wangled by the RSA algorithm is typically padded
75 * and encoded in some manner, such as EMSA-PKCS1-1_5 [RFC3447
76 * sec 8.2].
77 */
78 if (!hash_algo)
79 n = snprintf(alg_name, CRYPTO_MAX_ALG_NAME,
80 "pkcs1pad(%s)",
81 pkey->pkey_algo);
82 else
83 n = snprintf(alg_name, CRYPTO_MAX_ALG_NAME,
84 "pkcs1pad(%s,%s)",
85 pkey->pkey_algo, hash_algo);
86 return n >= CRYPTO_MAX_ALG_NAME ? -EINVAL : 0;
87 }
88
89 if (strcmp(encoding, "raw") == 0) {
90 strcpy(alg_name, pkey->pkey_algo);
91 return 0;
92 }
93
94 if (strcmp(encoding, "x962") == 0) {
95 enum OID oid;
96
> 97 if (parse_OID(pkey->params, pkey->paramlen, &oid) != 0)
98 return -EBADMSG;
99
100 switch (oid) {
101 case OID_id_prime192v1:
102 strcpy(alg_name, "ecdsa-nist-p192");
103 return 0;
104 case OID_id_prime256v1:
105 strcpy(alg_name, "ecdsa-nist-p256");
106 return 0;
107 default:
108 return -EINVAL;
109 }
110 }
111
112 return -ENOPKG;
113 }
114

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip