forked from wolfSSL/wolfssl
remove uint from test case and put variable declaration at top of scope
This commit is contained in:
64
tests/api.c
64
tests/api.c
@@ -34252,43 +34252,45 @@ static void test_wolfSSL_Tls13_Key_Logging_test(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* check if the keylog file exists */
|
/* check if the keylog file exists */
|
||||||
|
{
|
||||||
|
char buff[300] = {0};
|
||||||
|
int found[4] = {0};
|
||||||
|
int numfnd = 0;
|
||||||
|
int i;
|
||||||
|
|
||||||
char buff[300] = {0};
|
fp = XFOPEN("./MyKeyLog.txt", "r");
|
||||||
int found[4] = {0};
|
|
||||||
|
|
||||||
fp = XFOPEN("./MyKeyLog.txt", "r");
|
AssertNotNull(fp);
|
||||||
|
|
||||||
AssertNotNull(fp);
|
while (XFGETS( buff, (int)sizeof(buff),fp) != NULL ) {
|
||||||
|
if (0 == strncmp(buff,"CLIENT_HANDSHAKE_TRAFFIC_SECRET ",
|
||||||
while(XFGETS( buff, (int)sizeof(buff),fp) != NULL ) {
|
sizeof("CLIENT_HANDSHAKE_TRAFFIC_SECRET ")-1)) {
|
||||||
if(0 == strncmp(buff,"CLIENT_HANDSHAKE_TRAFFIC_SECRET ",
|
found[0] = 1;
|
||||||
sizeof("CLIENT_HANDSHAKE_TRAFFIC_SECRET ")-1)) {
|
continue;
|
||||||
found[0] = 1;
|
}
|
||||||
continue;
|
else if (0 == strncmp(buff,"SERVER_HANDSHAKE_TRAFFIC_SECRET ",
|
||||||
|
sizeof("SERVER_HANDSHAKE_TRAFFIC_SECRET ")-1)) {
|
||||||
|
found[1] = 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if (0 == strncmp(buff,"CLIENT_TRAFFIC_SECRET_0 ",
|
||||||
|
sizeof("CLIENT_TRAFFIC_SECRET_0 ")-1)) {
|
||||||
|
found[2] = 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if (0 == strncmp(buff,"SERVER_TRAFFIC_SECRET_0 ",
|
||||||
|
sizeof("SERVER_TRAFFIC_SECRET_0 ")-1)) {
|
||||||
|
found[3] = 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(0 == strncmp(buff,"SERVER_HANDSHAKE_TRAFFIC_SECRET ",
|
XFCLOSE(fp);
|
||||||
sizeof("SERVER_HANDSHAKE_TRAFFIC_SECRET ")-1)) {
|
for (i = 0; i < 4; i++) {
|
||||||
found[1] = 1;
|
if( found[i] != 0)
|
||||||
continue;
|
numfnd++;
|
||||||
}
|
|
||||||
else if(0 == strncmp(buff,"CLIENT_TRAFFIC_SECRET_0 ",
|
|
||||||
sizeof("CLIENT_TRAFFIC_SECRET_0 ")-1)) {
|
|
||||||
found[2] = 1;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
else if(0 == strncmp(buff,"SERVER_TRAFFIC_SECRET_0 ",
|
|
||||||
sizeof("SERVER_TRAFFIC_SECRET_0 ")-1)) {
|
|
||||||
found[3] = 1;
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
AssertIntEQ(numfnd, 4);
|
||||||
}
|
}
|
||||||
XFCLOSE(fp);
|
|
||||||
int numfnd = 0;
|
|
||||||
for( uint i = 0; i < 4; i++) {
|
|
||||||
if( found[i] != 0)
|
|
||||||
numfnd++;
|
|
||||||
}
|
|
||||||
AssertIntEQ( numfnd,4 );
|
|
||||||
|
|
||||||
printf(resultFmt, passed);
|
printf(resultFmt, passed);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user