[mst-vhost:vhost 28/60] drivers/crypto/virtio/virtio_crypto_akcipher_algs.c:378: undefined reference to `rsa_parse_priv_key'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git vhost
head:   c5f633abfd09491ae7ecbc7fcfca08332ad00a8b
commit: 8a75f36b5d7a48f1c5a0b46638961c951ec6ecd9 [28/60] virtio-crypto: implement RSA algorithm
config: x86_64-randconfig-a015 (https://download.01.org/0day-ci/archive/20220309/202203090030.CaEQq1U8-lkp@xxxxxxxxx/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git/commit/?id=8a75f36b5d7a48f1c5a0b46638961c951ec6ecd9
        git remote add mst-vhost https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git
        git fetch --no-tags mst-vhost vhost
        git checkout 8a75f36b5d7a48f1c5a0b46638961c951ec6ecd9
        # save the config file to linux build tree
        mkdir build_dir
        make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash

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: drivers/crypto/virtio/virtio_crypto_akcipher_algs.o: in function `virtio_crypto_rsa_set_key':
>> drivers/crypto/virtio/virtio_crypto_akcipher_algs.c:378: undefined reference to `rsa_parse_priv_key'
>> ld: drivers/crypto/virtio/virtio_crypto_akcipher_algs.c:381: undefined reference to `rsa_parse_pub_key'


vim +378 drivers/crypto/virtio/virtio_crypto_akcipher_algs.c

   354	
   355	static int virtio_crypto_rsa_set_key(struct crypto_akcipher *tfm,
   356					     const void *key,
   357					     unsigned int keylen,
   358					     bool private,
   359					     int padding_algo,
   360					     int hash_algo)
   361	{
   362		struct virtio_crypto_akcipher_ctx *ctx = akcipher_tfm_ctx(tfm);
   363		struct virtio_crypto_rsa_ctx *rsa_ctx = &ctx->rsa_ctx;
   364		struct virtio_crypto *vcrypto;
   365		struct virtio_crypto_ctrl_header header;
   366		struct virtio_crypto_akcipher_session_para para;
   367		struct rsa_key rsa_key = {0};
   368		int node = virtio_crypto_get_current_node();
   369		uint32_t keytype;
   370		int ret;
   371	
   372		/* mpi_free will test n, just free it. */
   373		mpi_free(rsa_ctx->n);
   374		rsa_ctx->n = NULL;
   375	
   376		if (private) {
   377			keytype = VIRTIO_CRYPTO_AKCIPHER_KEY_TYPE_PRIVATE;
 > 378			ret = rsa_parse_priv_key(&rsa_key, key, keylen);
   379		} else {
   380			keytype = VIRTIO_CRYPTO_AKCIPHER_KEY_TYPE_PUBLIC;
 > 381			ret = rsa_parse_pub_key(&rsa_key, key, keylen);
   382		}
   383	
   384		if (ret)
   385			return ret;
   386	
   387		rsa_ctx->n = mpi_read_raw_data(rsa_key.n, rsa_key.n_sz);
   388		if (!rsa_ctx->n)
   389			return -ENOMEM;
   390	
   391		if (!ctx->vcrypto) {
   392			vcrypto = virtcrypto_get_dev_node(node, VIRTIO_CRYPTO_SERVICE_AKCIPHER,
   393							VIRTIO_CRYPTO_AKCIPHER_RSA);
   394			if (!vcrypto) {
   395				pr_err("virtio_crypto: Could not find a virtio device in the system or unsupported algo\n");
   396				return -ENODEV;
   397			}
   398	
   399			ctx->vcrypto = vcrypto;
   400		} else {
   401			virtio_crypto_alg_akcipher_close_session(ctx);
   402		}
   403	
   404		/* set ctrl header */
   405		header.opcode =	cpu_to_le32(VIRTIO_CRYPTO_AKCIPHER_CREATE_SESSION);
   406		header.algo = cpu_to_le32(VIRTIO_CRYPTO_AKCIPHER_RSA);
   407		header.queue_id = 0;
   408	
   409		/* set RSA para */
   410		para.algo = cpu_to_le32(VIRTIO_CRYPTO_AKCIPHER_RSA);
   411		para.keytype = cpu_to_le32(keytype);
   412		para.keylen = cpu_to_le32(keylen);
   413		para.u.rsa.padding_algo = cpu_to_le32(padding_algo);
   414		para.u.rsa.hash_algo = cpu_to_le32(hash_algo);
   415	
   416		return virtio_crypto_alg_akcipher_init_session(ctx, &header, &para, key, keylen);
   417	}
   418	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linuxfoundation.org/mailman/listinfo/virtualization



[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux