mirror of https://github.com/wolfSSL/wolfTPM.git
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`.
parent
d986ec73ba
commit
3617abca97
|
@ -269,7 +269,7 @@ int TPM2_Wrapper_BenchArgs(void* userCtx, int argc, char *argv[])
|
||||||
if (rc != 0) goto exit;
|
if (rc != 0) goto exit;
|
||||||
|
|
||||||
if (paramEncAlg != TPM_ALG_NULL) {
|
if (paramEncAlg != TPM_ALG_NULL) {
|
||||||
void* bindKey = &storageKey;
|
WOLFTPM2_KEY* bindKey = &storageKey;
|
||||||
#ifdef NO_RSA
|
#ifdef NO_RSA
|
||||||
bindKey = NULL; /* cannot bind to key without RSA enabled */
|
bindKey = NULL; /* cannot bind to key without RSA enabled */
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -235,7 +235,7 @@ int TPM2_Keygen_Example(void* userCtx, int argc, char *argv[])
|
||||||
if (rc != 0) goto exit;
|
if (rc != 0) goto exit;
|
||||||
|
|
||||||
if (paramEncAlg != TPM_ALG_NULL) {
|
if (paramEncAlg != TPM_ALG_NULL) {
|
||||||
void* bindKey = primary;
|
WOLFTPM2_KEY* bindKey = primary;
|
||||||
#ifndef HAVE_ECC
|
#ifndef HAVE_ECC
|
||||||
if (srkAlg == TPM_ALG_ECC)
|
if (srkAlg == TPM_ALG_ECC)
|
||||||
bindKey = NULL; /* cannot bind to key without ECC enabled */
|
bindKey = NULL; /* cannot bind to key without ECC enabled */
|
||||||
|
|
|
@ -162,7 +162,7 @@ int TPM2_Keyimport_Example(void* userCtx, int argc, char *argv[])
|
||||||
if (rc != 0) goto exit;
|
if (rc != 0) goto exit;
|
||||||
|
|
||||||
if (paramEncAlg != TPM_ALG_NULL) {
|
if (paramEncAlg != TPM_ALG_NULL) {
|
||||||
void* bindKey = &storage;
|
WOLFTPM2_KEY* bindKey = &storage;
|
||||||
#ifndef HAVE_ECC
|
#ifndef HAVE_ECC
|
||||||
if (srkAlg == TPM_ALG_ECC)
|
if (srkAlg == TPM_ALG_ECC)
|
||||||
bindKey = NULL; /* cannot bind to key without ECC enabled */
|
bindKey = NULL; /* cannot bind to key without ECC enabled */
|
||||||
|
|
|
@ -159,7 +159,7 @@ int TPM2_Keyload_Example(void* userCtx, int argc, char *argv[])
|
||||||
if (rc != 0) goto exit;
|
if (rc != 0) goto exit;
|
||||||
}
|
}
|
||||||
else if (paramEncAlg != TPM_ALG_NULL) {
|
else if (paramEncAlg != TPM_ALG_NULL) {
|
||||||
void* bindKey = &storage;
|
WOLFTPM2_KEY* bindKey = &storage;
|
||||||
#ifndef HAVE_ECC
|
#ifndef HAVE_ECC
|
||||||
if (srkAlg == TPM_ALG_ECC)
|
if (srkAlg == TPM_ALG_ECC)
|
||||||
bindKey = NULL; /* cannot bind to key without ECC enabled */
|
bindKey = NULL; /* cannot bind to key without ECC enabled */
|
||||||
|
|
|
@ -155,7 +155,6 @@ int TPM2_PCR_Extend_Test(void* userCtx, int argc, char *argv[])
|
||||||
if (filename && fp != XBADFILE) {
|
if (filename && fp != XBADFILE) {
|
||||||
rc = TPM2_GetHashType(alg);
|
rc = TPM2_GetHashType(alg);
|
||||||
hashType = (enum wc_HashType)rc;
|
hashType = (enum wc_HashType)rc;
|
||||||
rc = 0;
|
|
||||||
wc_HashInit(&dig, hashType);
|
wc_HashInit(&dig, hashType);
|
||||||
while (!XFEOF(fp)) {
|
while (!XFEOF(fp)) {
|
||||||
len = XFREAD(dataBuffer, 1, sizeof(dataBuffer), fp);
|
len = XFREAD(dataBuffer, 1, sizeof(dataBuffer), fp);
|
||||||
|
|
|
@ -184,7 +184,7 @@ int TPM2_PCR_Quote_Test(void* userCtx, int argc, char *argv[])
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (paramEncAlg != TPM_ALG_NULL) {
|
if (paramEncAlg != TPM_ALG_NULL) {
|
||||||
void* bindKey = &storage;
|
WOLFTPM2_KEY* bindKey = &storage;
|
||||||
#ifndef HAVE_ECC
|
#ifndef HAVE_ECC
|
||||||
if (alg == TPM_ALG_ECC)
|
if (alg == TPM_ALG_ECC)
|
||||||
bindKey = NULL; /* cannot bind to key without ECC enabled */
|
bindKey = NULL; /* cannot bind to key without ECC enabled */
|
||||||
|
|
|
@ -267,7 +267,7 @@ int TPM2_Wrapper_TestArgs(void* userCtx, int argc, char *argv[])
|
||||||
|
|
||||||
/* Start an authenticated session (salted / unbound) with parameter encryption */
|
/* Start an authenticated session (salted / unbound) with parameter encryption */
|
||||||
if (paramEncAlg != TPM_ALG_NULL) {
|
if (paramEncAlg != TPM_ALG_NULL) {
|
||||||
void* bindKey = &storageKey;
|
WOLFTPM2_KEY* bindKey = &storageKey;
|
||||||
#ifdef NO_RSA
|
#ifdef NO_RSA
|
||||||
bindKey = NULL; /* cannot bind to key without RSA enabled */
|
bindKey = NULL; /* cannot bind to key without RSA enabled */
|
||||||
#endif
|
#endif
|
||||||
|
@ -547,7 +547,7 @@ int TPM2_Wrapper_TestArgs(void* userCtx, int argc, char *argv[])
|
||||||
|
|
||||||
/* Start an authenticated session (salted / unbound) with parameter encryption */
|
/* Start an authenticated session (salted / unbound) with parameter encryption */
|
||||||
if (paramEncAlg != TPM_ALG_NULL) {
|
if (paramEncAlg != TPM_ALG_NULL) {
|
||||||
void* bindKey = &storageKey;
|
WOLFTPM2_KEY* bindKey = &storageKey;
|
||||||
#ifndef HAVE_ECC
|
#ifndef HAVE_ECC
|
||||||
bindKey = NULL; /* cannot bind to key without ECC enabled */
|
bindKey = NULL; /* cannot bind to key without ECC enabled */
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -2216,7 +2216,8 @@ static int SensitiveToPrivate(TPM2B_SENSITIVE* sens, TPM2B_PRIVATE* priv,
|
||||||
ivField.size == 0 ? NULL : ivField.buffer, AES_ENCRYPTION);
|
ivField.size == 0 ? NULL : ivField.buffer, AES_ENCRYPTION);
|
||||||
if (rc == 0) {
|
if (rc == 0) {
|
||||||
/* use inline encryption for both IV and sensitive */
|
/* use inline encryption for both IV and sensitive */
|
||||||
rc = wc_AesCfbEncrypt(&enc, sensitiveData, sensitiveData, sensSz);
|
rc = wc_AesCfbEncrypt(&enc, sensitiveData, sensitiveData,
|
||||||
|
sensSz);
|
||||||
}
|
}
|
||||||
wc_AesFree(&enc);
|
wc_AesFree(&enc);
|
||||||
}
|
}
|
||||||
|
@ -2272,6 +2273,7 @@ static int SensitiveToPrivate(TPM2B_SENSITIVE* sens, TPM2B_PRIVATE* priv,
|
||||||
(void)sensitiveData;
|
(void)sensitiveData;
|
||||||
(void)name;
|
(void)name;
|
||||||
(void)symKey;
|
(void)symKey;
|
||||||
|
(void)sensSz;
|
||||||
rc = NOT_COMPILED_IN;
|
rc = NOT_COMPILED_IN;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue