forked from wolfSSL/wolfssl
I think I now understand the trailing white space...
This commit is contained in:
57
tests/api.c
57
tests/api.c
@@ -14824,8 +14824,7 @@ static void test_wc_PKCS7_EncodeEncryptedData (void)
|
|||||||
NULL, sizeof(decoded)), BAD_FUNC_ARG);
|
NULL, sizeof(decoded)), BAD_FUNC_ARG);
|
||||||
AssertIntEQ(wc_PKCS7_DecodeEncryptedData(&pkcs7, encrypted, encryptedSz,
|
AssertIntEQ(wc_PKCS7_DecodeEncryptedData(&pkcs7, encrypted, encryptedSz,
|
||||||
decoded, 0), BAD_FUNC_ARG);
|
decoded, 0), BAD_FUNC_ARG);
|
||||||
/* Test
|
/* Test struct fields */
|
||||||
struct fields */
|
|
||||||
|
|
||||||
tmpBytePtr = pkcs7.encryptionKey;
|
tmpBytePtr = pkcs7.encryptionKey;
|
||||||
pkcs7.encryptionKey = NULL;
|
pkcs7.encryptionKey = NULL;
|
||||||
@@ -14841,15 +14840,18 @@ static void test_wc_PKCS7_EncodeEncryptedData (void)
|
|||||||
#endif
|
#endif
|
||||||
} /* END test_wc_PKCS7_EncodeEncryptedData() */
|
} /* END test_wc_PKCS7_EncodeEncryptedData() */
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*
|
/*----------------------------------------------------------------------------*
|
||||||
| hash.h Tests
|
| hash.h Tests
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
static int test_wc_HashInit(void)
|
|
||||||
|
|
||||||
|
static int test_wc_HashInit(void)
|
||||||
{
|
{
|
||||||
int ret = 0, i; /* 0 indicates tests passed, 1 indicates failure */
|
int ret = 0, i; /* 0 indicates tests passed, 1 indicates failure */
|
||||||
|
|
||||||
wc_HashAlg hash;
|
wc_HashAlg hash;
|
||||||
|
|
||||||
/* enum for holding supported algorithms, #ifndef's restrict if disabled */
|
/* enum for holding supported algorithms, #ifndef's restrict if disabled */
|
||||||
enum wc_HashType enumArray[] = {
|
enum wc_HashType enumArray[] = {
|
||||||
#ifndef NO_MD5
|
#ifndef NO_MD5
|
||||||
@@ -14860,44 +14862,44 @@ static int test_wc_HashInit(void)
|
|||||||
#endif
|
#endif
|
||||||
#ifndef WOLFSSL_SHA224
|
#ifndef WOLFSSL_SHA224
|
||||||
WC_HASH_TYPE_SHA224,
|
WC_HASH_TYPE_SHA224,
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_SHA256
|
#ifndef NO_SHA256
|
||||||
WC_HASH_TYPE_SHA256,
|
WC_HASH_TYPE_SHA256,
|
||||||
#endif
|
#endif
|
||||||
#ifndef WOLFSSL_SHA384
|
#ifndef WOLFSSL_SHA384
|
||||||
WC_HASH_TYPE_SHA384,
|
WC_HASH_TYPE_SHA384,
|
||||||
#endif
|
#endif
|
||||||
#ifndef WOLFSSL_SHA512
|
#ifndef WOLFSSL_SHA512
|
||||||
WC_HASH_TYPE_SHA512,
|
WC_HASH_TYPE_SHA512,
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
/* dynamically finds the length */
|
/* dynamically finds the length */
|
||||||
int enumlen = (sizeof(enumArray)/sizeof(enum wc_HashType));
|
int enumlen = (sizeof(enumArray)/sizeof(enum wc_HashType));
|
||||||
|
|
||||||
/* For loop to test various arguments... */
|
/* For loop to test various arguments... */
|
||||||
for(i = 0; i < enumlen; i++) {
|
for (i = 0; i < enumlen; i++) {
|
||||||
/* check for bad args */
|
/* check for bad args */
|
||||||
if(wc_HashInit(&hash, enumArray[i]) == BAD_FUNC_ARG) {
|
if (wc_HashInit(&hash, enumArray[i]) == BAD_FUNC_ARG) {
|
||||||
ret = 1;
|
ret = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* check for null ptr */
|
/* check for null ptr */
|
||||||
if(wc_HashInit(NULL, enumArray[i]) != BAD_FUNC_ARG) {
|
if (wc_HashInit(NULL, enumArray[i]) != BAD_FUNC_ARG) {
|
||||||
ret = 1;
|
ret = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}/* end of for loop */
|
} /* end of for loop */
|
||||||
|
|
||||||
printf(testingFmt, "wc_HashInit()");
|
printf(testingFmt, "wc_HashInit()");
|
||||||
if(ret==0) { /* all tests have passed */
|
if (ret==0) { /* all tests have passed */
|
||||||
printf(resultFmt, passed);
|
printf(resultFmt, passed);
|
||||||
}
|
}
|
||||||
if(ret==1) { /* a test has failed */
|
else { /* a test has failed */
|
||||||
printf(resultFmt, failed);
|
printf(resultFmt, failed);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}/* end of test_wc_HashInit */
|
} /* end of test_wc_HashInit */
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*
|
/*----------------------------------------------------------------------------*
|
||||||
@@ -19050,7 +19052,6 @@ void ApiTest(void)
|
|||||||
test_wc_PKCS7_EncodeDecodeEnvelopedData();
|
test_wc_PKCS7_EncodeDecodeEnvelopedData();
|
||||||
test_wc_PKCS7_EncodeEncryptedData();
|
test_wc_PKCS7_EncodeEncryptedData();
|
||||||
|
|
||||||
|
|
||||||
printf(" End API Tests\n");
|
printf(" End API Tests\n");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user