All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] KEYS: trusted: remove set but not used variable ''
@ 2018-10-11  7:06 ` YueHaibing
  0 siblings, 0 replies; 8+ messages in thread
From: YueHaibing @ 2018-10-11  6:56 UTC (permalink / raw)
  To: James Bottomley, Mimi Zohar, David Howells, James Morris,
	Serge E. Hallyn
  Cc: YueHaibing, linux-integrity, keyrings, linux-security-module,
	kernel-janitors

Fixes gcc '-Wunused-but-set-variable' warning:

security/keys/trusted.c: In function 'tpm_unseal':
security/keys/trusted.c:592:11: warning:
 variable 'keyhndl' set but not used [-Wunused-but-set-variable]
  uint32_t keyhndl;

It never used since introduction in 
commit d00a1c72f7f4 ("keys: add new trusted key-type")

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 security/keys/trusted.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/security/keys/trusted.c b/security/keys/trusted.c
index ff67893..169df79 100644
--- a/security/keys/trusted.c
+++ b/security/keys/trusted.c
@@ -589,7 +589,6 @@ static int tpm_unseal(struct tpm_buf *tb,
 	uint32_t authhandle2 = 0;
 	unsigned char cont = 0;
 	uint32_t ordinal;
-	uint32_t keyhndl;
 	int ret;
 
 	/* sessions for unsealing key and data */
@@ -605,7 +604,6 @@ static int tpm_unseal(struct tpm_buf *tb,
 	}
 
 	ordinal = htonl(TPM_ORD_UNSEAL);
-	keyhndl = htonl(SRKHANDLE);
 	ret = tpm_get_random(NULL, nonceodd, TPM_NONCE_SIZE);
 	if (ret != TPM_NONCE_SIZE) {
 		pr_info("trusted_key: tpm_get_random failed (%d)\n", ret);

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH -next] KEYS: trusted: remove set but not used variable ''
@ 2018-10-11  7:06 ` YueHaibing
  0 siblings, 0 replies; 8+ messages in thread
From: YueHaibing @ 2018-10-11  7:06 UTC (permalink / raw)
  To: James Bottomley, Mimi Zohar, David Howells, James Morris,
	Serge E. Hallyn
  Cc: YueHaibing, linux-integrity, keyrings, linux-security-module,
	kernel-janitors

Fixes gcc '-Wunused-but-set-variable' warning:

security/keys/trusted.c: In function 'tpm_unseal':
security/keys/trusted.c:592:11: warning:
 variable 'keyhndl' set but not used [-Wunused-but-set-variable]
  uint32_t keyhndl;

It never used since introduction in 
commit d00a1c72f7f4 ("keys: add new trusted key-type")

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 security/keys/trusted.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/security/keys/trusted.c b/security/keys/trusted.c
index ff67893..169df79 100644
--- a/security/keys/trusted.c
+++ b/security/keys/trusted.c
@@ -589,7 +589,6 @@ static int tpm_unseal(struct tpm_buf *tb,
 	uint32_t authhandle2 = 0;
 	unsigned char cont = 0;
 	uint32_t ordinal;
-	uint32_t keyhndl;
 	int ret;
 
 	/* sessions for unsealing key and data */
@@ -605,7 +604,6 @@ static int tpm_unseal(struct tpm_buf *tb,
 	}
 
 	ordinal = htonl(TPM_ORD_UNSEAL);
-	keyhndl = htonl(SRKHANDLE);
 	ret = tpm_get_random(NULL, nonceodd, TPM_NONCE_SIZE);
 	if (ret != TPM_NONCE_SIZE) {
 		pr_info("trusted_key: tpm_get_random failed (%d)\n", ret);


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v2 -next] KEYS: trusted: remove set but not used variable 'keyhndl'
  2018-10-11  7:06 ` YueHaibing
@ 2018-10-19 11:48   ` YueHaibing
  -1 siblings, 0 replies; 8+ messages in thread
From: YueHaibing @ 2018-10-19 11:48 UTC (permalink / raw)
  To: James Bottomley, Mimi Zohar, David Howells, James Morris,
	Serge E. Hallyn
  Cc: YueHaibing, linux-integrity, keyrings, linux-security-module,
	kernel-janitors

Fixes gcc '-Wunused-but-set-variable' warning:

security/keys/trusted.c: In function 'tpm_unseal':
security/keys/trusted.c:592:11: warning:
 variable 'keyhndl' set but not used [-Wunused-but-set-variable]
  uint32_t keyhndl;

It never used since introduction in 
commit d00a1c72f7f4 ("keys: add new trusted key-type")

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
v2: fix patch title
---
 security/keys/trusted.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/security/keys/trusted.c b/security/keys/trusted.c
index ff67893..169df79 100644
--- a/security/keys/trusted.c
+++ b/security/keys/trusted.c
@@ -589,7 +589,6 @@ static int tpm_unseal(struct tpm_buf *tb,
 	uint32_t authhandle2 = 0;
 	unsigned char cont = 0;
 	uint32_t ordinal;
-	uint32_t keyhndl;
 	int ret;
 
 	/* sessions for unsealing key and data */
@@ -605,7 +604,6 @@ static int tpm_unseal(struct tpm_buf *tb,
 	}
 
 	ordinal = htonl(TPM_ORD_UNSEAL);
-	keyhndl = htonl(SRKHANDLE);
 	ret = tpm_get_random(NULL, nonceodd, TPM_NONCE_SIZE);
 	if (ret != TPM_NONCE_SIZE) {
 		pr_info("trusted_key: tpm_get_random failed (%d)\n", ret);

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v2 -next] KEYS: trusted: remove set but not used variable 'keyhndl'
@ 2018-10-19 11:48   ` YueHaibing
  0 siblings, 0 replies; 8+ messages in thread
From: YueHaibing @ 2018-10-19 11:48 UTC (permalink / raw)
  To: James Bottomley, Mimi Zohar, David Howells, James Morris,
	Serge E. Hallyn
  Cc: YueHaibing, linux-integrity, keyrings, linux-security-module,
	kernel-janitors

Fixes gcc '-Wunused-but-set-variable' warning:

security/keys/trusted.c: In function 'tpm_unseal':
security/keys/trusted.c:592:11: warning:
 variable 'keyhndl' set but not used [-Wunused-but-set-variable]
  uint32_t keyhndl;

It never used since introduction in 
commit d00a1c72f7f4 ("keys: add new trusted key-type")

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
v2: fix patch title
---
 security/keys/trusted.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/security/keys/trusted.c b/security/keys/trusted.c
index ff67893..169df79 100644
--- a/security/keys/trusted.c
+++ b/security/keys/trusted.c
@@ -589,7 +589,6 @@ static int tpm_unseal(struct tpm_buf *tb,
 	uint32_t authhandle2 = 0;
 	unsigned char cont = 0;
 	uint32_t ordinal;
-	uint32_t keyhndl;
 	int ret;
 
 	/* sessions for unsealing key and data */
@@ -605,7 +604,6 @@ static int tpm_unseal(struct tpm_buf *tb,
 	}
 
 	ordinal = htonl(TPM_ORD_UNSEAL);
-	keyhndl = htonl(SRKHANDLE);
 	ret = tpm_get_random(NULL, nonceodd, TPM_NONCE_SIZE);
 	if (ret != TPM_NONCE_SIZE) {
 		pr_info("trusted_key: tpm_get_random failed (%d)\n", ret);


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 -next] KEYS: trusted: remove set but not used variable 'keyhndl'
  2018-10-19 11:48   ` YueHaibing
@ 2018-10-19 16:30     ` James Bottomley
  -1 siblings, 0 replies; 8+ messages in thread
From: James Bottomley @ 2018-10-19 16:30 UTC (permalink / raw)
  To: YueHaibing, Mimi Zohar, David Howells, James Morris, Serge E. Hallyn
  Cc: linux-integrity, keyrings, linux-security-module, kernel-janitors

On Fri, 2018-10-19 at 11:48 +0000, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> security/keys/trusted.c: In function 'tpm_unseal':
> security/keys/trusted.c:592:11: warning:
>  variable 'keyhndl' set but not used [-Wunused-but-set-variable]
>   uint32_t keyhndl;
> 
> It never used since introduction in 
> commit d00a1c72f7f4 ("keys: add new trusted key-type")

This triggered an "er, shouldn't we be using the SRK parent by
default?"  search through the code, but it turns out that's all taken
care of in trusted_options_alloc() where we'll set up the SRK as parent
with well known auth and unless overridden on the command line, that's
what we use, so I'm happy this is simply left over code from a
different implementation of that use case.

James

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 -next] KEYS: trusted: remove set but not used variable 'keyhndl'
@ 2018-10-19 16:30     ` James Bottomley
  0 siblings, 0 replies; 8+ messages in thread
From: James Bottomley @ 2018-10-19 16:30 UTC (permalink / raw)
  To: YueHaibing, Mimi Zohar, David Howells, James Morris, Serge E. Hallyn
  Cc: linux-integrity, keyrings, linux-security-module, kernel-janitors

On Fri, 2018-10-19 at 11:48 +0000, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> security/keys/trusted.c: In function 'tpm_unseal':
> security/keys/trusted.c:592:11: warning:
>  variable 'keyhndl' set but not used [-Wunused-but-set-variable]
>   uint32_t keyhndl;
> 
> It never used since introduction in 
> commit d00a1c72f7f4 ("keys: add new trusted key-type")

This triggered an "er, shouldn't we be using the SRK parent by
default?"  search through the code, but it turns out that's all taken
care of in trusted_options_alloc() where we'll set up the SRK as parent
with well known auth and unless overridden on the command line, that's
what we use, so I'm happy this is simply left over code from a
different implementation of that use case.

James


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 -next] KEYS: trusted: remove set but not used variable 'keyhndl'
  2018-10-19 16:30     ` James Bottomley
@ 2018-10-21  9:00       ` YueHaibing
  -1 siblings, 0 replies; 8+ messages in thread
From: YueHaibing @ 2018-10-21  9:00 UTC (permalink / raw)
  To: James Bottomley, Mimi Zohar, David Howells, James Morris,
	Serge E. Hallyn
  Cc: linux-integrity, keyrings, linux-security-module, kernel-janitors

On 2018/10/20 0:30, James Bottomley wrote:
> On Fri, 2018-10-19 at 11:48 +0000, YueHaibing wrote:
>> Fixes gcc '-Wunused-but-set-variable' warning:
>>
>> security/keys/trusted.c: In function 'tpm_unseal':
>> security/keys/trusted.c:592:11: warning:
>>  variable 'keyhndl' set but not used [-Wunused-but-set-variable]
>>   uint32_t keyhndl;
>>
>> It never used since introduction in 
>> commit d00a1c72f7f4 ("keys: add new trusted key-type")
> 
> This triggered an "er, shouldn't we be using the SRK parent by
> default?"  search through the code, but it turns out that's all taken
> care of in trusted_options_alloc() where we'll set up the SRK as parent
> with well known auth and unless overridden on the command line, that's
> what we use, so I'm happy this is simply left over code from a
> different implementation of that use case.

Thank you for comment.

> 
> James
> 
> 
> .
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 -next] KEYS: trusted: remove set but not used variable 'keyhndl'
@ 2018-10-21  9:00       ` YueHaibing
  0 siblings, 0 replies; 8+ messages in thread
From: YueHaibing @ 2018-10-21  9:00 UTC (permalink / raw)
  To: James Bottomley, Mimi Zohar, David Howells, James Morris,
	Serge E. Hallyn
  Cc: linux-integrity, keyrings, linux-security-module, kernel-janitors

On 2018/10/20 0:30, James Bottomley wrote:
> On Fri, 2018-10-19 at 11:48 +0000, YueHaibing wrote:
>> Fixes gcc '-Wunused-but-set-variable' warning:
>>
>> security/keys/trusted.c: In function 'tpm_unseal':
>> security/keys/trusted.c:592:11: warning:
>>  variable 'keyhndl' set but not used [-Wunused-but-set-variable]
>>   uint32_t keyhndl;
>>
>> It never used since introduction in 
>> commit d00a1c72f7f4 ("keys: add new trusted key-type")
> 
> This triggered an "er, shouldn't we be using the SRK parent by
> default?"  search through the code, but it turns out that's all taken
> care of in trusted_options_alloc() where we'll set up the SRK as parent
> with well known auth and unless overridden on the command line, that's
> what we use, so I'm happy this is simply left over code from a
> different implementation of that use case.

Thank you for comment.

> 
> James
> 
> 
> .
> 


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-10-21  9:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-11  6:56 [PATCH -next] KEYS: trusted: remove set but not used variable '' YueHaibing
2018-10-11  7:06 ` YueHaibing
2018-10-19 11:48 ` [PATCH v2 -next] KEYS: trusted: remove set but not used variable 'keyhndl' YueHaibing
2018-10-19 11:48   ` YueHaibing
2018-10-19 16:30   ` James Bottomley
2018-10-19 16:30     ` James Bottomley
2018-10-21  9:00     ` YueHaibing
2018-10-21  9:00       ` YueHaibing

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.