diff --git a/src/ssl.c b/src/ssl.c index fc2aa63bf..6c30d2dab 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -21201,6 +21201,9 @@ int wolfSSL_X509_cmp(const WOLFSSL_X509 *a, const WOLFSSL_X509 *b) mp_to_unsigned_bin(&rsa.e, rawKey); if ((word32)rawLen <= sizeof(word32)) { idx = *(word32*)rawKey; + #ifdef BIG_ENDIAN_ORDER + idx = ByteReverseWord32(idx); + #endif } XSNPRINTF(tmp, sizeof(tmp) - 1, "\n Exponent: %d\n", idx); @@ -33316,6 +33319,9 @@ int wolfSSL_RSA_print(WOLFSSL_BIO* bio, WOLFSSL_RSA* rsa, int offset) mp_to_unsigned_bin(rsaElem, rawKey); if ((word32)rawLen <= sizeof(word32)) { idx = *(word32*)rawKey; + #ifdef BIG_ENDIAN_ORDER + idx = ByteReverseWord32(idx); + #endif } XSNPRINTF(tmp, sizeof(tmp) - 1, "\nExponent: %d (0x%x)", idx, idx); if (wolfSSL_BIO_write(bio, tmp, (int)XSTRLEN(tmp)) <= 0) { diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index ce9e7f443..08902d535 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -21328,7 +21328,13 @@ static int myDecryptionFunc(PKCS7* pkcs7, int encryptOID, byte* iv, int ivSz, /* keyIdRaw[0] OCTET TAG */ /* keyIdRaw[1] Length */ +#ifdef BIG_ENDIAN_ORDER + if (keyIdRaw[1] == 0x01) { + keyId = 1; + } +#else keyId = *(int*)(keyIdRaw + 2); +#endif }