Skip to content

Commit 3617abc

Browse files
committed
Fix warning: cannot convert argument of incomplete type 'void *' to 'WOLFTPM2_KEY *'. Fix extend.c:158:9: warning: Value stored to 'rc' is never read. Fix src/tpm2_wrap.c:2193:5: warning: Value stored to 'sensSz' is never read.
1 parent d986ec7 commit 3617abc

File tree

8 files changed

+10
-9
lines changed

8 files changed

+10
-9
lines changed

examples/bench/bench.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ int TPM2_Wrapper_BenchArgs(void* userCtx, int argc, char *argv[])
269269
if (rc != 0) goto exit;
270270

271271
if (paramEncAlg != TPM_ALG_NULL) {
272-
void* bindKey = &storageKey;
272+
WOLFTPM2_KEY* bindKey = &storageKey;
273273
#ifdef NO_RSA
274274
bindKey = NULL; /* cannot bind to key without RSA enabled */
275275
#endif

examples/keygen/keygen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ int TPM2_Keygen_Example(void* userCtx, int argc, char *argv[])
235235
if (rc != 0) goto exit;
236236

237237
if (paramEncAlg != TPM_ALG_NULL) {
238-
void* bindKey = primary;
238+
WOLFTPM2_KEY* bindKey = primary;
239239
#ifndef HAVE_ECC
240240
if (srkAlg == TPM_ALG_ECC)
241241
bindKey = NULL; /* cannot bind to key without ECC enabled */

examples/keygen/keyimport.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ int TPM2_Keyimport_Example(void* userCtx, int argc, char *argv[])
162162
if (rc != 0) goto exit;
163163

164164
if (paramEncAlg != TPM_ALG_NULL) {
165-
void* bindKey = &storage;
165+
WOLFTPM2_KEY* bindKey = &storage;
166166
#ifndef HAVE_ECC
167167
if (srkAlg == TPM_ALG_ECC)
168168
bindKey = NULL; /* cannot bind to key without ECC enabled */

examples/keygen/keyload.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ int TPM2_Keyload_Example(void* userCtx, int argc, char *argv[])
159159
if (rc != 0) goto exit;
160160
}
161161
else if (paramEncAlg != TPM_ALG_NULL) {
162-
void* bindKey = &storage;
162+
WOLFTPM2_KEY* bindKey = &storage;
163163
#ifndef HAVE_ECC
164164
if (srkAlg == TPM_ALG_ECC)
165165
bindKey = NULL; /* cannot bind to key without ECC enabled */

examples/pcr/extend.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ int TPM2_PCR_Extend_Test(void* userCtx, int argc, char *argv[])
155155
if (filename && fp != XBADFILE) {
156156
rc = TPM2_GetHashType(alg);
157157
hashType = (enum wc_HashType)rc;
158-
rc = 0;
159158
wc_HashInit(&dig, hashType);
160159
while (!XFEOF(fp)) {
161160
len = XFREAD(dataBuffer, 1, sizeof(dataBuffer), fp);

examples/pcr/quote.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ int TPM2_PCR_Quote_Test(void* userCtx, int argc, char *argv[])
184184
#endif
185185

186186
if (paramEncAlg != TPM_ALG_NULL) {
187-
void* bindKey = &storage;
187+
WOLFTPM2_KEY* bindKey = &storage;
188188
#ifndef HAVE_ECC
189189
if (alg == TPM_ALG_ECC)
190190
bindKey = NULL; /* cannot bind to key without ECC enabled */

examples/wrap/wrap_test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ int TPM2_Wrapper_TestArgs(void* userCtx, int argc, char *argv[])
267267

268268
/* Start an authenticated session (salted / unbound) with parameter encryption */
269269
if (paramEncAlg != TPM_ALG_NULL) {
270-
void* bindKey = &storageKey;
270+
WOLFTPM2_KEY* bindKey = &storageKey;
271271
#ifdef NO_RSA
272272
bindKey = NULL; /* cannot bind to key without RSA enabled */
273273
#endif
@@ -547,7 +547,7 @@ int TPM2_Wrapper_TestArgs(void* userCtx, int argc, char *argv[])
547547

548548
/* Start an authenticated session (salted / unbound) with parameter encryption */
549549
if (paramEncAlg != TPM_ALG_NULL) {
550-
void* bindKey = &storageKey;
550+
WOLFTPM2_KEY* bindKey = &storageKey;
551551
#ifndef HAVE_ECC
552552
bindKey = NULL; /* cannot bind to key without ECC enabled */
553553
#endif

src/tpm2_wrap.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2216,7 +2216,8 @@ static int SensitiveToPrivate(TPM2B_SENSITIVE* sens, TPM2B_PRIVATE* priv,
22162216
ivField.size == 0 ? NULL : ivField.buffer, AES_ENCRYPTION);
22172217
if (rc == 0) {
22182218
/* use inline encryption for both IV and sensitive */
2219-
rc = wc_AesCfbEncrypt(&enc, sensitiveData, sensitiveData, sensSz);
2219+
rc = wc_AesCfbEncrypt(&enc, sensitiveData, sensitiveData,
2220+
sensSz);
22202221
}
22212222
wc_AesFree(&enc);
22222223
}
@@ -2272,6 +2273,7 @@ static int SensitiveToPrivate(TPM2B_SENSITIVE* sens, TPM2B_PRIVATE* priv,
22722273
(void)sensitiveData;
22732274
(void)name;
22742275
(void)symKey;
2276+
(void)sensSz;
22752277
rc = NOT_COMPILED_IN;
22762278
#endif
22772279
}

0 commit comments

Comments
 (0)