Merge pull request #5632 from JacobBarthelmeh/Testing

Misc. testing items
pull/5633/head
Sean Parkinson 2022-09-27 08:25:18 +10:00 committed by GitHub
commit 8617de86c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 6 deletions

View File

@ -55869,7 +55869,7 @@ static byte test_AEAD_done = 0;
static int test_AEAD_cbiorecv(WOLFSSL *ssl, char *buf, int sz, void *ctx)
{
int ret = recv(wolfSSL_get_fd(ssl), buf, sz, 0);
int ret = (int)recv(wolfSSL_get_fd(ssl), buf, sz, 0);
if (ret > 0) {
if (test_AEAD_fail_decryption) {
/* Modify the packet to trigger a decryption failure */

View File

@ -15631,15 +15631,20 @@ int sp_todecimal(sp_int* a, char* str)
i = 0;
while (!sp_iszero(t)) {
sp_div_d(t, 10, t, &d);
err = sp_div_d(t, 10, t, &d);
if (err != MP_OKAY) {
break;
}
str[i++] = (char)('0' + d);
}
str[i] = '\0';
for (j = 0; j <= (i - 1) / 2; j++) {
int c = (unsigned char)str[j];
str[j] = str[i - 1 - j];
str[i - 1 - j] = (char)c;
if (err == MP_OKAY) {
for (j = 0; j <= (i - 1) / 2; j++) {
int c = (unsigned char)str[j];
str[j] = str[i - 1 - j];
str[i - 1 - j] = (char)c;
}
}
}