linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org,
	Salvatore Benedetto <salvatore.benedetto@intel.com>
Subject: linux-next: build failure after merge of the crypto tree
Date: Fri, 24 Jun 2016 16:20:22 +1000	[thread overview]
Message-ID: <20160624162022.0f9c265a__29897.6471451626$1466759604$gmane$org@canb.auug.org.au> (raw)

Hi Herbert,

After merging the crypto tree, today's linux-next build (powerpc
allyesconfig) failed like this:

net/built-in.o: In function `.ecdh_shared_secret':
(.text+0x4ad8d0): multiple definition of `.ecdh_shared_secret'
crypto/built-in.o:(.text+0x113f0): first defined here
net/built-in.o:(.opd+0x430e0): multiple definition of `ecdh_shared_secret'
crypto/built-in.o:(.opd+0x1d40): first defined here

Caused by commit

  3c4b23901a0c ("crypto: ecdh - Add ECDH software support")

The other definition is in net/bluetooth/ecc.c

I added the following patch for today (probably a better name could
be chosen):

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Fri, 24 Jun 2016 16:13:37 +1000
Subject: [PATCH] crypto: make ecdh_shared_secret unique

There is another ecdh_shared_secret in net/bluetooth/ecc.c

Fixes: 3c4b23901a0c ("crypto: ecdh - Add ECDH software support")
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 crypto/ecc.c  | 2 +-
 crypto/ecc.h  | 6 +++---
 crypto/ecdh.c | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/crypto/ecc.c b/crypto/ecc.c
index 9aedec6bbe72..414c78a9c214 100644
--- a/crypto/ecc.c
+++ b/crypto/ecc.c
@@ -966,7 +966,7 @@ out:
 	return ret;
 }
 
-int ecdh_shared_secret(unsigned int curve_id, unsigned int ndigits,
+int crypto_ecdh_shared_secret(unsigned int curve_id, unsigned int ndigits,
 		       const u8 *private_key, unsigned int private_key_len,
 		       const u8 *public_key, unsigned int public_key_len,
 		       u8 *secret, unsigned int secret_len)
diff --git a/crypto/ecc.h b/crypto/ecc.h
index b5db4b989f3c..663d598c7406 100644
--- a/crypto/ecc.h
+++ b/crypto/ecc.h
@@ -60,7 +60,7 @@ int ecdh_make_pub_key(const unsigned int curve_id, unsigned int ndigits,
 		      u8 *public_key, unsigned int public_key_len);
 
 /**
- * ecdh_shared_secret() - Compute a shared secret
+ * crypto_ecdh_shared_secret() - Compute a shared secret
  *
  * @curve_id:		id representing the curve to use
  * @private_key:	private key of part A
@@ -70,13 +70,13 @@ int ecdh_make_pub_key(const unsigned int curve_id, unsigned int ndigits,
  * @secret:		buffer for storing the calculated shared secret
  * @secret_len:		length of the secret buffer
  *
- * Note: It is recommended that you hash the result of ecdh_shared_secret
+ * Note: It is recommended that you hash the result of crypto_ecdh_shared_secret
  * before using it for symmetric encryption or HMAC.
  *
  * Returns 0 if the shared secret was generated successfully, a negative value
  * if an error occurred.
  */
-int ecdh_shared_secret(unsigned int curve_id, unsigned int ndigits,
+int crypto_ecdh_shared_secret(unsigned int curve_id, unsigned int ndigits,
 		       const u8 *private_key, unsigned int private_key_len,
 		       const u8 *public_key, unsigned int public_key_len,
 		       u8 *secret, unsigned int secret_len);
diff --git a/crypto/ecdh.c b/crypto/ecdh.c
index d3a9eeca4b32..3de289806d67 100644
--- a/crypto/ecdh.c
+++ b/crypto/ecdh.c
@@ -79,7 +79,7 @@ static int ecdh_compute_value(struct kpp_request *req)
 		if (copied != 2 * nbytes)
 			return -EINVAL;
 
-		ret = ecdh_shared_secret(ctx->curve_id, ctx->ndigits,
+		ret = crypto_ecdh_shared_secret(ctx->curve_id, ctx->ndigits,
 					 (const u8 *)ctx->private_key, nbytes,
 					 (const u8 *)ctx->public_key, 2 * nbytes,
 					 (u8 *)ctx->shared_secret, nbytes);
-- 
2.8.1

-- 
Cheers,
Stephen Rothwell

             reply	other threads:[~2016-06-24  9:12 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-24  6:20 Stephen Rothwell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-03-13  0:57 linux-next: build failure after merge of the crypto tree Stephen Rothwell
2024-03-13  1:43 ` Herbert Xu
2024-03-13  1:45   ` Herbert Xu
2024-03-13  1:58     ` Barry Song
2024-03-13  2:01     ` Eric Biggers
2024-03-13  2:04       ` Herbert Xu
2024-03-13  2:29         ` Eric Biggers
2024-03-13  2:36           ` Herbert Xu
2024-03-13  2:12       ` Barry Song
2024-03-13  2:22         ` Eric Biggers
2023-10-30  4:58 Stephen Rothwell
2023-10-30  5:09 ` Stephen Rothwell
2023-10-30  5:23   ` Herbert Xu
2023-10-30 17:44     ` Dmitry Safonov
2023-10-30 22:02     ` Jakub Kicinski
2023-10-31  4:51       ` Eric Biggers
2023-10-31 20:14         ` Jakub Kicinski
2023-06-26  2:39 Stephen Rothwell
2023-06-26 10:20 ` Herbert Xu
2023-05-22  0:52 Stephen Rothwell
2023-05-22  5:15 ` Herbert Xu
2023-05-23  0:36   ` Stephen Rothwell
2023-04-11  0:48 Stephen Rothwell
2023-04-11  2:22 ` Herbert Xu
2023-01-17  3:47 Stephen Rothwell
2023-01-16  0:29 Stephen Rothwell
2022-12-04 23:48 Stephen Rothwell
2022-12-04 23:52 ` Stephen Rothwell
2022-09-07  1:53 Stephen Rothwell
2022-09-06  1:30 Stephen Rothwell
2022-05-09 11:10 Stephen Rothwell
2022-05-09 12:26 ` Masahiro Yamada
2021-09-27  4:32 Stephen Rothwell
2020-04-21  5:12 Stephen Rothwell
2020-04-22 13:33 ` Herbert Xu
2020-04-17  3:40 Stephen Rothwell
2020-04-17  4:00 ` Shukun Tan
2019-08-12  3:21 Stephen Rothwell
2019-08-12  6:53 ` Zhou Wang
     [not found] <20161129115529.41f9f0b5@canb.auug.org.au>
2016-11-29  7:08 ` Herbert Xu
     [not found] ` <20161129070840.GA5113@gondor.apana.org.au>
     [not found]   ` <DB4PR04MB084718B8EB90B061EA144C02988D0@DB4PR04MB0847.eurprd04.prod.outlook.com>
2016-11-29  8:43     ` Herbert Xu
     [not found] <20160720174634.53bad636@canb.auug.org.au>
2016-07-20 14:32 ` Herbert Xu
     [not found] <20150317130104.548124c2@canb.auug.org.au>
2015-03-17 11:11 ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='20160624162022.0f9c265a__29897.6471451626$1466759604$gmane$org@canb.auug.org.au' \
    --to=sfr@canb.auug.org.au \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=salvatore.benedetto@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).