mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 18:57:27 +02:00
Added test cases for EVP_PKCS82PKEY
and EVP_PKEY2PKCS8
.
This commit is contained in:
14
tests/api.c
14
tests/api.c
@ -35907,6 +35907,9 @@ static void test_wolfSSL_PKCS8_Compat(void)
|
|||||||
XFILE f;
|
XFILE f;
|
||||||
int bytes;
|
int bytes;
|
||||||
char pkcs8_buffer[512];
|
char pkcs8_buffer[512];
|
||||||
|
#if defined(OPENSSL_ALL) || defined(WOLFSSL_WPAS_SMALL)
|
||||||
|
EVP_PKEY *pkey = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
printf(testingFmt, "wolfSSL_pkcs8()");
|
printf(testingFmt, "wolfSSL_pkcs8()");
|
||||||
|
|
||||||
@ -35917,6 +35920,17 @@ static void test_wolfSSL_PKCS8_Compat(void)
|
|||||||
XFCLOSE(f);
|
XFCLOSE(f);
|
||||||
AssertNotNull(bio = BIO_new_mem_buf((void*)pkcs8_buffer, bytes));
|
AssertNotNull(bio = BIO_new_mem_buf((void*)pkcs8_buffer, bytes));
|
||||||
AssertNotNull(pt = d2i_PKCS8_PRIV_KEY_INFO_bio(bio, NULL));
|
AssertNotNull(pt = d2i_PKCS8_PRIV_KEY_INFO_bio(bio, NULL));
|
||||||
|
|
||||||
|
#if defined(OPENSSL_ALL) || defined(WOLFSSL_WPAS_SMALL)
|
||||||
|
AssertNotNull(pkey = EVP_PKCS82PKEY(pt));
|
||||||
|
AssertIntEQ(EVP_PKEY_type(pkey->type), EVP_PKEY_EC);
|
||||||
|
|
||||||
|
/* gets PKCS8 pointer to pkey */
|
||||||
|
AssertNotNull(EVP_PKEY2PKCS8(pkey));
|
||||||
|
|
||||||
|
EVP_PKEY_free(pkey);
|
||||||
|
#endif
|
||||||
|
|
||||||
BIO_free(bio);
|
BIO_free(bio);
|
||||||
PKCS8_PRIV_KEY_INFO_free(pt);
|
PKCS8_PRIV_KEY_INFO_free(pt);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user