mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-31 11:17:29 +02:00
Changed hardcoded values to variables, changed where some variables were defined, etc
This commit is contained in:
32
tests/api.c
32
tests/api.c
@ -33276,7 +33276,7 @@ static void test_wolfSSL_EVP_PKEY_base_id(void)
|
|||||||
|
|
||||||
AssertIntEQ(wolfSSL_EVP_PKEY_base_id(NULL), NID_undef);
|
AssertIntEQ(wolfSSL_EVP_PKEY_base_id(NULL), NID_undef);
|
||||||
|
|
||||||
AssertIntEQ(wolfSSL_EVP_PKEY_base_id(pkey), 6);
|
AssertIntEQ(wolfSSL_EVP_PKEY_base_id(pkey), EVP_PKEY_RSA);
|
||||||
|
|
||||||
EVP_PKEY_free(pkey);
|
EVP_PKEY_free(pkey);
|
||||||
|
|
||||||
@ -33294,7 +33294,7 @@ static void test_wolfSSL_EVP_PKEY_id(void)
|
|||||||
|
|
||||||
AssertIntEQ(wolfSSL_EVP_PKEY_id(NULL), 0);
|
AssertIntEQ(wolfSSL_EVP_PKEY_id(NULL), 0);
|
||||||
|
|
||||||
AssertIntEQ(wolfSSL_EVP_PKEY_id(pkey), 6);
|
AssertIntEQ(wolfSSL_EVP_PKEY_id(pkey), EVP_PKEY_RSA);
|
||||||
|
|
||||||
EVP_PKEY_free(pkey);
|
EVP_PKEY_free(pkey);
|
||||||
|
|
||||||
@ -33467,11 +33467,11 @@ static void test_wolfSSL_EVP_CIPHER_CTX_key_length(void)
|
|||||||
#if defined(OPENSSL_ALL) && !defined(NO_DES3)
|
#if defined(OPENSSL_ALL) && !defined(NO_DES3)
|
||||||
byte key[AES_256_KEY_SIZE] = {0};
|
byte key[AES_256_KEY_SIZE] = {0};
|
||||||
byte iv[AES_BLOCK_SIZE] = {0};
|
byte iv[AES_BLOCK_SIZE] = {0};
|
||||||
|
EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new();
|
||||||
|
const EVP_CIPHER *init = EVP_des_ede3_cbc();
|
||||||
|
|
||||||
printf(testingFmt, "wolfSSL_EVP_CIPHER_CTX_key_length");
|
printf(testingFmt, "wolfSSL_EVP_CIPHER_CTX_key_length");
|
||||||
|
|
||||||
EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new();
|
|
||||||
const EVP_CIPHER *init = EVP_des_ede3_cbc();
|
|
||||||
|
|
||||||
wolfSSL_EVP_CIPHER_CTX_init(ctx);
|
wolfSSL_EVP_CIPHER_CTX_init(ctx);
|
||||||
AssertIntEQ(EVP_CipherInit(ctx, init, key, iv, 1), WOLFSSL_SUCCESS);
|
AssertIntEQ(EVP_CipherInit(ctx, init, key, iv, 1), WOLFSSL_SUCCESS);
|
||||||
@ -33488,11 +33488,12 @@ static void test_wolfSSL_EVP_CIPHER_CTX_set_key_length(void)
|
|||||||
byte key[AES_256_KEY_SIZE] = {0};
|
byte key[AES_256_KEY_SIZE] = {0};
|
||||||
byte iv[AES_BLOCK_SIZE] = {0};
|
byte iv[AES_BLOCK_SIZE] = {0};
|
||||||
int keylen;
|
int keylen;
|
||||||
|
EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new();
|
||||||
|
const EVP_CIPHER *init = EVP_des_ede3_cbc();
|
||||||
|
|
||||||
printf(testingFmt, "wolfSSL_EVP_CIPHER_CTX_set_key_length");
|
printf(testingFmt, "wolfSSL_EVP_CIPHER_CTX_set_key_length");
|
||||||
|
|
||||||
EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new();
|
|
||||||
const EVP_CIPHER *init = EVP_des_ede3_cbc();
|
|
||||||
|
|
||||||
wolfSSL_EVP_CIPHER_CTX_init(ctx);
|
wolfSSL_EVP_CIPHER_CTX_init(ctx);
|
||||||
AssertIntEQ(EVP_CipherInit(ctx, init, key, iv, 1), WOLFSSL_SUCCESS);
|
AssertIntEQ(EVP_CipherInit(ctx, init, key, iv, 1), WOLFSSL_SUCCESS);
|
||||||
@ -33508,17 +33509,15 @@ static void test_wolfSSL_EVP_CIPHER_CTX_set_key_length(void)
|
|||||||
}
|
}
|
||||||
static void test_wolfSSL_EVP_CIPHER_CTX_set_iv(void)
|
static void test_wolfSSL_EVP_CIPHER_CTX_set_iv(void)
|
||||||
{
|
{
|
||||||
#if defined(OPENSSL_ALL) && defined(HAVE_AESGCM) && !defined(NO_DES3) &&\
|
#if defined(OPENSSL_ALL) && defined(HAVE_AESGCM) && !defined(NO_DES3)
|
||||||
!defined(NO_DES3)
|
|
||||||
byte key[DES3_KEY_SIZE] = {0};
|
byte key[DES3_KEY_SIZE] = {0};
|
||||||
byte iv[DES_IV_SIZE] = {0};
|
byte iv[DES_IV_SIZE] = {0};
|
||||||
int ivLen, keyLen;
|
int ivLen, keyLen;
|
||||||
|
|
||||||
printf(testingFmt, "wolfSSL_EVP_CIPHER_CTX_set_iv");
|
|
||||||
|
|
||||||
EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new();
|
EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new();
|
||||||
const EVP_CIPHER *init = EVP_des_ede3_cbc();
|
const EVP_CIPHER *init = EVP_des_ede3_cbc();
|
||||||
|
|
||||||
|
printf(testingFmt, "wolfSSL_EVP_CIPHER_CTX_set_iv");
|
||||||
|
|
||||||
wolfSSL_EVP_CIPHER_CTX_init(ctx);
|
wolfSSL_EVP_CIPHER_CTX_init(ctx);
|
||||||
AssertIntEQ(EVP_CipherInit(ctx, init, key, iv, 1), WOLFSSL_SUCCESS);
|
AssertIntEQ(EVP_CipherInit(ctx, init, key, iv, 1), WOLFSSL_SUCCESS);
|
||||||
|
|
||||||
@ -33543,7 +33542,7 @@ static void test_wolfSSL_EVP_CIPHER_CTX_set_iv(void)
|
|||||||
static void test_wolfSSL_EVP_PKEY_CTX_new_id(void)
|
static void test_wolfSSL_EVP_PKEY_CTX_new_id(void)
|
||||||
{
|
{
|
||||||
#if defined(OPENSSL_ALL)
|
#if defined(OPENSSL_ALL)
|
||||||
WOLFSSL_ENGINE* e = 0;
|
WOLFSSL_ENGINE* e = NULL;
|
||||||
int id = 0;
|
int id = 0;
|
||||||
EVP_PKEY_CTX *ctx;
|
EVP_PKEY_CTX *ctx;
|
||||||
|
|
||||||
@ -33650,9 +33649,9 @@ static void test_wolfSSL_EVP_get_digestbynid(void)
|
|||||||
|
|
||||||
printf(testingFmt, "wolfSSL_EVP_get_digestbynid");
|
printf(testingFmt, "wolfSSL_EVP_get_digestbynid");
|
||||||
|
|
||||||
AssertNotNull(wolfSSL_EVP_get_digestbynid(4)); /* NID_md5 */
|
AssertNotNull(wolfSSL_EVP_get_digestbynid(NID_md5));
|
||||||
AssertNotNull(wolfSSL_EVP_get_digestbynid(64)); /* NID_sha1 */
|
AssertNotNull(wolfSSL_EVP_get_digestbynid(NID_sha1));
|
||||||
AssertNull(wolfSSL_EVP_get_digestbynid(0)); /* default */
|
AssertNull(wolfSSL_EVP_get_digestbynid(0));
|
||||||
|
|
||||||
printf(resultFmt, passed);
|
printf(resultFmt, passed);
|
||||||
#endif
|
#endif
|
||||||
@ -33985,8 +33984,7 @@ static void test_wolfSSL_EVP_BytesToKey(void)
|
|||||||
}
|
}
|
||||||
static void test_IncCtr(void)
|
static void test_IncCtr(void)
|
||||||
{
|
{
|
||||||
#if defined(OPENSSL_ALL) && defined(HAVE_AESGCM) && !defined(NO_DES3) &&\
|
#if defined(OPENSSL_ALL) && defined(HAVE_AESGCM) && !defined(NO_DES3)
|
||||||
!defined(NO_DES3)
|
|
||||||
byte key[DES3_KEY_SIZE] = {0};
|
byte key[DES3_KEY_SIZE] = {0};
|
||||||
byte iv[DES_IV_SIZE] = {0};
|
byte iv[DES_IV_SIZE] = {0};
|
||||||
int type = EVP_CTRL_GCM_IV_GEN;
|
int type = EVP_CTRL_GCM_IV_GEN;
|
||||||
|
Reference in New Issue
Block a user